Skip to content

Worktree Commands

Git worktrees allow parallel development on multiple branches simultaneously.

Worktrees are created in a standardized location relative to your main repository:

<repo-parent>/<repo-name>-worktrees/<feature>/

Example:

If your main repository is at /Users/you/projects/myapp, worktrees will be created at:

/Users/you/projects/myapp-worktrees/feature-auth/
/Users/you/projects/myapp-worktrees/bugfix-123/
/Users/you/projects/myapp-worktrees/experiment/

This structure keeps worktrees organized and separate from your main repository while maintaining a predictable location.


List worktrees for the current repository (default).

Terminal window
scc worktree

Supports the same options as scc worktree list (e.g., -i, -v).


Create a new worktree for parallel development.

Terminal window
scc worktree create <WORKSPACE> <NAME> [OPTIONS]

Arguments:

ArgumentDescription
WORKSPACEPath to the main repository
NAMEName for the worktree/feature

Options:

OptionDescription
-b, --base BRANCHBase branch (default: current)
--start / --no-startStart Claude after creating (default: --start)
--install-depsInstall dependencies after creating

Examples:

Terminal window
# Create worktree and start session
scc worktree create ~/project feature-auth
# Create from specific branch
scc worktree create ~/project bugfix-123 --base main
# Create without starting Claude
scc worktree create ~/project experiment --no-start

List all worktrees for a repository.

Terminal window
scc worktree list [WORKSPACE] [OPTIONS]

Options:

OptionDescription
-i, --interactiveSelect a worktree to work with
-v, --verboseShow git status
--jsonOutput as JSON
--prettyPretty-print JSON output

Verbose status indicators:

SymbolMeaning
+NN staged files
!NN modified files
?NN untracked files
.Clean worktree
Status timed out

Examples:

Terminal window
# List worktrees
scc worktree list
# List with git status
scc worktree list -v
# Interactive picker
scc worktree list -i

Enter a worktree in a new subshell.

Terminal window
scc worktree enter [TARGET] [OPTIONS]

Arguments:

ArgumentDescription
TARGETWorktree name, - (previous), ^ (main), or fuzzy match

Options:

OptionDescription
-w, --workspace PATHRepository path (default: current)

Examples:

Terminal window
# Enter by name
scc worktree enter feature-auth
# Enter main branch worktree
scc worktree enter ^
# Enter previous worktree
scc worktree enter -
# Type 'exit' to return

Switch to a worktree (outputs path for shell wrapper).

Terminal window
scc worktree switch [TARGET] [OPTIONS]

Arguments:

ArgumentDescription
TARGETWorktree name, - (previous), ^ (main), or fuzzy match

Options:

OptionDescription
-w, --workspace PATHRepository path (default: current)

Shell wrapper (add to ~/.bashrc or ~/.zshrc):

Terminal window
wt() {
local p
p="$(scc worktree switch "$@")" || return $?
cd "$p" || return 1
}

Then use:

Terminal window
wt feature-auth # Switch to feature-auth
wt - # Switch to previous
wt ^ # Switch to main

Interactive worktree picker.

Terminal window
scc worktree select [WORKSPACE] [OPTIONS]

Options:

OptionDescription
-b, --branchesInclude branches without worktrees

Remove a worktree.

Terminal window
scc worktree remove <WORKSPACE> <NAME> [OPTIONS]

Arguments:

ArgumentDescription
WORKSPACEPath to the main repository
NAMEName of the worktree to remove

Options:

OptionDescription
-f, --forceForce removal with uncommitted changes
-y, --yesSkip confirmation
--dry-runPreview what would be removed

Clean stale worktree entries from git.

Terminal window
scc worktree prune [WORKSPACE] [OPTIONS]

Options:

OptionDescription
-n, --dry-runPreview what would be pruned

Examples:

Terminal window
# Preview what would be pruned
scc worktree prune -n
# Actually prune stale entries
scc worktree prune