Writing / Tag / 11 of 67
Context Engineering
Every essay tagged Context Engineering, newest first.
Context engineering is the work of deciding what the model sees on each turn. It is the highest-leverage thing I know of for a long-running agent, and most teams do it by accident: tool results pile up, old file versions sit next to new ones, a subagent compresses its findings into a paragraph that drops the one fact that mattered. The agent is not confused. Its context is.
The essays under this tag treat the context window as a budget to spend rather than a bucket to fill. Compaction keeps the plan from turn three alive at turn forty. Offloading moves a 40,000-token tool result to a store and leaves a handle behind. Pruning removes observations that have gone stale, and a return contract makes the subagent boundary explicit instead of lossy.
Start with context compaction for long-running agents, which is the foundation the rest build on. Then stale tool observations and drift, which shows that this is a correctness problem and not just a token bill, and the subagent return contract for the multi-agent version of the same mistake.
October 2026
Your Token Budget Is Wrong the Day You Switch Models
You moved to a newer, cheaper model and the bill went up.Your Agent Retries Are Making the Failure Worse
When an agent step fails and you retry it in the same context, the failed attempt stays in the window and the model conditions its next try on its own mistake.
September 2026
Your Subagents Are Hiding the Evidence
Spawning a subagent to keep the parent's context clean is the right instinct, and it is also where a lot of long-running agents quietly go wrong.Your Multi-Agent System Already Has a Blackboard
Wire a few agents together with direct handoffs and it works.Your Agent Fails the Same Way Every Week and Learns Nothing
Your agent trips over the same edge case every Monday, you patch the prompt by hand, and next Monday it trips again.Your Model Advertises 1M Tokens. It Starts Forgetting Around 600K.
A million-token context window landed in half the models this week, and the reflex is to stop retrieving and just paste everything in.
August 2026
Your Tool Returned 40,000 Tokens. The Agent Needed 12.
A single tool call can dump a whole file, a full API response, or a thousand log lines straight into the context window.The Agent Is Not Confused. Its Context Is Stale.
In a long session an agent keeps every tool result it ever saw, including the three older versions of a file that has changed twice since.
July 2026
Your Agent Forgets You the Second You Close the Tab
LLMs are stateless, so every new session starts from zero.Your Agent Reads 150,000 Tokens Before It Sees the Request
Connect a dozen MCP servers to an agent and you pay for every tool definition on every turn, before the user has said a word.Context Compaction for Long-Running AI Agents
Long-running AI agents fail when context grows without bound, blowing up token costs, latency, and reliability.