Docs › Agent
Running several agents at once
Give each agent its own git worktree so they can attempt the same task without colliding.
You can run more than one agent on the same prompt and compare what they produce. Each gets its own git worktree: its own directory on its own branch, sharing one object store.
Why worktrees rather than branches
Running several agents only helps if they cannot see each other's work. Sharing one checkout and switching branches would serialise them: two agents editing the same file in the same directory produce one corrupted result, not two candidates. The interesting comparison is between finished attempts.
Where they live
Under .astracode/worktrees/ in your repository, which is where you would look for them. That would normally mean a permanently dirty git status, so the path is added to .git/info/exclude rather than .gitignore, because info/exclude is local to your clone, so AstraCode is not editing a tracked file that belongs to the project and would turn up in your next diff.
An editor should not commit to your repository to make its own feature tidy.
What you keep
Whatever you keep at the end is an ordinary git branch. Merge it, cherry-pick from it, or delete it. Nothing about it is special once the agents have finished.
All documentation
Get started
Agent
- Agent overview
- Approvals and permissions
- Plan mode
- What the agent can do
- Running commands
- Browser tools
- Checkpoints and undo
- Infrastructure as code
- Running several agents at once