$ /context▊

Stop at 80 % context

A long multi-agent session ran into Claude Code's automatic compaction at 94 % of its context. The summary kept the gist and lost the details that mattered: which agents were running, the exact rulings, which commits already existed. The next session dispatched a finished task again. Three fixes.

Andrii Siuta · June 2026 · ~4 min read Claude Code context AI agents

01. What a summary loses

The dispatcher session of a framework upgrade was driving several parallel lanes when it hit its context limit. Compaction produced a readable summary. What it did not keep:

  • the IDs of the agents still running, so nobody could resume or stop them;
  • the exact wording of rulings, so the next session paraphrased them, slightly differently;
  • which tasks had already committed, so a task whose commit was on the branch was dispatched again.

A summary is written for understanding. A resume needs state.

02. Fix one: a progress ledger

Every run gets an append-only progress.md, written as work happens:

progress.md, the shapePlan: plans/wave-3.md   Spec: specs/wave-3.md   Branch: feature/x @ BASE 3d0c600

## Pre-flight
| Task pair | Produces            | Consumes             |
|-----------|---------------------|----------------------|
| 4 -> 7    | ListboxOption model | ListboxOption model  |

## Progress
Task 1: DONE (a1b2c3d; verify: jest 412/412, tsc 0 new)
Ruling: Tasks 2 and 3 run in parallel; costs a re-run on a shared-file race.
Task 2: DONE_WITH_CONCERNS (d4e5f6a; stress timing +8 %)
Task 3: BLOCKED (environment: node_modules from another branch)

## RESUME STATE
Running: none.  Next: Task 4.  Do not re-dispatch a task whose commit exists.

03. Fix two: a handover document

When a session has to stop mid-run, it writes a handover before it goes: the authority documents, the git state of every lane with its tip, the agents that were running, a numbered resume procedure, and the line "never re-dispatch a task whose commit already exists". The next session reads one file and the ledger, not a summary.

04. Fix three: the rule

Stop at 80 % of context and start a new session from the ledger. Never let compaction decide what to keep.

The ledger earned its keep a second time when a usage limit cut five running agents off mid-wave. Because every landed task, ruling and running agent was already written down, the stop was clean: the ledger's last line read "NOTHING IS RUNNING", and the next session knew exactly which two of twenty-five tasks were left.

The cost of the practice is a few lines per task. The cost of skipping it is a re-run you only notice in the git log.