Anyone with a Notion account can comment on this page.
Sign up or login to comment
Context Engineering for Agents

Context Engineering for Agents

Agent

Tool calling in a loop

Challenge

A few primitives
Deep Agents Package
Deep Agents CLI
Model
Claude
Any provider
OpenAI, Anthropic
Prompt
Here (Filesystem), Here (Task tool)
Tools
8 native tools
11 native tools
Hooks

Context Engineering Principles

Offload — Move context from the LLM context window to the filesystem.
Reduce — Reduce the size of context pass to the LLM.
Isolate — Isolate context windows for tasks.

Offload Context

Offload context to filesystem

Let agent write to filesystem
This lets it save / recall information during long-running agent rollouts
This lets it save persistent memories across agent invocations
Manus
Deep Agents Package
Deep Agents CLI
Storage
Local filesystem or sandbox
Agent state (in memory) or filesystem
Local filesystem
User Memory
CLAUDE.md
N / A
memories
dir,
agent.md

Offload actions from tools to scripts stored on filesystem

Many tools are confusing to agents
Many tools require instructions that bloat system prompt
SOTA agents increasingly use small number of atomic, general tools
Agent use “progressive disclosure” to discover actions
Manus
Deep Agents Package
Deep Agents CLI
Minimize Tools
8 native tools
11 native tools
Progressive disclosure
Yes (skills)
Yes (scripts dir)
N / A
WIP
This metadata is the first level of progressive disclosure: it provides just enough information for Claude to know when each skill should be used without loading all of it into context. The actual body of this file is the second level of detail. If Claude thinks the skill is relevant to the current task, it will load the skill by reading its full 
SKILL.md
 into context.
Tools in deep agents package
Tool Name
Location
Description
write_todos
Creates and manages todo lists for tracking complex tasks
ls
filesystem.py:256-264
Lists files in a directory (requires absolute path)
read_file
filesystem.py:267-293
Reads files with pagination support (offset/limit)
write_file
filesystem.py:296-337
Creates new files with content
edit_file
filesystem.py:340-383
Performs exact string replacements in files
glob
filesystem.py:386-407
Finds files matching glob patterns (e.g., **/*.py)
grep
filesystem.py:410-440
Searches for text patterns in files
task
Launches ephemeral subagents for complex isolated tasks
Tools in deep agents CLI
Tool Name
Location
Description
write_todos
Via create_deep_agent
Todo list management
All filesystem tools
Via create_deep_agent
ls, read_file, write_file, edit_file, glob, grep
task
Via create_deep_agent
Subagent launcher
shell
agent.py:143-145
Execute shell commands with HITL support
http_request
tools.py:17-89
Make HTTP requests (GET, POST, PUT, DELETE)
web_search
tools.py:92-140
Web search using Tavily API (requires API key)

Reduce Context

Manus
Deep Agents Package
Deep Agents CLI
Compaction
Yes
No
No
Summarization
Yes (95% of context window)
Yes
SummarizationMiddleware (170k tok w/ 6 most recent messages retained)
SummarizationMiddleware
Filtering
No
No
FilesystemMiddleware (filters large tool results > 80k tokens)
FilesystemMiddleware

Isolate Context

Manus
Deep Agents Package
Deep Agents CLI
Sub-agents
Task tool, custom sub-agents
Task
Task
Task (shared filesystem)

Summary

Principle
Manus
Deep Agents CLI
Offload context
Use filesystem
Yes
Yes (E2B)
Yes
Enable user memories
Yes (
CLAUDE.md
)
Yes
Yes (
memories
dir,
agent.md
)
Minimize tools
Yes (~12)
Yes (<20)
Yes (11)
Give agent computer (bash tool)
Yes
Yes
Yes
Progressive disclosure of actions
Yes (skills)
Yes
WIP
Reduce context
Compaction
Yes
Yes
No
Summarization
Yes
Yes
Yes
Isolate context
Sub-agents
Yes
Yes
Yes