Running two coding agents in one repository
Run a second Claude Code or Codex session on the same checkout and the two overwrite each other. Git worktrees let any Mirasim session start in its own.


What actually goes wrong when two agents share a working tree
Running one coding agent in a repository is a solved problem, but running two at once is not. Both agents operate on the same working tree without knowing the other exists, overwriting and mixing each other's changes. Nothing crashes, which makes the failure quieter and worse: you end up with a diff that neither agent intended and no one can explain.
- Agent A is editing files
Both agents operate in the same shared working tree
- Agent B checks out a branch
Agent B may also stage a file that Agent A just rewrote
- Tests run on half-written changes
Git raises no error while the two changes mix
- You get a diff neither agent intended
- Clone the repo for each agent
- Duplicates history and isolates branches
- Run the agents one after another
- Gives up the point of using two agents
- Tell each: “Only these files”
- No enforcement; agents can still cross
The three usual workarounds for running two agents in one repository—separate clones, taking turns, or verbal file rules—are all worse than they look.
Linked worktrees: give one repository several independent checkouts
Git has had the answer since version 2.5. Running git worktree add creates another working directory backed by the same object database and refs—a second checkout, not a second repository. Each worktree sits on its own branch with its own index and HEAD, so two agents working in separate worktrees cannot see each other's uncommitted changes, stage each other's files, or switch each other's branch.
- ../feature-a
- Worktree checked out on branch feature-a
- Has its own staging index and HEAD
- Agent A edits files here in isolation
- ../feature-b
- Worktree checked out on branch feature-b
- Has its own staging index and HEAD
- Agent B edits files here in isolation
# one repository, two checkouts, two branches
git worktree add ../feature-a -b feature-a
git worktree add ../feature-b -b feature-b
# each has its own HEAD and index; the objects are shared
git worktree listWhy Mirasim builds linked worktrees into sessions
git worktree add manually for one branch at a timeParallel sessions in Mirasim mean several coding agents working at the same time, each on its own task. Mirasim does not act as an orchestrator that splits one task among worker agents. Nothing plans across panes or merges their code for you—you review the diffs side by side and merge them yourself.
Article · Claude Code agent teams, and teams that mix agents and people → Claude Code's agent teams, and letting sessions on different agents message each other.
Conductor alternative: move to Mirasim → Used Conductor for parallel agents? How Mirasim compares, and moving over in one click.
Keep reading

Use DeepSeek in Claude Code and Codex: the official setup, and a per-session switch
How DeepSeek's own guides connect Claude Code and Codex to DeepSeek models, and how Mirasim lets you pick DeepSeek per session without editing config.

How to install Claude Code on macOS, Windows and Linux
The official install commands for every platform, how to check the install and sign in, and how Mirasim installs Claude Code for you and runs it next to Codex.

Claude Code agent teams, and teams that mix agents and people
Claude Code's agent teams let a lead session split work across Claude teammates. How to turn them on, what they cost, and how Mirasim mixes Codex and people in.