Run several coding agents side by side, each on its own git worktree
CodeHerd 1.0 is a Mac app that runs Claude Code, Codex, Gemini CLI or any CLI agent side by side in panes, each optionally on its own git worktree.
Real AI agent use cases, with sources and setup prompts
Short answer: Give every agent its own git worktree so each one edits a separate copy of the repo on its own branch. In Claude Code run claude --worktree feature-a in one terminal and claude --worktree bugfix-b in another; in Codex add --worktree (codex --worktree or codex exec --worktree "task"); in Cursor start each agent in a worktree from the Agents Window. Give each agent one task with its own files, watch them in tmux panes, then review and merge one branch at a time. Start with two agents: every agent uses your plan's limits at the same time.
Four working setups with exact commands: plain git worktrees in tmux for any agent, Claude Code's built-in worktrees, agent teams and worktree subagents, Codex --worktree, and Cursor's Agents Window with an auto-setup file. 24 matching use cases below, each with a public source.
Looking for something else? Search all 1965 use cases or .
| Tool | What it does here | Price | Link |
|---|---|---|---|
| git worktree | Built into git. Creates extra checkouts of one repo, each on its own branch, sharing the same history. The base of every setup here. | Free | Official site |
| Claude Code | Anthropic's terminal coding agent. claude --worktree NAME starts an isolated parallel session; also has subagents with isolation: worktree and experimental agent teams. | Claude Pro $20/mo ($17/mo billed yearly), Max $100/mo, Ultra $200/mo, or API billing | Official site |
| Codex CLI | OpenAI's terminal coding agent. --worktree starts a session or codex exec run in a new managed git worktree; codex review checks another agent's branch. | Included with ChatGPT Free ($0, limited), Go, Plus and Pro (from $100/mo), or an OpenAI API key | Official site |
| Cursor | AI code editor. Its Agents Window can start or move each agent into its own worktree, and .cursor/worktrees.json runs setup commands in every new one. | Free (limited); Plus $8/mo (Grok models only); Premium $30/mo adds cloud agents and third-party models at API price; Super $100/mo; Ultra $200/mo | Official site |
| tmux | Terminal multiplexer. One window split into panes, one agent per pane, and sessions keep running after you close the terminal or SSH. Claude Code agent teams use it for split panes. | Free (open source) | Official site |
| iTerm2 (macOS, optional) | Mac terminal that Claude Code agent teams can also use for split panes, through its it2 CLI and Python API. | Free | Official site |
| AGENTS.md / CLAUDE.md | One rules file in the repo with build, test and style commands, read by every agent in every worktree. | Free (a file in your repo) | Official site |
Prices are from each official page, checked 2026-11-22; they exclude tax and can change. Swipe the table sideways on a phone.
About 10 minutes. Works with Claude Code, Codex, Gemini CLI, OpenCode or any terminal agent. You make the worktrees, tmux keeps every agent visible and running.
cd ~/code/myapp
git status # commit or stash first
git worktree add ../myapp-a -b agent/a-csv-export
git worktree add ../myapp-b -b agent/b-login-bug
git worktree listfor w in ../myapp-a ../myapp-b; do
cp .env "$w/.env" 2>/dev/null
(cd "$w" && npm ci)
donetmux new-session -d -s agents -c ~/code/myapp-a
tmux split-window -h -t agents -c ~/code/myapp-b
tmux send-keys -t agents:0.0 'claude' Enter
tmux send-keys -t agents:0.1 'codex' Enter
tmux attach -t agentscd ~/code/myapp
git merge --no-ff agent/a-csv-export
cd ../myapp-b && git rebase main && npm test
cd ~/code/myapp && git merge --no-ff agent/b-login-bug
git worktree remove ../myapp-a
git worktree remove ../myapp-b
git branch -d agent/a-csv-export agent/b-login-bugAbout 10 minutes. Claude Code can make and clean up the worktrees itself. Use parallel sessions for separate tasks, worktree subagents for helpers inside one session, and agent teams only when the agents need to talk to each other.
# terminal 1
claude --worktree feature-auth
# terminal 2
claude --worktree fix-checkout-bug# .worktreeinclude
.env
.env.local
config/secrets.dev.json---
name: parallel-builder
description: Implements one self-contained task from docs/PLAN.md in an isolated worktree, runs the tests, and reports the branch and results.
tools: Read, Edit, Write, Bash, Grep, Glob
model: sonnet
isolation: worktree
---
You implement exactly one task. Stay inside the files the task names.
Run the project's test command before you finish. Report the branch name,
files changed, test result, and anything you could not do.{
"env": {
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
},
"teammateMode": "auto"
}git worktree list
git worktree unlock .claude/worktrees/feature-auth # only if locked
git worktree remove .claude/worktrees/feature-authAbout 5 minutes. Both tools can create the worktree for you, so each agent starts isolated.
# interactive, isolated
codex --worktree
# two background tasks at once, each in its own worktree
codex exec --worktree "Implement task 1 from docs/PLAN.md and run the tests" &
codex exec --worktree "Implement task 2 from docs/PLAN.md and run the tests" &
waitgit switch agent/a-csv-export
codex review --base main{
"setup-worktree": [
"npm ci",
"cp $ROOT_WORKTREE_PATH/.env .env"
]
}{
"cursor.worktreeCleanupIntervalHours": 6,
"cursor.worktreeMaxCount": 25
}Further reading: How to use Claude Code and Codex together The two-agent version: the Codex plugin, a shared AGENTS.md and automatic cross-review.
Further reading: How to run AI coding agents in a sandbox Run parallel agents in containers or VMs when you turn approvals off.
Further reading: How to control coding agents from your phone Check on tmux sessions and parallel agents away from your desk.
Further reading: How to write a CLAUDE.md or AGENTS.md file The shared rules file every parallel agent reads.
Further reading: How to cut AI coding agent costs Keep several agents from draining your plan.
Further reading: How to get AI code review on pull requests Review every agent's branch before it merges.
Further reading: How to build your own coding agent or harness Build your own harness with the Claude Agent SDK, Codex SDK, Pi or mini-swe-agent.
Further reading: How to port code to another language with AI One module per agent in git worktrees, with a golden-file check before merging.
Written for this setup. Replace anything in [brackets] before you send it.
Before you start any agents. Paste into one agent in the main checkout.
I want to run [2-4] coding agents in parallel on this repo. Read the code and split [describe the feature or backlog] into independent tasks. Rules: each task must touch a different set of files, be finishable in one session, and have a way to test it. Write them to docs/PLAN.md as a numbered list with: task, files it owns, files it must not touch, test command, and done-when. Flag any tasks that can't run in parallel and why. Don't write code yet.
In each agent's worktree, with a different task number.
You are one of several agents working in parallel, each in its own git worktree. Your task: #[N] in docs/PLAN.md. Only edit the files listed for it. 1) Restate the task and your plan in 3-5 lines and wait for my OK. 2) Work in small commits on this branch. 3) Run [test command] before you say you're done. 4) Finish with: branch name, files changed, test output, and anything left undone. Don't merge, push, rebase other branches or edit files outside your list.
Once per repo, before scaling past two agents.
Write an AGENTS.md for this repo that every coding agent will read. Include: how to install, build, run and test (exact commands); code style; folders that are off-limits; the rule that each agent works only on its own branch and task from docs/PLAN.md; and the done checklist (tests pass, lint passes, summary written). Keep it under 60 lines. Use only commands that exist in this repo; check package.json or the Makefile.
When you want the agent to do the git setup.
Create one git worktree per task in docs/PLAN.md, next to this repo (../[repo]-task1, ../[repo]-task2 ...), each on a new branch agent/task[N]-[short-name] from main. Copy .env into each and install dependencies. Then print a tmux command that opens one pane per worktree. Show me each command before you run it, and don't delete or reset anything.
In a different agent from the one that wrote the code.
Review branch [agent/task1-...] against main as a strict senior reviewer. Run: git diff main...[branch] List findings by severity (blocking, should-fix, nit) with file and line. Check: does it do only what task #[N] in docs/PLAN.md says, are there tests, does it touch files owned by another task? Don't edit anything. End with merge / don't merge.
After the agents finish.
These branches are finished: [list]. Propose a merge order that minimizes conflicts, based on which files each one changed (git diff --stat main...branch). Then, one at a time: merge into main, run [test command], and stop if anything fails. Before each next merge, rebase that branch on the new main and rerun its tests. Show me each command first. Never force-push.
When two branches touched the same code.
Merging [branch B] into main conflicts with what [branch A] already merged. Explain what each side intended (read both diffs and their task lines in docs/PLAN.md), then propose a resolution that keeps both behaviors. Show me the resolved hunks before you write them, then run [test command].
Claude Code with CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, run inside tmux.
Create an agent team for [goal]. Spawn three teammates: 1) backend: owns [folders], 2) frontend: owns [folders], 3) tests: writes and runs tests for both and reports failures to the owner. Use the shared task list. Teammates must not edit files another teammate owns. When all tasks are done, summarize what changed and what's still open, then stop the team.
For a hard bug or design choice where you want two attempts.
Two agents are attempting the same task in separate worktrees: [branch A] and [branch B]. Compare them: which one is correct, simpler, better tested and smaller? Run the tests on both. Recommend one to merge and list anything from the other worth copying over. Don't merge anything.
In a separate terminal while agents work.
List every git worktree in this repo (git worktree list) and for each branch show: last commit time and message, files changed vs main (git diff --stat main...branch), and whether the tests pass. Flag any two branches that changed the same file. Make a short table. Don't modify anything.
Before a long parallel session on a subscription plan.
I'm about to run [N] agents in parallel for about [hours] on [plan]. For each task in docs/PLAN.md, suggest whether it needs a top model or can use a cheaper one, and which tasks can wait for a later session. Give me a plan that keeps me from hitting my limit halfway through, and tell me how to check my usage in [Claude Code /usage or Codex /status].
At the end of the day.
List all git worktrees and branches named agent/*. For each: is it merged into main? Does it have uncommitted or unpushed changes? Remove only the worktrees and branches that are fully merged and clean, showing each command first. Leave anything with unmerged work and list it for me.
Related guides: How to control Claude Code and Codex from your phone (Remote Control, ChatGPT app, SSH and tmux) · How to use Claude Code and Codex together (Codex plugin, shared AGENTS.md, worktrees, auto cross-review and GitHub Actions) · How to run AI coding agents in a sandbox
The Daily 5
Five new real AI use cases every morning. Free. Unsubscribe any time.
CodeHerd 1.0 is a Mac app that runs Claude Code, Codex, Gemini CLI or any CLI agent side by side in panes, each optionally on its own git worktree.
While having agents translate C kernel prototypes into Rust and run tests in parallel, a developer kept hitting file locks and agents clashing in one directory. He built Shadow to give each agent an isolated workspace for editing and building.
A practical guide to running coding agents in named, detachable tmux sessions that survive a closed terminal or dropped SSH link. It starts with the built-in claude --worktree --tmux, then shows send-keys to type into any agent from a script and capture-pane to read its output back, and where tmux stops being enough.
Corgi shows a running activity feed for each coding agent, jumps to the next unread agent with F1, and has one launcher for Codex, Claude Code and Pi across multiple accounts with session search, resume and usage tracking.
Paying for Claude, Codex, GLM and Command Code, the author built vNext so Claude Code directs the other agents, runs them in parallel and records every job.
pi-cowboy orchestrates background agents for Pi, each in an isolated copy-on-write Git worktree, can run subagents in Claude Code, Codex, OpenCode and more, and consolidates the results.
Built SwarmPane to run Claude Code, Codex, Gemini, Grok and Cursor in parallel panes with attention cues.
Running Claude Code, Codex and OpenCode on one repo meant three dev servers and an out-of-memory box, so the author built a local controller that makes agents share servers, queue tests and remember each other's decisions.
Built Foremerge to catch intent conflicts when parallel coding agents edit the same work.
Pointed Firstmate with Grok 4.5 at a private AI legal-case app and largely left it running.
Uses Firstmate so one agent in Claude Code orchestrates other coding agents overnight.
From his phone, ZazenCodes gets Codex on his computer to spin up Claude Code and pull its review of what Codex built.
gaborishko built Agoryx, a local-first, MIT-licensed GUI that puts Claude Code and Codex in one conversation so one can make a change and the other can review it. It runs on Apple Silicon macOS with Node 22+ and your signed-in CLIs.
Lizard gives every coding agent its own isolated microVM that boots in about 238 ms. You hand Claude Code or Codex a task per sandbox, and the Pro plan runs up to 100 of them in parallel without the agents touching your laptop or each other.
A developer built his own orchestrator app on Claude Code: proactive agents that set and pursue outcomes, and a single orchestrator you talk to instead of hundreds of separate threads, with support for poteto mode and pstack.
SpaceApp is a self-hosted workspace that runs AI coding CLIs side by side in persistent rooms: OpenCode, Codex, Claude Code, Gemini, Qwen, Kimi, Grok and DeepSeek, each in its own pane on your own machine.
The CheckUsage Mac app shows rings for Claude, Codex, Cursor, Copilot, Gemini and Grok usage limits.
Shipped Agentic coding workflows built on Git worktrees and task evidence and shared it as a Show HN.
A 25-year designer built six games with Claude Code and Codex; getting them running was quick, making them fun took longer.
Daily, three Sonnet agents take 15 leads each, research the site and Meta Ads Library, find weaknesses and write a cold email; Opus reviews and he approves.
After the Railway incident, cbarmorecpa spent two days having Claude Code and Codex audit every domain, app and machine he runs, then set up safeguards so he isn't relying on checking by hand.
realMattAbrams runs a custom Grok Bot team that is translating a Hebrew tome and producing the book. He found ArtCraft's DesignCraft can be driven headless by agents through a CLI at about the same token spend, so the bots can use it for layout.
Dainer_Jun's CLAUDE.md just imports AGENTS.md and routes the work, Codex reads AGENTS.md on its own, and work state lives in files too.
Yamapama had Codex build a VST softsynth, added MCP support to it, then gave Codex computer use plus MCP access to Reason and the synth so it plays and makes music in real time.
The Daily 5
Five new real AI use cases every morning. Free. Unsubscribe any time.
How to make faceless YouTube videos with AI: tools, commands, prompts and YouTube's 2026 rules · How to automate work with n8n and AI · How to vibe code an app with Claude Code · How to build AI agents for SEO and ads · How to build an MCP server for AI agents · How to add memory to Claude Code, Codex and Cursor: CLAUDE.md, AGENTS.md, auto memory and shared MCP memory (2026) · How to secure a vibe-coded app before you launch · How to observe and debug AI agents · How to build agent memory and context layers · How to control Claude Code and Codex from your phone (Remote Control, ChatGPT app, SSH and tmux) · How to add payments to vibe-coded apps · How to run local LLMs with AI agents (Claude Code, Codex and OpenCode on Ollama, LM Studio or llama.cpp) · How to set up Grok Bot agents for real work: first Bot, routines, webhooks and a team of Bots, with prompts · How to build with Gemini 4 Argon (API, Antigravity CLI, and the Dec 1 2026 price change) · How to use AI for taxes, bills and budgets: build a budget from bank CSVs, catch bill increases and check your tax return · How to make AI video ads and Reels with agents · How to set up Hermes Agent workflows · How to vibe code a game with AI: one-file browser games, Phaser 4 and Godot 4.7, with an AI playtest loop and 13 prompts · How to replace SaaS subscriptions with vibe-coded tools · How to use AI agents for errands, calls and shopping · How to use Cursor agents and automations · How to make 3D scenes and models with AI and Blender (Blender MCP, Claude, Codex): step-by-step · How to use Claude Code skills and plugins · How to cut Claude Code, Codex and Cursor costs: commands, settings and prompts that save tokens (Nov 2026) · How to automate a small business with AI agents · How to compare AI models on the same prompt · How to build hardware projects with AI agents · How to make an AI music video for your song (Suno, Grok Imagine, Kling, Veo) · How to use AI agents with Obsidian notes (CLI, Claude Code, MCP) · How to build apps and games for your kids with AI · How to use ChatGPT for real projects and everyday tasks · How to make AI agents ask for approval before they act · How to build AI trading and investing agents (Alpaca MCP and a six-agent Grok Bot desk) · How to build AI agents that make and answer phone calls · How to plan meals and groceries with AI (weekly plan, shopping list, Instacart cart in ChatGPT, Claude or Gemini) · How to use AI agents for fitness and health · How to undo, checkpoint and stop runaway coding agents · How to use AI agents for job hunting · How to automate social media posts with AI agents · How to build a smart home and voice assistant with AI agents · How to make money with AI agents: 4 setups real people get paid for (local websites, affiliate sites, digital products, freelance gigs) · How to build a website with AI agents · How to use AI agents for research: literature reviews, citations and papers (Claude, Zotero, Elicit) · How to build an iPhone or Android app with AI · How to automate email and your inbox with AI agents · How to use AI agents on Linux servers and homelabs safely (Claude Code, Codex, SSH, Proxmox) · How to build Telegram, Discord and WhatsApp bots with AI · How to research memecoins and crypto with AI agents (read-only first, 2026) · How to remove ads and bloatware from your smart TV with AI (Android TV, Google TV, Samsung, LG) · How to scan and organize receipts and paperwork with AI (ChatGPT, Paperless-ngx) · How to organize and search your photo library with AI (Immich, Google Photos, Videre) · How to check a medical bill for errors and appeal an insurance denial with AI · How to set up local AI security cameras with Frigate, Ollama and Home Assistant (no cloud) · How to set up a Jellyfin media server with AI help (free Plex alternative): Docker, hardware transcoding, remote access · How to lower your electric bill with Home Assistant and AI: energy dashboard, smart plugs, time-of-use automations · How to self-host AI agents at home on a Raspberry Pi, Mac mini or old PC · How to find and cancel subscriptions you forgot about with AI · How to run a private ChatGPT at home on your own computer (Ollama + Open WebUI) · How to build and install your own app on a Samsung TV with AI · How to fix a printer that won't print with AI · How to learn anything with an AI tutor: ChatGPT Study mode, Gemini Guided Learning, NotebookLM flashcards and Anki (2026) · How to build an AI second brain (Karpathy-style LLM wiki) with Obsidian and Claude Code: setup, prompts and costs · How to reverse-engineer and revive old devices with AI · How to edit videos with Claude Code and Codex: cut footage with ffmpeg, Whisper and auto-editor, find scenes and bad frames, drive DaVinci Resolve over MCP (2026) · How to set up an AI family assistant · How to make a Godot or Unity game with AI: Godot AI, Unity CLI and MCP setups for Claude Code and Codex · How to build a custom Android TV or Google TV launcher with AI (manifest, adb commands, HDMI inputs and prompts) · How to use Claude Code and Codex together (Codex plugin, shared AGENTS.md, worktrees, auto cross-review and GitHub Actions) · How to build your own invoicing and bookkeeping app with AI · How to make a browser arcade game with AI (Claude Code, Codex, three.js, 2026) · How to make a product demo or launch video with AI (Claude Code, Remotion, HyperFrames and Playwright) · How to fix Wi-Fi and secure your home network with AI (Nmap, Pi-hole, NextDNS, UniFi) · How to control Claude Code and Codex by voice (built-in /voice, local Whisper and hands-free setups) · How to design a PCB and electronics with AI · How to save, share and resume coding agent sessions · How to run AI coding agents in a sandbox · How to make a multiplayer game with AI · How to let AI control your computer: Claude, Codex, Windows-MCP and Playwright setups with prompts · How to build a Mac menu bar app with AI · How to port code to another language with AI (Claude Code or Codex, golden tests, C to Rust) · How to make an AI animated short film or anime (Seedance, Kling, Grok Imagine, Claude Code) · How to build your own coding agent or harness (Claude Agent SDK, a 60-line loop, Pi, mini-swe-agent and Terminal-Bench) · How to get notified when Claude Code or Codex needs you · How to build a Chrome extension with AI (Claude Code, Codex or Cursor, tested Manifest V3 code) · How to use AI agents with Excel and Google Sheets · How to run Claude Code and Codex in a desktop app (T3 Code, Codex app, Claude Desktop) · How to make a song or album with AI · How to vibe code classroom apps and quizzes as a teacher · How to plan and book a trip with an AI agent · How to make motion graphics and animated videos with Claude Code or Codex (Remotion, HyperFrames, Manim, 2026) · How to mod and reverse engineer games with AI · How to run AI agents overnight while you sleep · How to negotiate bills and get refunds with an AI agent · How to let an AI agent use your phone: Grok Bot phone tools, Android over ADB, iPhone Mirroring and a safe emulator test run, with prompts · How to build a Polymarket bot with AI (and Kalshi): step-by-step with the official SDKs · How to use Claude Duet: setup, connectors, standing instructions, prompts and real examples (2026) · How to build private apps just for yourself with AI · How to design and 3D print things with AI · How to automate customer support with AI agents: real setups · How to find leads and automate sales outreach with AI agents · How to run a Shopify or online store with AI agents · How to launch an app and get your first users with AI · How to build a team of AI agents with a chief of staff · How to make a hand-tracking or gesture-controlled game with AI · How to test your app with AI agents (Playwright MCP, Claude Code, Codex, 2026) · How to give an AI agent a budget or a card safely · How to share passwords and logins with an AI agent safely · How to get AI code review on your pull requests (Claude Code, Codex, Copilot, CodeRabbit and open-source PR-Agent) · How to review contracts, leases and fine print with AI · How to make slides and presentations with AI · How to take meeting notes and track follow-ups with AI · How to scrape websites and extract data with AI agents · How to make a podcast with AI: two-host episodes, cloned voices, clean audio, transcripts and clips · How to use AI agents for security scans and threat intel · How to build a dashboard with AI (Claude Code, Streamlit, Grok Bot Pages and Metabase) · How to clone your voice and make AI voiceovers · How to make AI images, thumbnails and product photos · How to write a CLAUDE.md or AGENTS.md file: one rules file for Claude Code, Codex, Cursor, Copilot and Gemini, with templates · How to build an AI chatbot for your own documents · How to port or remake a classic game with AI · How to build a VST plugin or synth with AI (Claude Code, Codex, JUCE): step-by-step · How to trigger AI agents with webhooks and events · How to find a home or rental with AI (Zillow, Redfin and Apartments.com in ChatGPT and Claude) · How to track Claude Code and Codex usage limits · How to build a daily AI briefing or news digest · How to check if your devices are spying on you with AI (Nmap, Pi-hole, TV ACR) · How to track smart-money wallets and copy trade with AI: Polymarket leaderboard, Solana and Ethereum wallet alerts and convergence rules · How to translate and localize your app or content with AI (i18next, Claude Code, DeepL and fastlane) · How to write and publish a book with AI: editing setup, KDP rules, EPUB commands and prompts · How to control your TV with an AI agent (ADB, Roku ECP, Samsung/LG, Home Assistant) · How to take your robot vacuum off the cloud with AI (Valetudo, Matter, Home Assistant) · How to connect an AI agent to Home Assistant (Claude, ChatGPT, Claude Code, Codex, 2026) · How to let an AI agent do your bookkeeping (Xero, QuickBooks, MCP) · How to run an AI agent 24/7 on an old Android phone or TV box (Termux, 2026) · How to see all your bank accounts in one place with AI
Five real AI use cases with setups, every morning. Free.
The Daily 5 will arrive in your inbox each morning. Unsubscribe any time.
Send the public link (post, video, repo or write-up). We credit you and link back.