§1

The window is not the world

A context window is the model request’s finite token budget. A working set is the information the harness actually places inside that window for the next inference.

The working set is assembled from a larger world: instructions, transcript events, tool schemas, observations, summaries, retrieved material, and durable artifacts. Some items enter verbatim; some are transformed; some stay outside with a pointer; some are dropped. Interpretation

The transcript is not identical to the working set. Nor is durable state. A harness may retain a full tool output on disk, display it in the UI, and send only a short excerpt to the model. “Saved,” “visible to the user,” and “visible to the model now” are three separate properties.

§2

An eight-item context ledger

ItemTokensWhy it is presentIf pressure rises
Instructions1,400Defines role, task constraints, and operating rules.Usually protected; deduplicate repeated guidance.
Tool definitions900Describes capabilities available for this step.Expose only relevant tools or use a smaller presentation.
Recent conversation2,400Preserves the current line of reasoning and user intent.Keep recent turns; compress or summarize older ones.
Older conversation1,800Carries decisions and evidence from earlier work.Compact into a summary while retaining the original durably.
Repository map900Orients the model before narrower reads.Regenerate or retrieve only the relevant subtree.
File read3,600Supplies exact code for the current hypothesis.Paginate, select a range, or spill the full file with a pointer.
Test output1,600Provides environmental evidence about the failure.Keep the failure frame; truncate repeated stack or log noise.
Free/output reserve3,400Leaves room for new observations and the model response.Protect it; overflowing the window is not a useful strategy.
Total window16,000A simplified accounting example; providers count tokens under their own rules.

§3

Operate on the working set

The controls below all reduce or change pressure differently. Watch both columns: model-visible context and durable off-context state. The decision record names when exact information is preserved, made indirect, or discarded.

§4

Six operations, six information contracts

Add
Place new content directly in context. This is lossless for the item but consumes budget immediately.
Paginate
Expose one bounded slice while retaining the rest for later pages. The model lacks the hidden portion now, but exact recovery remains possible.
Truncate
Keep a prefix, suffix, or selected frame and discard the remainder from this representation. Unless another copy exists, this is irreversible information loss.
Spill
Move exact content to durable storage and leave a handle, path, or artifact ID in context. The data survives; immediate model visibility does not.
Retrieve
Select content from durable state or an index and copy it into the working set. Retrieval can miss relevant material, so absence from results is not proof of absence.
Compact
Replace a larger source region with a smaller derived summary. The original may remain durable, while the model sees gist and selected facts rather than exact wording.

Compaction is different from truncation because it creates a new representation intended to preserve useful meaning. It is different from retrieval because it transforms a known source region rather than searching a larger corpus. Its quality depends on what the summarizer selects and what later tasks need.

§6

Maintain an information-loss ledger

Every context transformation should answer four questions: what remained verbatim, what became a derived representation, what moved outside the model’s view, and what can no longer be recovered. That ledger matters when a later answer depends on a detail omitted by an earlier summary.

A practical harness can record source identifiers and token estimates beside a summary, attach artifact handles to spilled outputs, include continuation instructions after pagination, and distinguish “not retrieved” from “not present.” These small contracts prevent the model from treating a partial view as the complete world.

Created by Varma Chanderraju. Built with Codex, Claude and Gemini. · Glossary · Sources