Run multiple agents at once with /fleet in Copilot CLI (opens in new tab)
GitHub Copilot CLI’s /fleet command lets multiple subagents work on independent tasks simultaneously rather than completing everything sequentially. An orchestrator decomposes the objective, manages dependencies, dispatches agents, and verifies their results. To benefit from parallel execution, users should define clear deliverables, boundaries, dependencies, and validation requirements.
How /fleet Works
- Breaks a task into discrete work items and identifies dependencies.
- Runs independent items in parallel as background subagents.
- Waits for completed work before dispatching dependent tasks.
- Verifies results and assembles the final output.
- Gives each subagent its own context window while sharing the same filesystem.
- Prevents direct communication between subagents; the orchestrator coordinates them.
Getting Started
- Run
/fleet <objective prompt>interactively, such as:/fleet Refactor the auth module, update tests, and fix the related docs in docs/auth/ - For terminal-based non-interactive use:
copilot -p "/fleet <YOUR TASK>" --no-ask-user - The
--no-ask-useroption is required when no one is available to answer prompts.
Writing Parallelizable Prompts
- Define concrete deliverables such as individual files, test suites, or documentation sections.
- Avoid vague requests that make it difficult to identify independent work.
- Explicitly state:
- File or module ownership
- Constraints, such as avoiding dependency changes
- Required tests, linting, or type checks
- List dependencies so the orchestrator can serialize only the necessary work while parallelizing the rest.
Using Custom Agents
- Specialized agents can be defined in
.github/agents/. - Agent definitions may specify:
- Model
- Tools
- Role-specific instructions
- Prompts can assign different agents to different tracks, such as using a technical writer for documentation and the default agent for code.
- If no model is specified, the agent uses the current default model.
Monitoring Fleet Execution
- Review the initial decomposition to ensure the task has multiple independent tracks.
- Use
/tasksto inspect active background work. - Look for progress updates from separate tracks.
- If work is proceeding sequentially, ask Copilot to decompose the task first and report each track’s status and blockers.
Avoiding File Conflicts
- Subagents share a filesystem without file locking.
- If two agents edit the same file, the last completed write silently overwrites the other.
- Assign distinct files or directories to each track.
- For shared files, use temporary outputs and merge them afterward, or impose an explicit execution order.
Use /fleet for well-partitioned work with clear ownership and dependencies. Careful prompt structure is essential: parallelism is most effective when agents can operate independently without competing for the same files.