/ context
03 Context Engineering
Day 3. The context window is the scarcest resource in the system. We build the machinery that decides what the model sees every turn, compacts long sessions, and remembers across them.
→
The context window as a resourceCONTEXT
Attention is finite and every token costs money and focus. Context engineering is the art of deciding what enters the window each turn. The harness is the allocator.
→
Context budgets: what goes in, what gets evicted
Accounting for tokens: system prompt, memory, recent turns, tool results. How to budget the window and what to drop first when it fills.
→
Compaction & summarization
Surviving a 200-turn session without losing the plot: summarize old turns into a running summary, and hydrate it back so the agent never forgets what it's doing.
→
Memory systems & the CLAUDE.md pattern
Session state, persistent memory files, and the CLAUDE.md pattern: durable facts the harness loads every session so the agent starts already knowing the project.
→
System prompts as infrastructure, not prose
The system prompt is not a personality blurb, it is the operating manual the harness assembles every turn: tools, rules, state, and mode. Treat it like code.
→
Build: the context engineBUILD
Compaction plus a persistent memory layer wired into the loop, so your harness survives a long session and remembers across runs.
