Create git worktrees in .worktrees/ for working on different branches without touching current working directory...
This skill creates git worktrees in a standardized .worktrees/ directory structure, enabling work on multiple branches simultaneously without stashing or committing current changes. Each worktree is created in .worktrees/<branch-name> for easy organization and discovery.
Use this skill when the user needs to:
The skill uses a bash script (scripts/create_worktree.sh) that:
/ with -) for use as a directory namegit fetch --all to ensure remote branches are up-to-dateorigin or prompts user to select.worktrees/ directory if it doesn't exist.worktrees/<sanitized-branch-name>To create a worktree for a branch, run:
scripts/create_worktree.sh <branch-name>
Arguments:
<branch-name>: Name of the branch (can be local or remote)Examples:
# Create worktree for a local branch
scripts/create_worktree.sh feature/new-feature
# Create worktree for a remote branch
scripts/create_worktree.sh hotfix/urgent-fix
# Branch names with slashes are automatically sanitized
# Branch: user.name/AOF-123 ā Worktree: .worktrees/user.name-AOF-123
scripts/create_worktree.sh user.name/AOF-123
The script will error if:
.worktrees/<branch-name>The script ensures Claude configuration is available in the worktree:
This ensures a consistent Claude setup across all worktrees.
All worktrees are created in the .worktrees/ directory at the repository root:
repo-root/
āāā .worktrees/
ā āāā feature-branch/ # Worktree for feature-branch
ā āāā hotfix-123/ # Worktree for hotfix-123
ā āāā user.name-AOF-456/ # Worktree for user.name/AOF-456 (sanitized)
ā āāā bugfix-fix-critical-issue/ # Worktree for bugfix/fix-critical-issue (sanitized)
āāā .git/
āāā [main working directory files]
This convention keeps all temporary worktrees organized and easy to find.
Note: Branch names containing slashes (/) are automatically sanitized by replacing slashes with hyphens (-) to avoid nested directory structures. The script will inform you when sanitization occurs.