> ## Documentation Index
> Fetch the complete documentation index at: https://mainbranch.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Share project context across parallel AI agent fleets

> Parallel subagents each start with a clean context window. AGENTS.md becomes the shared brain preventing conflicting decisions when running agent fleets.

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.

<Note>
  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.
</Note>

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

<Tabs>
  <Tab title="Claude Code subagents">
    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:

    ```bash theme={null}
    ./scripts/init-agent-context.sh
    ```

    The init script creates `CLAUDE.md` as a symlink to `AGENTS.md`.
  </Tab>

  <Tab title="GitHub Copilot CLI /fleet (experimental)">
    Copilot CLI's `/fleet` command dispatches parallel agents with dependency-aware task assignment. Each agent reads `.github/copilot-instructions.md` as its root context.

    The init script adds an agent context directive to `.github/copilot-instructions.md` automatically:

    ```bash theme={null}
    ./scripts/init-agent-context.sh
    ```
  </Tab>
</Tabs>

## 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        |

All config files are created or updated by `./scripts/init-agent-context.sh`. You choose which agents to wire up during setup.
