[{"data":1,"prerenderedAt":52},["ShallowReactive",2],{"blog-run-multiple-claude-code-sessions":3,"blog-related-run-multiple-claude-code-sessions":36},{"slug":4,"title":5,"description":6,"category":7,"categoryId":8,"keyword":9,"date":10,"minutes":11,"body":12,"html":13,"headings":14},"run-multiple-claude-code-sessions","Run multiple Claude Code sessions at once without losing track","How to run several Claude Code sessions in parallel: isolate their files, name and resume them, use background agents, and keep the whole pile in sight.","Workflows","workflows","run multiple claude code sessions","2026-11-17",5,"You can run as many Claude Code sessions as your machine and your plan allow: one terminal per session, each its own conversation. The hard part is not starting them. It is keeping their files apart, remembering which is which, and noticing the one that has been waiting for your answer for twenty minutes. Here is a setup that works from the plain CLI.\n\n## Can you run several Claude Code sessions at the same time?\n\nYes. Every `claude` process is an independent conversation, saved as a transcript under `~\u002F.claude\u002Fprojects`. Nothing stops you from opening five terminals.\n\nTwo things to know up front. First, sessions draw on the same plan limits, so five busy sessions use your 5-hour window faster than one (see [Claude Code usage limits](\u002Fblog\u002Fclaude-code-usage-limits)). The agent view docs say it directly: each session uses your subscription quota independently. Second, your attention is the real bottleneck. Three sessions you can follow; eight you cannot, unless you set things up so the screen tells you which one needs you.\n\n## How do you keep parallel sessions from overwriting each other?\n\nGive each session its own files. Two sessions in one checkout share one working tree, and a `git commit` in one will include the other's half-done edits. The clean fix is a [git worktree](\u002Fblog\u002Fclaude-code-git-worktrees) per session:\n\n```sh\nclaude --worktree feature-auth\nclaude --worktree fix-login-bug   # in a second terminal\n```\n\nEach gets `.claude\u002Fworktrees\u002F\u003Cname>\u002F` on its own branch. If you must share a checkout, split by area: one session in `api\u002F`, another in `web\u002F`, and neither touches the other's folder. Then commit often and review `git status` before every commit so you know what is whose.\n\nResearch-only sessions (reading code, answering questions, drafting a plan in [plan mode](\u002Fblog\u002Fclaude-code-plan-mode)) do not edit anything and can share a checkout with anything.\n\n## How do you name and find a session later?\n\nUnnamed sessions get a generated title from your first prompt, which is fine for one session and useless for six. Name them:\n\n```sh\nclaude -n auth-refactor          # at startup\n```\n\nor `\u002Frename auth-refactor` inside the session, or `Ctrl+R` on a row in the picker. Then come back by name:\n\n```sh\nclaude --resume auth-refactor    # resume directly\nclaude --resume                  # open the picker\nclaude --continue                # most recent session in this directory\n```\n\nIn the picker, `Space` previews a session, `Ctrl+B` filters to the current git branch and `Ctrl+W` widens the list to every worktree of the repository. Naming a session after its branch is the cheapest habit in this article.\n\nOne trap: if you resume the same session in two terminals at once, both write to one transcript and messages can go missing. Add `--fork-session` to each when you want two copies of a conversation. Inside a session, `\u002Fbranch` does the same: it copies the conversation so far and switches you to the copy.\n\n## What are background sessions and agent view?\n\nClaude Code can run sessions without a terminal attached and show them on one screen. This is labelled a research preview in the docs, so shortcuts may change.\n\n```sh\nclaude --bg \"investigate the flaky settings test\"   # start one in the background\nclaude agents                                       # one screen for all of them\n```\n\nInside a normal session, `\u002Fbackground` (or `\u002Fbg`) detaches it, and pressing `←` on an empty prompt opens agent view. Each row shows a state: working, needs input, idle, completed, failed or stopped. Select a row and press `Space` to peek at the question or the result, type to reply from the peek panel, press `Enter` to attach fully, and `←` to detach again. Detaching never stops a session. `claude stop \u003Cid>` does, and `claude rm \u003Cid>` removes it.\n\nBackground sessions that edit files in a git repository move into a worktree first, so they do not write to your checkout. When their work is done in a worktree they commit and push the branch and may open a draft PR; the docs say they never push to `main` or `master`, force-push or merge. Also note that interactive sessions in other terminals do not appear in agent view until you background them.\n\n## How do you know which session is waiting for you?\n\nThis is the part terminals are bad at. Options, from cheap to thorough:\n\n- **Terminal tab titles.** Agent view puts the number of sessions awaiting input in its tab title.\n- **Notifications.** Claude Code [hooks](\u002Fblog\u002Fclaude-code-hooks) can run a script when a session needs attention, for example to send a desktop notification or play a sound.\n- **Permission modes.** Fewer prompts mean fewer stalls. Reading the [permission modes](\u002Fblog\u002Fclaude-code-permission-modes) page is worth ten minutes if you run sessions in parallel; a session blocked on a harmless `ls` prompt is wasted time.\n- **A status habit.** End long prompts with \"when you finish, summarize what changed and what you could not verify\". The summary is what you will read when you come back.\n\n## What is a sensible limit?\n\nStart with two or three sessions, each with a clear, separate task, and add a fourth only when you notice you are idle. A workable split:\n\n| Session | Job | Files |\n| --- | --- | --- |\n| Feature | The thing you are building | Its own worktree |\n| Bug | One small fix or investigation | Its own worktree |\n| Questions | Reading code, planning, explaining | Shared, read-only |\n\nClose or `\u002Fclear` sessions you are done with. A session that has run for hours carries a long context and costs more per turn; see [the context window](\u002Fblog\u002Fclaude-code-context-window).\n\n## In Relais\n\nRelais is a desktop app built around exactly this problem. Sessions are real Claude Code sessions (`claude --resume` opens any of them), sorted by project in a sidebar. A row is blue while it runs, orange while it waits for you, green once its changes are pushed and red on an error. A \"Needs you\" list gathers what is waiting across every project, with a soft sound and a notification when a session finishes or asks something. A session can also get its own worktree and branch from a checkbox. Everything still counts toward your Claude plan's limits. See [features](\u002Ffeatures).","\u003Cp>You can run as many Claude Code sessions as your machine and your plan allow: one terminal per session, each its own conversation. The hard part is not starting them. It is keeping their files apart, remembering which is which, and noticing the one that has been waiting for your answer for twenty minutes. Here is a setup that works from the plain CLI.\u003C\u002Fp>\n\u003Ch2 id=\"can-you-run-several-claude-code-sessions-at-the-same-time\">\u003Ca class=\"anchor\" href=\"#can-you-run-several-claude-code-sessions-at-the-same-time\" aria-label=\"Link to this section\">#\u003C\u002Fa>Can you run several Claude Code sessions at the same time?\u003C\u002Fh2>\n\u003Cp>Yes. Every \u003Ccode>claude\u003C\u002Fcode> process is an independent conversation, saved as a transcript under \u003Ccode>~\u002F.claude\u002Fprojects\u003C\u002Fcode>. Nothing stops you from opening five terminals.\u003C\u002Fp>\n\u003Cp>Two things to know up front. First, sessions draw on the same plan limits, so five busy sessions use your 5-hour window faster than one (see \u003Ca href=\"\u002Fblog\u002Fclaude-code-usage-limits\">Claude Code usage limits\u003C\u002Fa>). The agent view docs say it directly: each session uses your subscription quota independently. Second, your attention is the real bottleneck. Three sessions you can follow; eight you cannot, unless you set things up so the screen tells you which one needs you.\u003C\u002Fp>\n\u003Ch2 id=\"how-do-you-keep-parallel-sessions-from-overwriting-each-other\">\u003Ca class=\"anchor\" href=\"#how-do-you-keep-parallel-sessions-from-overwriting-each-other\" aria-label=\"Link to this section\">#\u003C\u002Fa>How do you keep parallel sessions from overwriting each other?\u003C\u002Fh2>\n\u003Cp>Give each session its own files. Two sessions in one checkout share one working tree, and a \u003Ccode>git commit\u003C\u002Fcode> in one will include the other&#39;s half-done edits. The clean fix is a \u003Ca href=\"\u002Fblog\u002Fclaude-code-git-worktrees\">git worktree\u003C\u002Fa> per session:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"sh\">\u003Ccode>claude --worktree feature-auth\nclaude --worktree fix-login-bug   # in a second terminal\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Each gets \u003Ccode>.claude\u002Fworktrees\u002F&lt;name&gt;\u002F\u003C\u002Fcode> on its own branch. If you must share a checkout, split by area: one session in \u003Ccode>api\u002F\u003C\u002Fcode>, another in \u003Ccode>web\u002F\u003C\u002Fcode>, and neither touches the other&#39;s folder. Then commit often and review \u003Ccode>git status\u003C\u002Fcode> before every commit so you know what is whose.\u003C\u002Fp>\n\u003Cp>Research-only sessions (reading code, answering questions, drafting a plan in \u003Ca href=\"\u002Fblog\u002Fclaude-code-plan-mode\">plan mode\u003C\u002Fa>) do not edit anything and can share a checkout with anything.\u003C\u002Fp>\n\u003Ch2 id=\"how-do-you-name-and-find-a-session-later\">\u003Ca class=\"anchor\" href=\"#how-do-you-name-and-find-a-session-later\" aria-label=\"Link to this section\">#\u003C\u002Fa>How do you name and find a session later?\u003C\u002Fh2>\n\u003Cp>Unnamed sessions get a generated title from your first prompt, which is fine for one session and useless for six. Name them:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"sh\">\u003Ccode>claude -n auth-refactor          # at startup\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>or \u003Ccode>\u002Frename auth-refactor\u003C\u002Fcode> inside the session, or \u003Ccode>Ctrl+R\u003C\u002Fcode> on a row in the picker. Then come back by name:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"sh\">\u003Ccode>claude --resume auth-refactor    # resume directly\nclaude --resume                  # open the picker\nclaude --continue                # most recent session in this directory\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>In the picker, \u003Ccode>Space\u003C\u002Fcode> previews a session, \u003Ccode>Ctrl+B\u003C\u002Fcode> filters to the current git branch and \u003Ccode>Ctrl+W\u003C\u002Fcode> widens the list to every worktree of the repository. Naming a session after its branch is the cheapest habit in this article.\u003C\u002Fp>\n\u003Cp>One trap: if you resume the same session in two terminals at once, both write to one transcript and messages can go missing. Add \u003Ccode>--fork-session\u003C\u002Fcode> to each when you want two copies of a conversation. Inside a session, \u003Ccode>\u002Fbranch\u003C\u002Fcode> does the same: it copies the conversation so far and switches you to the copy.\u003C\u002Fp>\n\u003Ch2 id=\"what-are-background-sessions-and-agent-view\">\u003Ca class=\"anchor\" href=\"#what-are-background-sessions-and-agent-view\" aria-label=\"Link to this section\">#\u003C\u002Fa>What are background sessions and agent view?\u003C\u002Fh2>\n\u003Cp>Claude Code can run sessions without a terminal attached and show them on one screen. This is labelled a research preview in the docs, so shortcuts may change.\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"sh\">\u003Ccode>claude --bg &quot;investigate the flaky settings test&quot;   # start one in the background\nclaude agents                                       # one screen for all of them\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Inside a normal session, \u003Ccode>\u002Fbackground\u003C\u002Fcode> (or \u003Ccode>\u002Fbg\u003C\u002Fcode>) detaches it, and pressing \u003Ccode>←\u003C\u002Fcode> on an empty prompt opens agent view. Each row shows a state: working, needs input, idle, completed, failed or stopped. Select a row and press \u003Ccode>Space\u003C\u002Fcode> to peek at the question or the result, type to reply from the peek panel, press \u003Ccode>Enter\u003C\u002Fcode> to attach fully, and \u003Ccode>←\u003C\u002Fcode> to detach again. Detaching never stops a session. \u003Ccode>claude stop &lt;id&gt;\u003C\u002Fcode> does, and \u003Ccode>claude rm &lt;id&gt;\u003C\u002Fcode> removes it.\u003C\u002Fp>\n\u003Cp>Background sessions that edit files in a git repository move into a worktree first, so they do not write to your checkout. When their work is done in a worktree they commit and push the branch and may open a draft PR; the docs say they never push to \u003Ccode>main\u003C\u002Fcode> or \u003Ccode>master\u003C\u002Fcode>, force-push or merge. Also note that interactive sessions in other terminals do not appear in agent view until you background them.\u003C\u002Fp>\n\u003Ch2 id=\"how-do-you-know-which-session-is-waiting-for-you\">\u003Ca class=\"anchor\" href=\"#how-do-you-know-which-session-is-waiting-for-you\" aria-label=\"Link to this section\">#\u003C\u002Fa>How do you know which session is waiting for you?\u003C\u002Fh2>\n\u003Cp>This is the part terminals are bad at. Options, from cheap to thorough:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Terminal tab titles.\u003C\u002Fstrong> Agent view puts the number of sessions awaiting input in its tab title.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Notifications.\u003C\u002Fstrong> Claude Code \u003Ca href=\"\u002Fblog\u002Fclaude-code-hooks\">hooks\u003C\u002Fa> can run a script when a session needs attention, for example to send a desktop notification or play a sound.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Permission modes.\u003C\u002Fstrong> Fewer prompts mean fewer stalls. Reading the \u003Ca href=\"\u002Fblog\u002Fclaude-code-permission-modes\">permission modes\u003C\u002Fa> page is worth ten minutes if you run sessions in parallel; a session blocked on a harmless \u003Ccode>ls\u003C\u002Fcode> prompt is wasted time.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>A status habit.\u003C\u002Fstrong> End long prompts with &quot;when you finish, summarize what changed and what you could not verify&quot;. The summary is what you will read when you come back.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"what-is-a-sensible-limit\">\u003Ca class=\"anchor\" href=\"#what-is-a-sensible-limit\" aria-label=\"Link to this section\">#\u003C\u002Fa>What is a sensible limit?\u003C\u002Fh2>\n\u003Cp>Start with two or three sessions, each with a clear, separate task, and add a fourth only when you notice you are idle. A workable split:\u003C\u002Fp>\n\u003Cdiv class=\"table-wrap\">\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>Session\u003C\u002Fth>\u003Cth>Job\u003C\u002Fth>\u003Cth>Files\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>Feature\u003C\u002Ftd>\u003Ctd>The thing you are building\u003C\u002Ftd>\u003Ctd>Its own worktree\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Bug\u003C\u002Ftd>\u003Ctd>One small fix or investigation\u003C\u002Ftd>\u003Ctd>Its own worktree\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Questions\u003C\u002Ftd>\u003Ctd>Reading code, planning, explaining\u003C\u002Ftd>\u003Ctd>Shared, read-only\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cp>Close or \u003Ccode>\u002Fclear\u003C\u002Fcode> sessions you are done with. A session that has run for hours carries a long context and costs more per turn; see \u003Ca href=\"\u002Fblog\u002Fclaude-code-context-window\">the context window\u003C\u002Fa>.\u003C\u002Fp>\n\u003Ch2 id=\"in-relais\">\u003Ca class=\"anchor\" href=\"#in-relais\" aria-label=\"Link to this section\">#\u003C\u002Fa>In Relais\u003C\u002Fh2>\n\u003Cp>Relais is a desktop app built around exactly this problem. Sessions are real Claude Code sessions (\u003Ccode>claude --resume\u003C\u002Fcode> opens any of them), sorted by project in a sidebar. A row is blue while it runs, orange while it waits for you, green once its changes are pushed and red on an error. A &quot;Needs you&quot; list gathers what is waiting across every project, with a soft sound and a notification when a session finishes or asks something. A session can also get its own worktree and branch from a checkbox. Everything still counts toward your Claude plan&#39;s limits. See \u003Ca href=\"\u002Ffeatures\">features\u003C\u002Fa>.\u003C\u002Fp>\n",[15,18,21,24,27,30,33],{"id":16,"text":17},"can-you-run-several-claude-code-sessions-at-the-same-time","Can you run several Claude Code sessions at the same time?",{"id":19,"text":20},"how-do-you-keep-parallel-sessions-from-overwriting-each-other","How do you keep parallel sessions from overwriting each other?",{"id":22,"text":23},"how-do-you-name-and-find-a-session-later","How do you name and find a session later?",{"id":25,"text":26},"what-are-background-sessions-and-agent-view","What are background sessions and agent view?",{"id":28,"text":29},"how-do-you-know-which-session-is-waiting-for-you","How do you know which session is waiting for you?",{"id":31,"text":32},"what-is-a-sensible-limit","What is a sensible limit?",{"id":34,"text":35},"in-relais","In Relais",[37,42,47],{"slug":38,"title":39,"description":40,"category":7,"categoryId":8,"keyword":41,"date":10,"minutes":11},"claude-code-multi-repo-projects","Claude Code across several repositories: --add-dir and layouts","How to work with Claude Code on a project split across repos: launch from a parent folder, --add-dir, what config loads from extra folders, and commits.","claude code multiple repositories",{"slug":43,"title":44,"description":45,"category":7,"categoryId":8,"keyword":46,"date":10,"minutes":11},"claude-code-commit-and-pull-requests","Commit, push and open a pull request with Claude Code","How to have Claude Code write commit messages, push a branch and open a PR with gh: prompts that work, permission rules, attribution settings and checks.","claude code commit and pull request",{"slug":48,"title":49,"description":50,"category":7,"categoryId":8,"keyword":51,"date":10,"minutes":11},"claude-code-git-worktrees","Git worktrees with Claude Code: parallel features, no conflicts","Run Claude Code in a git worktree with one flag: separate branches, no stepping on each other's files. Setup, cleanup, base branches and the gotchas.","claude code git worktrees",1794931098788]