Skip to main content
Claude Code and GitHub Copilot CLI both support subagent or fleet modes where a lead agent coordinates multiple parallel specialist agents working on different parts of a task. This changes how you need to think about your agent context — and why keeping 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.
In a single-agent workflow, 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 of AGENTS.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 dispatches parallel subagents that each start with a clean context window. Your AGENTS.md (or CLAUDE.md symlink) is the shared root.Set up the symlink during init so Claude Code picks up the file automatically:
./scripts/init-agent-context.sh
The init script creates CLAUDE.md as a symlink to AGENTS.md.

Agent compatibility at a glance

AgentConfig fileWhat it does
Claude CodeCLAUDE.mdSymlink → AGENTS.md
GitHub Copilot.github/copilot-instructions.mdDirective pointing to AGENTS.md
Cursor.cursorrulesDirective pointing to AGENTS.md
Windsurf.windsurfrulesDirective pointing to AGENTS.md
OpenClawskills/ directoryReads AGENTS.md natively
All config files are created or updated by ./scripts/init-agent-context.sh. You choose which agents to wire up during setup.