Vibeleaderboard
← Course overviewModule 04 · Give the agent the right information · Beta
Lesson 4.4

Module contents

Give the agent the right information

Lesson 4 of 5

What survives between sessions?

An instruction file and a skill are loaded when work starts. Everything else the model learned during a piece of work, including corrections you typed and facts it found, was in that session's context. This lesson is about what happens to it when a new session begins, when the context grows too long, or when the work is handed to another session. It separates what the model currently sees from what the harness has stored, compares five ways of going on by what each keeps, and uses an authored handoff that loses a delivery constraint to show how to decide what must survive.

Numbered links identify sources. Underlined terms offer a definition without leaving the lesson.

A session is a record; the context is what the model sees now

A is one conversation or piece of work as the harness keeps it: a record of messages, tool calls and observations that the harness manages and, in most products, saves. That is not the same as one run of a program. A saved session can be resumed after the harness is closed and reopened, and one run of the harness can hold several. What the model sees at each step is different again: it is the request the harness assembles for that step, module 1's , built from the session's current state, the instruction files and whatever else the harness adds. The distinction matters because the two can come apart. A message can be in the stored session and not in the model's current request, which is what happens when a session is compacted.

A new session starts with whatever the harness supplies. That may include instructions, selected earlier messages, retrieved notes or a handoff. For example, Claude Code documents subagents that start from a delegation message and project instructions, and forks that inherit the parent conversation. 11 A fact from an earlier conversation is available only if it reaches the new context, directly or through retrieval. The earlier messages may remain saved without being included in the next model request.

This is why information placement matters. A convention in a file helps when that file is loaded; a procedure helps when it is selected; a deadline helps when the new request includes it or points to a brief the agent reads.

Five ways to go on, compared by what they keep

Thariq Shihipar’s April 2026 guide recommends choosing how to continue by considering which context the remaining work needs. It covers continuing, rewinding, compaction, starting fresh and delegation, with a preference for a fresh session when the task changes. That is practitioner guidance for Claude Code, not a universal threshold. 6 The site’s Intel summary connects the guide to related reports. Here is how to reason through those choices for the garden.

Continue when the current context still supports the task. Three retrieved quotes and an unfinished comparison may be worth keeping together. Check that old decisions still apply and that the needed quotes remain in the active context.

Rewind when you want to discard a later conversational branch. If the model spent twenty steps on a mistaken reading of Hedgerow’s quote, returning to the point after retrieval can remove that branch from the active conversation. Conversation rewind does not undo a file write or a sent message. A product may offer a separate file-restoration feature; inspect its scope before relying on it.

Compact when useful work can continue from a shorter account. replaces older active context with a summary, often retaining recent messages. Saved history may still exist. A summary can omit a deadline even while accurately preserving the prices, so compare it with the requirements for the next step.

Start fresh when the next task needs a different set of information. Laying out the completed fencing comparison may need the table and delivery requirements; planning the seed order needs another brief. Supply what that new task needs instead of assuming the previous conversation will appear.

Delegate a when one part can be described and checked separately. A quote-checking worker needs the brief and relevant quotes. Depending on the harness, it may receive selected instructions or copied history, and the parent may receive a summary or more detailed records. Check that design before assuming what either context contains. Module 9 develops how to divide and review this work.

An authored handoff that loses a constraint

Here is what loss looks like. On Monday the organizer runs the fencing comparison in a long session. Midway through, they type: "The committee wants installed prices with delivery listed separately, and the file has to be in Documents/Garden/Committee by Wednesday evening." The Parkside link times out twice, the model stops as the brief requires, and the organizer answers in the session that a comparison of the two retrieved quotes may be written now, with Parkside added when its quote arrives. The table is written. Later the context reaches its limit and is compacted. This is the authored summary that replaces the older conversation in the model's context, with the last few messages kept after it:

Summary of work so far. Task: compare fencing quotes for the north boundary. Read northfence and
hedgerow quotes; Parkside link timed out twice, quote not retrieved; organizer authorized a
two-quote table for now. Installed prices: Northfence £2,150, Hedgerow £2,280. Table saved at
Documents/Garden/fencing-comparison.txt. Next: add Parkside if the quote arrives.

Nothing in the summary is false. The prices are right, the authorization is recorded and the file is where it says. What is missing is the delivery constraint: the Committee folder, Wednesday evening, and delivery shown separately. From here on the model, working from this summary, has no reason to move the file, no date, and a table whose format the committee did not ask for. Why the summary left those facts out is not something the record shows; what the record shows is that they were said once, in conversation, and are now absent from the context. Monday's original message may still be in the stored session, where the organizer can find it. It is not in the model's request. A fluent summary gives no sign of what it dropped.

The idea of testing this comes from a homework exercise in LangChain's Deep Agents course, which was inspected for this module and not run. The exercise has the learner plant a concrete detail, such as a number or a decision, early in a long conversation, force the summarizer to run more than once so that each summary is a summary of the previous summary, then ask for the detail at the end and compare the stored history with what the model was shown. 10 The transferable practice is the test, not the framework: if a fact must survive, check whether it did, rather than trusting that a summary which reads well kept it.

Deciding what must survive

A is whatever carries work from one context to another: a compaction summary, a note you write before starting fresh, or the brief you give a bounded subtask. Deciding what must be in it takes two questions for each fact. Does the remaining work depend on it? And does it exist somewhere the next context will load or can fetch? A fact that passes the first question and fails the second has to be written into the handoff, or into a place that will be loaded, before the handoff happens.

Run the Monday facts through those questions. The prices passed both: the remaining work needs them, and they are in the saved table, which a tool can read. The Committee folder is a convention, so it belongs in the garden instruction file, and Claude Code's documentation says that for its product the project-level instruction file is re-read after compaction, while an instruction given only in conversation is not. 3 Had the folder rule been in the file, the model would have had it after the compaction. Wednesday evening and the separate delivery column are task facts; they belong in the brief, and a brief kept in a file the harness is told to read at the start is a brief that survives. What was lost on Monday was lost because it was said once, in conversation, and kept nowhere the next context would load.

The same two questions decide between the five options. If everything in the window still passes the first question, continue. If the last stretch fails it, rewind, remembering that any effects in that stretch remain. If most of the window fails it but a few facts pass and are kept nowhere else, write those down, then compact or start fresh. If a piece of the work can be described with module 3's five answers, delegate it with a brief and take back the result. None of these is the right choice in general; each is right when the facts the remaining work needs will still be present afterwards.

Carry this forward

  • A session is a record the harness keeps and can resume; the context is the request the model sees at one step. A new session starts from its initial instructions and whatever the harness seeds it with, and a fact said only in an earlier session's conversation is absent unless it was kept somewhere the new session loads or can fetch, even if the old messages are still stored.
  • Continuing, rewinding, compacting, starting fresh and delegating a bounded subtask differ in what the context keeps. Rewinding does not undo external effects; compaction replaces older context, not necessarily the saved record; a subagent's starting context and what it returns are the harness's design. One practitioner's guide compares them and gives no token threshold.
  • A compaction summary is a model's judgment of what mattered, and a fluent summary can drop a constraint that was said once. The record shows that a fact is absent, not why. If a fact must survive, test that it did.
  • For each fact ask whether the remaining work depends on it and whether it exists somewhere the next context will load. A fact that passes the first test and fails the second goes into the handoff or into a file that is reloaded, before the handoff happens.

Lesson check

In the authored Monday session, the organizer said in conversation that the finished table must be in the Committee folder by Wednesday evening, and the compaction summary left it out. Which statement follows from the lesson?

Choose an answer for each question.

This is a practice check. Answers reset when you leave this page. Results are not saved and do not place you in another module or award a qualification.

You can now say where each kind of information should be kept so that it is present when needed and survives a handoff. One kind remains: the instruction that was right when it was written and may not be now. The last lesson is about auditing those.

Sources · Reviewed 2026-09-29
  1. 3. Claude Code documentation: How Claude remembers your project
  2. 6. Thariq Shihipar (claude.com): Using Claude Code: session management and 1M context
  3. 7. VibeLeaderboard Intel: Using Claude Code: Session Management & 1M Context
  4. 8. Anthropic: Effective context engineering for AI agents (September 2025)
  5. 10. LangChain Academy, Deep Agents course: module 3.1 homework on chained summarization
  6. 11. Claude Code: Subagent context and forks

Sources support nearby explanations. Product details can change. Scenarios and model results are authored illustrations unless a lesson explicitly identifies a recorded execution. Module 7 identifies its offline code checks.