Skip to main content
Cover art for "How to Run Claude Code and Codex Side by Side"
GUIDE

How to Run Claude Code and Codex Side by Side

Harmony Team

· 6 MIN READ

Claude Code and Codex are good at different things, and plenty of developers now keep both open. The trouble starts when both work on the same repository at once. They edit the same files, run the same test command against each other's half-finished changes, and each reports success on a working tree the other just changed underneath it.

None of that needs a new tool to fix. It needs a little structure. Here is the setup we use, step by step, and then what Harmony adds on top of it.

1. Give each agent its own working copy

The single biggest fix is a separate git worktree per agent. Each agent gets its own directory and its own branch, while sharing one repository, so they can never write over each other's files.

$ git worktree add ../myapp-claude -b claude/search-api
$ git worktree add ../myapp-codex -b codex/search-ui

Then start each agent inside its own directory:

$ cd ../myapp-claude && claude
$ cd ../myapp-codex && codex

2. Split the work by ownership, not by turns

Agents collide when two of them think the same file is theirs. Before either starts, decide who owns what: one agent takes the API and its tests, the other takes the UI that calls it. Agree on the interface between them first, in writing, and give that file to both.

  • Write the contract (types, endpoint shapes, function signatures) before either agent starts
  • Name the files each agent may change, and say the rest are read-only for it
  • Keep shared files (lockfiles, configs) owned by exactly one agent

3. Keep a shared task list they both read

A plain TASKS.md in the repository works. List each task, who owns it, and what done means. Tell each agent to read it at the start and update its own line when it finishes. It is crude, but it replaces you pasting context from one chat into the other.

4. Hand off through files, not through you

When one agent's work is the other's input, ask the first to write a short summary file (what changed, what the other side needs to know, what is unfinished) and point the second agent at it. You stop being the messenger, and the hand-off is in the repository where you can review it.

5. Review and merge one branch at a time

Before merging, read each branch's diff against main and run the full test suite on it alone:

$ git diff main...claude/search-api
$ git diff main...codex/search-ui

Merge the one the other depends on first, rebase the second onto it, run the tests again, then merge. When both are in, remove the worktrees:

$ git worktree remove ../myapp-claude
$ git worktree remove ../myapp-codex

The friction that is left

This setup works. What it does not fix is the bookkeeping: you still open the terminals, start each agent, keep TASKS.md honest, relay questions between agents, and lose the sessions when you close the window or the laptop sleeps.

Where Harmony fits

Harmony is a free desktop app that does that bookkeeping. You run Claude Code, Codex and other agents side by side in one workspace; each can work in its own worktree; agents share one task board and can message each other across providers; and their sessions keep running when you close the window. Harmony Pro moves the same agents onto a hosted machine when you need them to keep going after the laptop closes.

To be precise about how finished that is: the workspace, task board, messaging and worktrees ship today as preview features, and fully autonomous multi-agent runs are still experimental. The features page labels every capability with its status.

Try the five steps above by hand first. If the bookkeeping is what slows you down, download Harmony and run the same setup in one place.

What's next

Close the window. Come back to the work.

Quit the UI and local agent sessions keep running in the background. If the laptop sleeps, they pause with the machine; on wake, Harmony rechecks them and reattaches the same tabs and terminal history.

Download Harmony

Free · Runs locally · No account needed