AGENTS.md tight matters more than ever.
The subagent problem
When subagents are spawned, they do not inherit the main conversation’s history. Each one starts fresh, with only your root instruction file as shared context.Without
AGENTS.md, each subagent rediscovers your project from scratch — independently, in parallel, with no coordination. Conflicting decisions about naming, patterns, and boundaries are the predictable result.AGENTS.md is helpful project context. In a subagent fleet, it becomes the only thing preventing five agents from independently making conflicting decisions about your codebase. Boundaries, patterns, and gotchas that live only in the main conversation history are invisible to every subagent.
What the template does for subagents
The Agent Context System template is explicitly designed for subagent environments:- Instructs subagents to read
.agents.local.md— subagents don’t inherit it from the main agent, so the instruction has to be in the root file where every agent reads it - Compressed project knowledge — patterns, boundaries, and gotchas in pipe-delimited format give every spawned agent a shared understanding of the codebase
- Boundaries section — explicit rules (for example,
never modify src/generated/) prevent subagents from making incompatible decisions when working in parallel
Why instruction budget discipline matters more with subagents
Every line ofAGENTS.md is loaded into every subagent’s context window. If your file is 500 lines, you pay that token cost for each agent you spawn.
Keeping AGENTS.md under 120 lines is not an arbitrary constraint — it is a feature. Dense, pipe-delimited formats pack more signal into fewer tokens. Subagents get the project knowledge they need without the overhead that comes from verbose prose.
Supported environments
- Claude Code subagents
- GitHub Copilot CLI /fleet (experimental)
Claude Code dispatches parallel subagents that each start with a clean context window. Your The init script creates
AGENTS.md (or CLAUDE.md symlink) is the shared root.Set up the symlink during init so Claude Code picks up the file automatically:CLAUDE.md as a symlink to AGENTS.md.Agent compatibility at a glance
| Agent | Config file | What it does |
|---|---|---|
| Claude Code | CLAUDE.md | Symlink → AGENTS.md |
| GitHub Copilot | .github/copilot-instructions.md | Directive pointing to AGENTS.md |
| Cursor | .cursorrules | Directive pointing to AGENTS.md |
| Windsurf | .windsurfrules | Directive pointing to AGENTS.md |
| OpenClaw | skills/ directory | Reads AGENTS.md natively |
./scripts/init-agent-context.sh. You choose which agents to wire up during setup.