Skip to main content

Context Engineering: 4 Ways to Beat Context Overflow

An in-depth look at 4 context management mechanisms in LangChain, Claude Code, Manus, and AWS to solve overflow and goal loss.

AI-written
Inewgen
13 Sep 2026Source: MarkTechPost4 min read (0 views)
Share
Context Engineering: 4 Ways to Beat Context Overflow

Stock photo for illustration only, not from the actual event

Font size
  • A typical agent task requires around 50 tool calls with an input-to-output token ratio near 100:1.
  • Deep Agents offloads tool responses exceeding 20,000 tokens directly to the filesystem.
  • Claude Code caps auto memory at the first 200 lines or 25KB while deferring MCP tool schemas.
  • AWS AgentCore coordinates 3 parallel browser subagents running in separate MicroVMs.

This article explores the inner workings of advanced artificial intelligence agent systems, covering compaction, memory strategies, context budgeting, and todo-state management. Tools like LangChain Deep Agents, Claude Code, Manus, OpenAI Codex, and Amazon Bedrock AgentCore serve as key case studies in handling long-horizon workloads.

For an agent loop, context overflow poses a severe challenge. Manus reports that a typical task requires approximately 50 tool calls, with an input-to-output token ratio running near 100:1. Every observation lands in context and stays there, pushing the original instruction right into the middle of the window where recall degrades. Goal loss is consequently an expected outcome of unmanaged context during prolonged tasks.

The harness first determines what never enters the window at all. Deep Agents implements two strict offloading rules with hard numbers. When a tool response exceeds 20,000 tokens, it gets written to the filesystem and replaced by a file path and a 10-line preview. When session context crosses 85% of the model window, older write and edit tool calls are truncated to pointers.

software developer computer screen code workspace

Stock photo for illustration only, not from the actual event

Claude Code applies similar budgeting principles to data loaded before the first prompt. Auto memory remains capped at the first 200 lines or 25KB. Anthropic's subagent architecture demonstrates the effectiveness of this approach, where each subagent consumes tens of thousands of tokens exploring but returns a distilled summary of just 1,000 to 2,000 tokens. Meanwhile, AWS AgentCore coordinates three browser subagents running in parallel across separate MicroVMs.

Never miss the latest news?

Subscribe to get news summaries by email - not often enough to be annoying.

โฆษณา

50Tool calls per task
100:1Token input-to-output ratio
85%Deep Agents session context threshold

When offloading proves insufficient, the harness resorts to compaction. This practice summarizes conversations nearing window limits and reinitiates a fresh context. Compaction carries the risk of losing vital constraints through lossy summaries, prompting different platforms to implement specialized safeguards such as preserving architectural decisions and unresolved bugs in Claude Code.

Context engineering in modern agents highlights that the context window is not a permanent storage vault but a high-cost resource. System design must transcend raw LLM capability by building robust external infrastructure—such as filesystems, subagents, and separate state logs—allowing agents to run for hours without losing directional focus.

OpenAI has also integrated compaction into its API layer. The Responses API offers server-side compaction via context_management parameters alongside a standalone endpoint that returns an encrypted compaction item. Regarding todo-state handling, evaluations yielded mixed results; Deep Agents utilized write_todos by default until July 2026 before shifting it to opt-in based on evaluations showing lower costs with it disabled for specific tasks.

Ultimately, the underlying pattern across all these mechanisms is treating goals as mutable artifacts rather than static messages in history. While messages age and get summarized, files rewritten every few turns remain recent, concise, and resilient across resets.

Source: MarkTechPost

Comments

Leave a Comment
0/2000

Found something wrong in this article? Report an issue with this article