Parallel sessions, worktrees, and agent coordination for getting more done at once.
Git worktrees give each session its own working directory, so parallel sessions do not step on each other's file changes.
claude --worktree feature-auth
claude --worktree feature-paymentsEach session works in a separate worktree on its own branch. They can run simultaneously without conflicts.
Split work across two sessions: one writes code, the other reviews it. This catches issues the writing session might miss because it is too focused on implementation.
Session 1 (writer):
claude -n writer
# implement the featureSession 2 (reviewer):
claude -n reviewer
# Review the changes in the writer worktree. Focus on security, error handling, and test coverage.Use claude -p (non-interactive, one-shot mode) in a shell loop to process many files independently and in parallel.
for file in src/api/*.ts; do
claude -p "add JSDoc comments to all exported functions in $file" &
done
waitEach invocation is independent. Run them in the background with & and wait to parallelize.
When running automated Claude sessions in scripts, restrict which tools they can use to prevent unintended side effects.
claude -p "summarize the API surface" --allowedTools "Read,Glob,Grep"This gives read-only access. The session can explore but cannot write, edit, or run shell commands.
The Claude Code Desktop app shows all active sessions in a sidebar. You can switch between them, see their status, and review their outputs without managing multiple terminal windows. Useful when running three or more parallel sessions.
See claude-code-docs/desktop.md for setup.
For complex multi-agent workflows, use the agent teams feature. Define a coordinator and a set of specialized workers. The coordinator assigns tasks and assembles results.
See claude-code-docs/agent-teams.md for the configuration format and examples.
When you want to explore two different approaches to the same problem simultaneously, give each approach its own worktree.
claude --worktree approach-a
claude --worktree approach-bCompare the results and merge whichever approach worked better. No need to stash or commit intermediate work.
Named sessions are easier to manage when you have several running at once. The name appears in the Desktop app sidebar and in --continue completion.
claude -n db-migration
claude -n frontend-polish
claude -n perf-investigationResume any of them by name:
claude --continue db-migrationIf you previously worked on a pull request in Claude Code, you can resume that session in the context of the PR using --from-pr. This restores the relevant context for the PR without needing to re-describe it.
claude --from-pr 342Useful for returning to code review or follow-up work on a PR after a break.