Case UW-009 ends in a way the underwriting agent did not expect. It recommends approve for a submission. The underwriter reads the file, disagrees, and declines, writing a reason. That decision, with its reason, is now the most valuable piece of evidence the insurer has about submissions like this one.
A month later a similar submission arrives. Does the agent know about the override? The team asks three people and gets three answers. "Yes, the agent has memory." "No, every model call is stateless." "It depends on whether the run was resumed." All three are partly right, because they are talking about three different places where information can live.
This page separates them, because each one fails in its own way, and because each one enters the model's window by a different path.
Three stores#
The first store is working context: what the model can see in this call. It is the window itself, assembled fresh for each call, and it disappears when the call ends. The roof conflict of SUB-1004 (application 9 years, provider 22) belongs here: the next call must read it to recommend.
The second is durable memory: information the system keeps between sessions and between submissions, because it stays true and useful beyond one run. The underwriter's override on UW-009 belongs here. So does a standing preference of an underwriter ("show both roof values side by side"), or the fact that a broker prefers all questions in one message.
The third is checkpoint state: the saved position of a run, so that it can resume after a pause, a crash or a wait for an outside answer. "Run run-7f3a completed step 38; question Q-1004-01 to the broker is open" belongs here. The model usually does not need to read it at all. The software around the model, the agent harness, uses it to continue.
A session is one continuous stretch of work with one window that grows (a conversation, or one run of the agent). Working context lives inside a session. Durable memory outlives it. Checkpoint state lets a run continue in a new session as if the old one had not ended.
Before AI. A Java service has the same three. Local variables of a request (working context), rows in the database (durable memory), and the saved state of a long-running workflow or a Kafka consumer offset (checkpoint state). Nobody confuses a consumer offset with a customer record. With agents the confusion is easy because all three, when they matter, end up as text in a window.
Sort the run of SUB-1004#
The example's boundaries.py lists eight facts from the SUB-1004 run and the store each belongs to (real output of python3 boundaries.py):
Sorter: eight items, three stores
S1 working context The roof conflict of SUB-1004: application 9 years, provider 22 years
S2 working context The text of R-ROOF-03 under policy 2026.2
S3 working context The provider's 4,000-token roof report
S4 durable memory The underwriter's standing preference: show both roof values side by side
S5 durable memory The broker prefers all questions in one message
S6 durable memory The underwriter's override on SUB-1009 (decline, with the reason)
S7 checkpoint state The id of the last completed step of run-7f3a (step 38)
S8 checkpoint state Question Q-1004-01 to the broker is open; attempt_number 1
Two of them surprise people. The text of R-ROOF-03 (S2) is not durable memory, although it is durable: it lives in the policy documents and is retrieved when a step needs it. A copy kept in memory would go stale at the next policy change. And the provider's long report (S3) is working context only for the one call that needs it; afterwards the run keeps a reference (its evidence id), not the text.
Try it before you read the reasons. Place each item, then read why.
| Item | Store | Why | How it reaches a window |
|---|---|---|---|
| S1 Roof conflict of SUB-1004 | working context | The next call must read it to recommend | As two evidence items, each with its source |
| S2 Text of R-ROOF-03 | working context | Retrieved when needed; a memory copy would go stale | As a retrieved passage with its version |
| S3 The 4,000-token report | working context | Needed for one call, then only its summary matters | Trimmed to the tools share, or cleared after use |
| S4 Underwriter's preference | durable memory | True across sessions; shapes every later recommendation | Recalled into the instructions part at session start |
| S5 Broker prefers one message | durable memory | A lasting fact about a counterpart | Recalled when the agent drafts a question |
| S6 Override on SUB-1009 | durable memory | A human decision is evidence for later runs (UW-009) | As a past decision from find_similar_decisions |
| S7 Last completed step | checkpoint state | The saved position; the model does not need it | Usually not at all; the harness resumes from it |
| S8 Open question Q-1004-01 | checkpoint state | The run waits on an outside answer | As one pinned line of the resumed run's state |
Diagram: Three stores, one door · every store reaches the model only through the assembler
Read left to right. Working context is built for one call. Durable memory and checkpoint state live outside any window and enter only when the assembler recalls them. Click a box to see the item of the SUB-1004 run that belongs there.
- Stores
- Working context: What the model sees now. Rebuilt for every call; gone when the call ends.
- Durable memory: What the system keeps because it stays true and useful beyond one run.
- Checkpoint state: The saved position of a run so it can resume after a pause or a crash.
- The only door
- Recall: Choosing which stored items to put into this window, labelled and within a budget share.
- One model call
- Window: Recalled items are candidates like any other: filtered, ranked, packed and recorded.
- The harness
- Resume: The runtime continues the run from its saved position; the model needs at most one pinned line of it.
Every store enters through the window#
The last column is the point of this page for context engineering. Durable memory and checkpoint state never reach the model directly. They reach it only by being put into a window, and that is an assembler decision like any other: which memories to recall, how many, labelled how, in which share of the budget.
Taking a stored item and putting it into a window is memory recall. In the example the override of UW-009 is recalled in the most ordinary way possible: it is stored as a past decision, and find_similar_decisions returns it when a similar submission arrives. It then passes through the same stages as every other candidate. It can be omitted as superseded if it was made under an old policy version, or as below_rank_cutoff if three more similar decisions exist. A memory that is never recalled has no effect on the answer, however carefully it was stored.
Common confusion. "Give the agent memory" is not a design. It leaves open what is stored, who may write it, how it is recalled, how stale entries are removed, and what share of the window recalled memory may take. Each of those is a context decision, and each needs a test.
The Claude documentation read for this page describes one concrete mechanism, the memory tool: the model asks for file operations on a /memories directory, and the application runs them against storage it controls, then returns the result as a tool result. The documentation says the model checks its memory directory before starting a task when the tool is enabled, and that the API adds an instruction to do so to the system prompt. Recall, in that design, is the model choosing to read files with a tool, which makes it just-in-time retrieval (Dynamic context). The same page lists the safeguards that become the application's job: path traversal protection, size caps, expiry of old files, and stripping sensitive data before it is written.
For a coding agent. The repository's instruction file (CLAUDE.md,AGENTS.md) is durable memory written by people and recalled into every session. The documentation of one coding agent read for this site describes a second kind it writes itself ("auto memory"), loaded at the start of every session up to a size limit. The open edits of the current task are working context. A branch and a commit are checkpoint state. Coding agents shows how these fill the window.
What this is not. How durable memory is stored, indexed, expired and kept consistent, and how checkpoints are written and restored, is the subject of Memory Engineering. The runtime that saves and resumes a run is the agent harness: Harness Engineering, control state. This page covers only the boundary: what belongs where, and how each store reaches the window.
Three failures, one per boundary#
Each mix-up has a recognizable failure.
| Mix-up | What happens | Example |
|---|---|---|
| Working context kept as durable memory | A copy of a rule or a provider value outlives its truth | R-ROOF-01 saved in memory at 30 years still answers after 1 July 2026 |
| Durable memory kept only in working context | A fact is lost when the session ends or the window is compacted | The underwriter's override lives only in one chat; the next run never sees it |
| Checkpoint state pasted into every window | Tokens spent on bookkeeping the model does not need, and a stale step pointer the model may act on | "Step 38 completed" in every call, even after a retry re-ran step 37 |
The middle row is the one that compaction makes worse. When a long run is summarized to fit its window, anything that should have been written to memory or to the checkpoint and was not is now gone. That is why the loss test on Compaction probes for the open question and the corrected area: those are checkpoint facts that must survive.
For a Principal engineer: write paths, authority and stalenessThe hard questions are who may write memory and how it expires
Write authority. If the model may write durable memory freely, then anything that steered the model can become a lasting instruction to every later session: a broker's injected note, summarized into "this broker's submissions are pre-approved", recalled next month into the instructions part. Treat memory writes like any other write tool: typed, validated, scoped by tenant and role, and for anything that changes behavior, reviewed. Recalled memory enters the window as data with provenance (who wrote it, when, from which run), never as system instructions, unless a person promoted it.
Staleness. Durable memory has no natural expiry. Tie entries to the version of the world they describe (the policy version of an override, the date of a preference) and let the freshness stage of the assembler apply to recalled memory exactly as it does to policy chunks.
Checkpoint versus history. A checkpoint should be the minimum state needed to resume deterministically (step id, open questions, attempt number, ids of evidence already gathered), not the transcript. Resuming from a transcript re-sends everything; resuming from a checkpoint lets the assembler build a fresh, small window from evidence ids.
Identity. Keep run_id and attempt_number in the checkpoint and the manifest. A resumed run is the same run with a new attempt or a new step, and its windows must be traceable to the same trace_id.
A checklist for the boundary#
| Check | Why |
|---|---|
| Every fact the agent produces is classified: this call, later sessions, or resume | Unclassified facts end up in the wrong store |
| Rules and reference data are retrieved, not copied into memory | Copies go stale at the next version |
| Human decisions are stored as durable evidence with their reason and version | They are the most valuable input for later runs (UW-009) |
| Recalled memory enters the window as labelled data, with provenance | Memory must not become an unreviewed instruction |
| Memory writes are authorized and scoped like any write tool | Injected text must not persist |
| Checkpoints hold ids and open questions, not transcripts | A resumed run gets a small, fresh window |
| Recall has a budget share and appears in the manifest | You can see which memories shaped an answer |
In one breath#
Working context is what the model sees in this call; durable memory is what the system keeps because it stays true across sessions; checkpoint state is where a run stopped and what it waits for. All three reach the model only by being put into a window, so recall is an assembler decision with a budget, labels and a manifest entry. Store rules by reference, human decisions as evidence, and run positions as ids, and you avoid the stale copy, the lost override and the bookkeeping that crowds the window.
What comes next#
This page used the phrase "retrieved when a step needs it" several times. That is a design choice with an alternative: load everything at the start. The next page, Dynamic context, compares loading up front with fetching just in time, showing only the tools a step needs, and handing a subtask to a fresh window.