The Context Window Is a Budget, Spend It Like an Engineer

Pull-quote: “Long-horizon agents rarely die from lack of intelligence. They die from carrying their whole history into every decision, like a committee that rereads all previous minutes before each vote.”
Attention is the scarce resource
Bigger context windows keep arriving, and long-horizon agents keep degrading anyway, because the constraint was never raw capacity. A window is the agent’s attention, and attention dilutes. Every stale tool dump still riding along competes with the live decision for the model’s focus. Somewhere past the midpoint of a long run, an undisciplined agent starts contradicting its own earlier conclusions, reaching for the wrong tool, and re-deriving what it already knew. The fix is not a larger warehouse. The fix is treating the window as a budget with line items, spent deliberately on every turn.
Line items, not a landfill
| Line item | Contents | Discipline |
|---|---|---|
| Charter | Goal, constraints, definition of done | Pinned, never compacted away |
| Live state | Current plan, open questions, recent turns | Rewritten as it changes, kept small |
| Evidence in play | The records this decision needs | Retrieved for the step, released after |
| History | Everything older | Summarized to decisions and outcomes, full detail externalized |
Two habits do most of the damage. Tool outputs enter raw and stay forever: the thousand-row query result rides along for forty turns because nobody distilled it to the twelve rows that mattered. And history is treated as sacred: the full transcript replayed as if the agent were a court reporter, when what the next decision needs is what was decided, what was ruled out, and why.
Compact at boundaries, externalize the rest
turn 1 ──── turn 18 ──── phase boundary ──── turn 19 ...
──────────────────── │
full working detail │ compact:
│ decisions, outcomes,
│ open questions survive
▼
┌──────────────────────────────────────────────┐
│ window after: charter + summary + live work │
└──────────────────────────────────────────────┘
│ full detail written out
▼
EXTERNAL STATE: case file, plan, evidence log
(retrieved back by reference, only when needed)
Three mechanics carry the discipline. Compact at phase boundaries, not at percent-full panic: when investigation ends and drafting begins, that seam is where history collapses into findings, cleanly. Summarize toward the goal, not toward shortness: a good compaction preserves decisions, rulings-out, and open questions, and discards the scenery. Externalize state so the window holds a pointer, not the payload: the plan, the evidence log, and the intermediate artifacts live outside, retrieved by reference when a step actually needs them. Long-running investigation agents work this way in production: the case file is the durable spine of a multi-day investigation, and the window carries only the charter and the current step. The run survives restarts because the window was never the system of record.
The same budget funds retrieval. A RAG step that pours twenty documents into the window to use three is not thoroughness, it is a spend with no return. Retrieval count is a budget line like everything else, and the discipline compounds: a window that carries less noise needs less summarization later, and a summary built from a disciplined window loses less on the way through.
Budgets are testable
The quiet advantage of the budget frame is that it turns context discipline into engineering. You can assert that the charter survives every compaction. You can replay a fifty-turn run and measure whether decision quality drifts as history grows. You can diff an agent’s summary of phase one against the externalized record and catch the compaction that quietly dropped a constraint. None of that is possible while context management is a vibe.
Closing
Long-horizon agents do not need bigger windows nearly as much as they need spending discipline: a pinned charter, live state kept small, evidence retrieved for the step and released, history compacted at boundaries into decisions, and everything durable externalized. Attention is the scarce resource. Budget it like one.
