Worktree Commands
Git worktrees allow parallel development on multiple branches simultaneously.
Worktree Location
Section titled “Worktree Location”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.
scc worktree
Section titled “scc worktree”List worktrees for the current repository (default).
scc worktreeSupports the same options as scc worktree list (e.g., -i, -v).
scc worktree create
Section titled “scc worktree create”Create a new worktree for parallel development.
scc worktree create <WORKSPACE> <NAME> [OPTIONS]Arguments:
| Argument | Description |
|---|---|
WORKSPACE | Path to the main repository |
NAME | Name for the worktree/feature |
Options:
| Option | Description |
|---|---|
-b, --base BRANCH | Base branch (default: current) |
--start / --no-start | Start Claude after creating (default: --start) |
--install-deps | Install dependencies after creating |
Examples:
# Create worktree and start sessionscc worktree create ~/project feature-auth
# Create from specific branchscc worktree create ~/project bugfix-123 --base main
# Create without starting Claudescc worktree create ~/project experiment --no-startscc worktree list
Section titled “scc worktree list”List all worktrees for a repository.
scc worktree list [WORKSPACE] [OPTIONS]Options:
| Option | Description |
|---|---|
-i, --interactive | Select a worktree to work with |
-v, --verbose | Show git status |
--json | Output as JSON |
--pretty | Pretty-print JSON output |
Verbose status indicators:
| Symbol | Meaning |
|---|---|
+N | N staged files |
!N | N modified files |
?N | N untracked files |
. | Clean worktree |
… | Status timed out |
Examples:
# List worktreesscc worktree list
# List with git statusscc worktree list -v
# Interactive pickerscc worktree list -iscc worktree enter
Section titled “scc worktree enter”Enter a worktree in a new subshell.
scc worktree enter [TARGET] [OPTIONS]Arguments:
| Argument | Description |
|---|---|
TARGET | Worktree name, - (previous), ^ (main), or fuzzy match |
Options:
| Option | Description |
|---|---|
-w, --workspace PATH | Repository path (default: current) |
Examples:
# Enter by namescc worktree enter feature-auth
# Enter main branch worktreescc worktree enter ^
# Enter previous worktreescc worktree enter -
# Type 'exit' to returnscc worktree switch
Section titled “scc worktree switch”Switch to a worktree (outputs path for shell wrapper).
scc worktree switch [TARGET] [OPTIONS]Arguments:
| Argument | Description |
|---|---|
TARGET | Worktree name, - (previous), ^ (main), or fuzzy match |
Options:
| Option | Description |
|---|---|
-w, --workspace PATH | Repository path (default: current) |
Shell wrapper (add to ~/.bashrc or ~/.zshrc):
wt() { local p p="$(scc worktree switch "$@")" || return $? cd "$p" || return 1}Then use:
wt feature-auth # Switch to feature-authwt - # Switch to previouswt ^ # Switch to mainscc worktree select
Section titled “scc worktree select”Interactive worktree picker.
scc worktree select [WORKSPACE] [OPTIONS]Options:
| Option | Description |
|---|---|
-b, --branches | Include branches without worktrees |
scc worktree remove
Section titled “scc worktree remove”Remove a worktree.
scc worktree remove <WORKSPACE> <NAME> [OPTIONS]Arguments:
| Argument | Description |
|---|---|
WORKSPACE | Path to the main repository |
NAME | Name of the worktree to remove |
Options:
| Option | Description |
|---|---|
-f, --force | Force removal with uncommitted changes |
-y, --yes | Skip confirmation |
--dry-run | Preview what would be removed |
scc worktree prune
Section titled “scc worktree prune”Clean stale worktree entries from git.
scc worktree prune [WORKSPACE] [OPTIONS]Options:
| Option | Description |
|---|---|
-n, --dry-run | Preview what would be pruned |
Examples:
# Preview what would be prunedscc worktree prune -n
# Actually prune stale entriesscc worktree prune