gilvt
Multi-agent guide

How to run Claude Code and Codex in parallel

Use the agents as independent workers, not two cursors inside the same checkout. Separate their files and objectives, then review each result through one attention queue.

Safe default: one Git worktree and branch per Agent. Give Claude Code and Codex tasks with different ownership, run verification inside each worktree, and merge only after reviewing each diff.

Create two independent worktrees

git worktree add ../project-feature -b agent/feature
git worktree add ../project-review -b agent/review

# Terminal 1
cd ../project-feature && claude

# Terminal 2
cd ../project-review && codex

This avoids the most common failure mode: one Agent reading or replacing a file while the other is still changing it.

Choose complementary roles

Parallel work is safest when the outputs can be evaluated independently. Useful pairings include:

Avoid telling both agents to “fix the same bug” in the same checkout unless you explicitly want competing solutions.

Give both agents the same completion contract

Each prompt should identify the target, boundaries and proof:

Implement the parser change in crates/example.
Do not edit the public API or generated fixtures.
Add regression tests for the two supplied cases.
Run cargo test -p example and summarize the changed files.

The tools may take different approaches, but their results become comparable because both must satisfy the same observable contract.

Keep verification local to each worktree

Run tests before merging branches together. Shared caches are usually fine, but shared ports, databases and generated files can still conflict. Allocate different port numbers or isolated temporary directories when both tasks start local services.

Manage attention across both TUIs

Claude Code and Codex expose different hooks and session formats. A normal terminal treats them as unrelated text screens. gilvt normalizes their high-level state while leaving both native interfaces untouched.

The same sidebar can show that Claude is awaiting approval while Codex is still running. Notifications and ⇧⌘J take you to the session that needs input, regardless of which Agent produced it.

gilvt Monitor showing Claude Code, Codex and terminal sessions in one activity view.
The Monitor combines Claude Code, Codex and ordinary terminal activity without replacing their TUIs.

Merge deliberately

  1. Review each Agent's commands, diff and test result.
  2. Commit the accepted result in its own branch.
  3. Merge or cherry-pick one branch at a time.
  4. Resolve semantic conflicts with the full test suite, not only Git's text conflict markers.

If the second branch was a review task, feed its findings back to the implementation session rather than merging edits automatically.

In gilvt: use ⇧⌘N to launch either Agent in a fresh worktree, ⌥⌘2 to inspect per-turn artifacts, and ⇧⌘R to find or resume older sessions.