One agent spends much of its time working while you wait, or waiting while you’re elsewhere. Start a second and a third, and that time goes to use. Three things go wrong when you do it naively: two agents in one folder edit the same files, closing a terminal stops the agent in it, and with five sessions open you lose track of which one is asking you something. Each has a fix.
Updated . We make Hako, which handles the third part.
1. Give each agent its own worktree
A git worktree is a second checkout of the same repository, on its own branch, sharing the history. Each agent edits its own copy of the files, so one can build a feature while another fixes a bug, and each piece of work ends up as a branch you can review and merge on its own.
Claude Code makes one for you. Start each session with --worktree (or -w) and a name:
# Terminal 1
claude --worktree feature-auth
# Terminal 2
claude --worktree fix-loginEach worktree goes under .claude/worktrees/<name>/ on a new branch, worktree-<name>; add .claude/worktrees/ to your .gitignore. When you exit, Claude Code removes a worktree with no changes and asks about one with work in it. A worktree is a fresh checkout, so it has no .env and no installed dependencies: list the ignored files to copy in a .worktreeinclude file at the repository root, and install dependencies in each one.
For Codex or any other agent, make the worktree with git and start the agent inside it:
git worktree add ../app-fix-login -b fix-login
cd ../app-fix-login
codexRemove it with git worktree remove ../app-fix-login once the branch is merged. Two agents that each start a dev server will also want different ports, so give each worktree its own.
2. Keep them running without a terminal each
An agent started in a terminal window stops when the window closes. Two ways around that:
- Claude Code background sessions.
claude --bgwith a prompt starts a session that a separate supervisor process runs, so it keeps going after you close the shell, and through sleep, though not a shutdown. Before it edits anything, it moves itself into its own worktree. - A terminal multiplexer. Run each agent in a tmux pane, or in herdr, an open-source runtime built for agents. Either keeps the terminals alive when you close the window, and works for every agent, not only Claude Code.
claude --bg "fix the flaky checkout test"
claude --bg "add dark mode to settings"
claude agents3. Know which one needs you
This is the part that decides how many agents you can actually run. Each one stops to ask for permission or to say it’s done, and an agent waiting unnoticed for twenty minutes cancels the time the others saved.
| Terminal tabs | Agent view | Hako | |
|---|---|---|---|
| Agents | Any | Claude Code | Any, in herdr |
| Shows who’s waiting | No, look in each | Grouped by Needs input, Working, Completed | Sorted by who needs you |
| Several Macs | One window each | This Mac | Every Mac in one list |
| Away from the desk | No | No | iPhone, iPad and Apple Watch |
| Available | Now | Now, in research preview | Coming soon |
Agent view. claude agents opens one screen for every background session on your Mac, grouped into Needs input, Working and Completed, with each row showing the question or status. You can peek at a session and reply without leaving the list, and while agent view is open, Claude Code notifies you when a session needs input, finishes or fails. It’s the simplest choice when all your agents are Claude Code on one Mac and you’re at it.
Hako. herdr marks each pane working, blocked or idle, whatever agent is in it. Hako puts every pane on every Mac in one native list on your iPhone, iPad and Mac, with the agents asking for you at the top. Each pane shows its branch and its pull request, and dev servers are listed with their ports. When an agent asks, the question reaches your Lock Screen with the answers as buttons, and Notify When Done tells you which pane on which Mac has finished. It suits you if you run Codex beside Claude Code, use more than one Mac, or want to keep the agents moving from your phone. See the list.
Questions
How many agents can I run at once?
Your Mac handles more than you can review. Each Claude Code session uses your plan’s usage limits on its own, so several busy sessions reach them sooner, and every finished branch still needs you to read it. Most people settle on a few, each on a separate piece of work.
Can two agents work on the same branch?
Not in two worktrees: git checks out a branch in only one worktree at a time, which is what keeps their edits apart. To split one task, have Claude use subagents inside a single session, or give each agent its own branch and merge them.
Is there one app that does all three?
Some workspaces run agents through their own interface instead of a terminal. Orca and Paseo can run each agent in its own worktree and put diff review beside it, and T3 Code brings several agent providers into one window with branches and pull requests. Each also has a phone app. They suit you if you’d rather move your work into their app; herdr and Hako keep it in the terminal panes you already use.
Do I have to stay at my Mac?
No, but your Mac has to stay awake, because that’s where the agents run. Claude Code on iPhone covers reaching them from your phone and keeping a Mac awake, and Agent notifications covers getting a ping when one needs you.