How to Run Multiple Agents at Once with Fleet in GitHub Copilot CLI
Learn how to use the new /fleet command in GitHub Copilot CLI to run multiple agents in parallel, speeding up complex tasks and boosting productivity. Step-by-step guide and best practices included.
How to Run Multiple Agents at Once with Fleet in GitHub Copilot CLI
GitHub Copilot CLI just got a major upgrade: you can now run multiple agents in parallel using the new /fleet command. This feature lets you break down complex tasks and have Copilot orchestrate a team of sub-agents, each working on different parts of your codebase at the same time. Here’s how it works and how to get the most out of it.
What is /fleet?
/fleet is a slash command in Copilot CLI that enables parallel execution. Instead of working through tasks one by one, Copilot’s orchestrator splits your objective into independent work items, dispatches multiple agents to handle them simultaneously, and coordinates their progress. Each sub-agent gets its own context window but shares the same filesystem, with the orchestrator managing dependencies and final synthesis.
How Does It Work?
When you run /fleet with a prompt, Copilot:
- Decomposes your task into discrete work items with dependencies.
- Identifies which items can run in parallel and which must wait.
- Dispatches independent items as background sub-agents.
- Polls for completion and dispatches the next wave.
- Verifies outputs and assembles the final deliverable.
Think of it as a project lead assigning work to a team, checking progress, and assembling the results.
Getting Started
To use fleet mode, simply run:
/fleet <YOUR OBJECTIVE PROMPT>
For example:
/fleet Refactor the auth module, update tests, and fix the related docs in docs/auth/
You can also run it non-interactively:
copilot -p "/fleet <YOUR TASK>" --no-ask-user
The --no-ask-user flag is required for non-interactive mode.
Writing Effective Prompts
The key to parallelizing work is writing clear, structured prompts. Be specific about deliverables and boundaries. For example:
/fleet Create docs for the API module:
- docs/authentication.md covering token flow and examples
- docs/endpoints.md with request/response schemas
- docs/errors.md with error codes and troubleshooting steps
- docs/index.md linking to all three pages (depends on the others finishing first)
This lets the orchestrator run independent tracks in parallel and serialize dependent ones.
Set Explicit Boundaries
- Assign clear file or module ownership.
- State constraints (e.g., no test changes).
- Define validation criteria (e.g., lint, type checks, tests).
Declare Dependencies
If one task depends on another, say so. The orchestrator will handle the order.
Advanced: Custom Agents
You can define specialized agents in .github/agents/ and reference them in your /fleet prompt. Each agent can have its own model, tools, and instructions. For example, use a technical writer agent for docs and a code agent for code changes.
Tips and Pitfalls
- Partition your files: Sub-agents share a filesystem. Assign distinct files to avoid silent overwrites.
- Keep prompts self-contained: Sub-agents don’t see the orchestrator’s history. Include all needed context in the prompt.
- Guide in progress: You can send follow-ups to the orchestrator to reprioritize or check status.
When to Use /fleet
Fleet shines for tasks with natural parallelism—refactoring multiple files, generating docs for several components, or implementing features across API, UI, and tests. For strictly linear work, regular Copilot CLI prompts are simpler.
Conclusion
Fleet mode in Copilot CLI is like having a team of AI developers at your command. Start with clear, parallelizable tasks, and let the orchestrator handle the rest. As you get comfortable, try larger and more complex objectives. The fastest way to learn is to experiment and refine your prompts based on results.
Inspired by the official GitHub blog: Run multiple agents at once with /fleet in Copilot CLI
Share this post