Chapter 4: What the Model Sees
Everything the model knows in a single turn fits in one bucket: system prompt, tool schemas, conversation history, tool results. Watch it fill up. When it overflows, things break.
System prompt at the bottom (always present). Tool schemas next (the model's instruction manual). Conversation history in the middle. Tool results stacking up. Working memory on top. Each layer competes for the same limited space.
Most APIs silently truncate from the beginning. Your system prompt, the agent's personality, rules, and safety instructions, gets pushed out first. The agent forgets who it is.
Context overflow is the #1 silent failure mode in production agents.
Summarize older conversation turns into a paragraph. Keep recent turns verbatim. Click the button to see the difference: same information, fewer tokens.
Claude Code does this automatically when context exceeds 80% capacity.
Instead of cramming everything into one bucket, spawn child agents with fresh context windows. Each sub-agent handles one focused task, returns a summary, and the parent stitches results together. Three small buckets beat one overflowing bucket.
Manus's breakthrough: keep a todo.md file on disk. Inject it into context each turn. The agent reads its own checklist, updates progress, and never loses track, even across context resets.
The file system becomes the agent's extended memory.