# Can Claude Code and Codex work on the same repo at the same time?

*Updated 6 November 2026. Canonical: https://zoltbot.ai/answers/claude-code-and-codex-on-same-repo*

**Short answer:** Yes, as long as they don't share a checkout: give each agent its own git worktree and branch, and merge one branch at a time. Without worktrees, run them one after the other. Zoltbot can do either: it gives a task its own worktree, or queues tasks that share a folder.

## Set it up

```sh
git worktree add ../shop-claude -b agent/claude-auth
git worktree add ../shop-codex -b agent/codex-tests

cd ../shop-claude && claude
cd ../shop-codex && codex
```

Both tools can also create the worktree for you: `claude --worktree <name>` for Claude Code, and the Worktree option under the composer in the ChatGPT desktop app for Codex.

## What still collides

- Both dev servers want the same port. Set a different one in each worktree's `.env.local`.
- Worktrees don't copy your dev database. Give each worktree its own database name.
- Merge one branch, rebase the other onto it, and run the tests again before merging the second.

Our [guide to running agents in parallel](https://zoltbot.ai/guides/parallel-coding-agents) covers each of these in more detail.

## In Zoltbot

In Zoltbot, give each task its own Git worktree and a Claude Code task and a Codex task run at the same time on separate checkouts. Tasks that share a code folder run one at a time, and the rest wait with a visible reason, so two agents never edit the same checkout at once.

## Sources

Checked on 6 November 2026.

- [Git: git-worktree documentation](https://git-scm.com/docs/git-worktree)
- [Claude Code: Worktrees](https://code.claude.com/docs/en/worktrees)
- [Codex: Worktrees](https://learn.chatgpt.com/docs/environments/git-worktrees)

## Related

- [How to run several coding agents at once](https://zoltbot.ai/guides/parallel-coding-agents)
- [Claude Code vs Codex](https://zoltbot.ai/compare/claude-code-vs-codex)
- [Will I lose my chats if I stop using Zoltbot?](https://zoltbot.ai/answers/will-i-lose-my-chats)
