Imagine asking an agent to add note search. Yesterday you explained an important condition: search titles only. Today you continue, but the agent proposes searching note contents too. It seems to have “forgotten” your agreement. What might actually have changed: the stored history, its summary or the data the model received this time?

Stored, read and passed to the model are different things. To understand the distinction, we will follow one long task: start adding a feature, work on it, pause and return the next day. This is a teaching story, not a test log for a particular agent.

The previous comparison examined different products. Here we will follow a shared mechanism through one task.

A nearby repository is not yet the model’s context

Our task concerns an application containing notes. Search must be case-insensitive and check titles only. Note contents must not be included. The agent needs that requirement, the note-list code and the place where search will run. Other project material might become relevant later, but its existence alone explains nothing to the model.

Context is the information a model receives for its current decision: instructions, messages, selected file excerpts and results of earlier actions. The agent’s software wrapper, or harness, organizes access to materials and passes them along. The model can request a file; a tool returns its contents or a relevant part. That information then supports the next step.

It helps to distinguish “the file exists in the project,” “the agent found it” and “the relevant excerpt is available to the model now.” Even a previously read file can be represented in a later step by a shortened version or a reference that must be followed again. The selection depends on the agent’s implementation.

This is one purpose of context engineering: selecting useful data as work progresses, rather than merely composing a good first prompt. For our search feature, the title-only requirement and current code matter more than loading every available document indiscriminately.

History grows, but the working window has limits

New data arrives during work: the agent reads a component, proposes a change, receives feedback and sees a check’s result. These materials can be stored in the conversation history. However, the current model request has a capacity limit: the context window.

Capacity is measured in tokens, the units into which a system breaks text and other data. A token is not a word: one word can contain several tokens. You do not need the exact arithmetic to understand our task. What matters is that space is needed for more than your latest message: instructions, code excerpts, previous results and the model’s response also count. OpenAI explains these limits in its context-window guide.

Think of current context as a selection of documents on a desk, and stored history as an archive. This is only a metaphor for capacity and selection, not a model of human memory. The archive can be much larger than what is on the desk right now.

A larger window creates more room. By itself, it does not establish whether the right file was found, an old note is correct or instructions contradict each other. When an agent ignores a requirement, context overflow is only one possible cause; without observations of the particular run, it is not yet a diagnosis.

A summary preserves a selection, not the entire conversation

One way to continue long work is history compression, or compaction. A more compact account replaces a large part of the earlier conversation for subsequent steps. It can retain the goal, important decisions, current state and references while removing repetition and lengthy intermediate results. Compacted state is not always readable text; our example uses a human-readable summary.

A good summary in our story would retain: “Add case-insensitive search over titles only; exclude note contents.” If only “add note search” remains, the task name survived but its important constraint did not. A later proposal to search all text becomes more understandable, although no more correct.

In its discussion of compaction, Anthropic explicitly warns about losing important details through overly aggressive compression. Current Claude Code documentation also describes automatic summaries and the possible loss of detailed early instructions. These are documented mechanisms in specific systems; another agent can manage history differently.

We deliberately removed the exception in this teaching example to expose the consequence. In actual work, it might have remained in context and the model might still have applied it incorrectly. Checking a summary helps separate those situations, but does not automatically explain every failure.

What remains after a pause

Suppose we stopped working in the evening. Some code has changed, the conversation contains the agreed requirement, and a working note records the next step. These are different materials with different storage arrangements.

MaterialWhat can remain storedWhat continuation requires
Project filesCode after the changesFind and read the relevant current parts.
Conversation historyMessages, calls and resultsAdd the necessary history or its representation to context.
Work summarySelected goal, decisions and stateRead it and check that no important condition was lost.
Memory noteA particular fact, preference or lessonLoad the relevant note and check whether it is current.
Task stateWhat is done and what remainsCompare the record with files and available evidence.
On a narrow screen, scroll the table sideways. With a keyboard: use Tab to focus it, then the left/right arrow keys.

A saved conversation does not mean its entire history is passed to the model every time. In Anthropic’s Managed Agents, the event log is explicitly separate from the context window: the harness can select parts from it. This illustrates the distinction between an archive and current input; it is not a required architecture for every agent.

A new session and continuing an old one are different actions

The next day, you might continue the saved conversation or start a new one. The product determines what gets restored. For example, Claude Code documents conversation storage and session continuation; a new session starts without the previous session’s history. Separate instructions and memory notes can carry useful information between sessions.

Here, agent memory means records stored outside the current window that the application can reuse. This is a working definition: products use “memory” for somewhat different mechanisms. Claude Code documents user instructions and automatic agent notes separately. Not every wrapper has the same automatic storage or loading behavior.

In either case, the useful question is not “does the agent remember everything?” but “which information will it receive for the next decision?” If a new conversation contains only a general goal and the project path, the title-only condition still needs restoring from a reliable source.

When an application saves a note and passes it to the model, it changes the available data. That alone is not retraining the weights — the model’s learned internal parameters. A model can use a new fact supplied in the current message without a separate model-training process.

A saved note can be wrong too

Return to search. A note might say “the filter is ready.” But it does not say which code version was checked, whether case was handled or whether the title-only restriction survived. That is not yet an adequate description of the state.

It is more useful to record the goal, agreed decision, implemented change, unchecked work and a reference to the relevant file separately. “Maybe we need full-text search” remains an assumption until the user changes the requirement. Copying that sentence into memory does not make it an agreed decision.

Likewise, an old note might reference a function that has since been renamed. Before using it, compare it with the current project. A stored check result also does not confirm a later, modified code version. Memory helps locate useful evidence, but does not replace verification.

How to lose less context during long work

Start with a short, checkable goal. For our task, replace “make search good” with “find notes by title, case-insensitively; exclude their contents.” Such a condition is easier to recognize in a summary and compare with the result.

Before pausing, save or request a short account of what was agreed, what changed, what remains, where the relevant files are and which questions are open. Review it: an agent can also confuse a fact with an assumption. A file reference is useful because it lets you return to the source rather than trust a retelling forever.

On returning, first compare the summary with the current state of work. For lasting rules, use the product’s supported instruction or memory mechanism, checking when it actually loads. Creating a rule file alone does not establish that. We will discuss those mechanisms’ formats and configuration separately.

The main idea is simple: information must not only be stored; the right, current part must return to the next decision. Current context is a working selection, history is an archive, and memory notes are possible aids for continuation. Distinguishing them makes an agent’s behavior easier to understand and lets you ask precisely what it is missing now.