| name | description | homepage | metadata | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
code-multi-run-tmux |
Run Codex multiple times on the same repo for different features using git worktrees (safe parallelism). |
|
Run Codex multiple times on the same repo safely by using Git worktrees.
The core idea: each Codex run gets its own working directory (so there is no last-write-wins overwrite), while sharing the same .git object database.
Multiple Codex processes editing the same checkout can overwrite each other’s changes. Worktrees avoid that by isolating each run in its own folder.
Pick a “base” checkout you consider the canonical one:
cd /path/to/repo
git statusCreate a new branch and a new worktree folder in one step:
# Creates branch feat/foo and checks it out in ../repo__feat-foo
# (choose any path you like)
git worktree add -b feat/foo ../repo__feat-foo mainRepeat for another parallel run:
git worktree add -b feat/bar ../repo__feat-bar mainRun Codex from inside the worktree directory so it only edits that feature’s files:
cd ../repo__feat-foo
# run your codex command herecd ../repo__feat-foo
git diff
# run tests for the repo
git add -A
git commit -m "feat: foo"When you’re finished with a feature branch (merged or abandoned):
# from anywhere inside the original repo
git worktree remove ../repo__feat-foo
# optionally delete the branch too
git branch -D feat/foogit worktree list- Avoid having two worktrees modify the same lockfile (
package-lock.json,pnpm-lock.yaml) at the same time. - If you want two competing approaches, create two worktrees:
feat/foo-afeat/foo-b
Repo: <worktree path>
Feature: <name>
Goal:
- ...
Constraints:
- Touch only: ...
Acceptance criteria:
- ...
Now implement.