← Bookmarks 📄 Article

Context Engineering in Manus

A technical deep-dive into how Manus, a production AI agent handling 50+ tool calls per task, manages context windows through three strategies: reducing stale content, offloading to filesystem, and isolating context with sub-agents.

· ai ml
Read Original
Summary used for search

• Context engineering—carefully managing what fills an LLM's context window—is critical for agents but rarely discussed in detail; this breaks down real production patterns
• Manus uses "compaction" (swapping full tool results for file path references) and schema-based summarization to prune stale tokens while keeping recent results accessible
• Multi-agent design is for context isolation, not role-based division of labor—sub-agents get their own context windows for discrete tasks
• Progressive disclosure via filesystem: use <20 atomic tools (Bash, file access) that can execute utilities in a sandbox, rather than binding hundreds of overlapping tools
• Test your agent harness across varying model strengths—if performance doesn't improve with better models, your architecture is bottlenecking progress (the "Bitter Lesson" trap)

As agent tasks grow complex (Manus averages 50 tool calls per session), context windows fill with tool results and performance degrades—what Anthropic calls "attention budget depletion." The solution is context engineering: deliberately managing what information enters the LLM's context at each step. Manus uses three strategies that align with patterns emerging across production agents.

First, reduce context through compaction and summarization. Tool results have "full" (raw content) and "compact" (file path reference) versions. As context fills, Manus swaps older results for compact versions while keeping recent results full to guide the next decision. When compaction hits diminishing returns, they apply schema-based summarization to the full trajectory. Second, offload context to the filesystem. Rather than binding hundreds of tools (which wastes tokens and causes model confusion), Manus uses <20 atomic functions—primarily Bash and filesystem access—that can execute utilities in a sandbox. MCP tools are exposed via CLI, not as bound functions. This mirrors Claude Code's "skills" approach: progressive disclosure through filesystem + simple tools. Third, isolate context with sub-agents. Unlike anthropomorphized role divisions (designer, engineer, PM), Manus uses sub-agents purely for context isolation. Simple tasks get instructions via function call; complex tasks share the planner's full context. They found that a dedicated planner agent was more efficient than a todo.md file, which consumed one-third of all actions.

The "Bitter Lesson" framing is crucial: structure added to improve current performance can bottleneck future gains as models improve. Manus has refactored five times since March. Peak Ji recommends running evals across varying model strengths—if performance doesn't scale with better models, your harness is limiting the agent. Simple, unopinionated designs (like filesystem + Bash instead of rigid tool hierarchies) adapt better to model improvements.

Listen to Summary
0:000:00