Parallel Worktrees enables zero dead time in your coding workflow. While one session runs tests, compiles code, or explores approaches, work on something else in a parallel worktree.
Zero dead time. While one Claude thinks, work on something else.
# Create isolated worktree and start sessionclaude -w# Claude Code auto-creates, manages, and cleans up the worktree# Each session gets its own isolated working copy
Key features (Claude Code-specific):
claude -w auto-creates and cleans up worktrees
Subagents support isolation: worktree in agent frontmatter
Ctrl+F kills all background agents (two-press confirmation)
# Manually create worktreesgit worktree add ../project-feat feature-branchgit worktree add ../project-fix bugfix-branch# Open each worktree in a separate editor windowcode ../project-featcode ../project-fix
Both approaches create isolated working copies where changes don’t interfere with your main session.
# Remove specific worktreegit worktree remove ../project-feat# Force remove (even with uncommitted changes)git worktree remove ../project-feat --force# Clean up stale referencesgit worktree prune
# Claude Code handles everythingclaude -w# Behind the scenes:# 1. Creates worktree in temp location# 2. Checks out current or new branch# 3. Opens session in worktree# 4. Cleans up on exit
# Send current task to backgroundCtrl+B# Kill all background agentsCtrl+F # Press twice to confirm# Background agents appear in session listclaude sessions
# Terminal 1: Main session$ npm test# ... tests running (2 minutes) ...# Terminal 2: Create worktree for parallel work$ git worktree add ../project-feat -b feat/new-endpointPreparing worktree (new branch 'feat/new-endpoint')HEAD is now at a3f5c21 feat: add user auth$ cd ../project-feat$ claudeClaude: What should we work on?User: Implement the new API endpoint for user preferencesClaude: [Implements feature while tests run in main session]# Terminal 1: Tests complete✓ All tests passed# Return to main session, handle test results# Worktree session continues independently
# Terminal 1: Review PR in read-only worktree$ git worktree add ../project-review pr-branch$ cd ../project-review$ claudeClaude: Reviewing PR changes in read-only mode...# Terminal 2: Continue development on main branch$ cd ~/project$ claudeClaude: Implementing new feature...# Both sessions work independently
# Main session working on feature$ cd ~/project# ... feature development in progress ...# Urgent bug report comes in$ git worktree add ../project-hotfix -b hotfix/critical-bug main$ cd ../project-hotfix$ claudeUser: Fix the critical authentication bugClaude: [Fixes bug, tests, commits]$ git push origin hotfix/critical-bug# Create PR for immediate merge# Return to main session, continue feature work$ cd ~/project
Can’t Create Worktree - Branch Already Checked Out
# Error: 'feature-branch' is already checked out at '/Users/you/project'# Solution: Use a different branch or create new branchgit worktree add ../project-feat -b feature-branch-2
---name: scoutdescription: PROACTIVELY explore codebase when confidence is lowtools: ["Read", "Glob", "Grep"]background: trueisolation: worktreemodel: haiku---You are a scout agent. Explore the codebase to:1. Find similar patterns2. Identify relevant files3. Score confidence (0-100)4. Report back with findingsNever make changes. Read-only exploration.