Vol. II · Production Doctrine · II.3
Own Your Context Window
The context window is not 'chat history'. It is a carefully laid-out working set. Whoever builds that layout owns the agent's intelligence.
8 min read
Doctrine
- Build the window explicitly: system, skills index, retrieved files, compact summary, recent events, current tool schema.
- Do not ship raw transcripts to the next call. Summarize, pin, and drop.
- Progressive disclosure (skills) is context ownership as a file-system convention.
Factor 3
Horthy: own your context window. Aider's repo map, Letta's core/archival split, Anthropic skills, DeerFlow's memory, Deep Agents' filesystem — all are context builders with different eviction policies.
The job of context engineering is to decide, every turn, what the model is allowed to see. That decision is more leveraged than model choice.
A working layout
Pinned: goal, constraints, tool schemas (or a skill index). Working: last N events, the current file or ticket. Recalled: search hits, memory extracts. Compacted: a running summary of dropped turns. Never: entire HTML pages, entire CI logs, entire JSON blobs — those go to a file the agent can grep.
Anti-patterns
- Appending every tool result forever until the model starts forgetting the goal.
- Stuffing six PDFs into the system prompt 'just in case'.
- Sharing one mega-context across a multi-agent crew.