worktree-kit
Manage git worktrees (create/list/switch/cleanup) and copy .env files. Use for parallel feature work, isolated review, clean workspace, or when user mentions worktrees.
When & Why to Use This Skill
The Worktree Kit is a specialized Claude skill designed to optimize Git workflows by automating the management of git worktrees. It allows developers to maintain multiple isolated working directories for the same repository, enabling seamless context switching between features, bug fixes, and code reviews. By automating worktree creation, cleanup, and environment file synchronization, it eliminates the friction of stashing changes or frequent branch switching, significantly boosting developer productivity and workspace organization.
Use Cases
- Parallel Feature Development: Work on multiple independent features simultaneously in separate directories without the need to commit unfinished work or use git stash.
- Isolated Code Reviews: Quickly check out a pull request into a dedicated worktree to run tests and perform reviews without disturbing your current active development branch.
- Environment Configuration Sync: Automatically copy .env files to new worktrees to ensure local environment variables and secrets are consistently available across all active workspaces.
- Workspace Maintenance: Efficiently list and clean up temporary worktrees to reclaim disk space and maintain a tidy project structure after completing short-term tasks.
| name | worktree-kit |
|---|---|
| description | Manage git worktrees (create/list/switch/cleanup) and copy .env files. Use for parallel feature work, isolated review, clean workspace, or when user mentions worktrees. |
Worktree kit
Use the manager script for all worktree actions.
bash ${CLAUDE_PLUGIN_ROOT}/skills/worktree-kit/scripts/worktree.sh <command> [args]
Commands:
create <name> [base]listswitch <name>(prints path)cleanupcopy-env <name>
Safety notes:
createdoes not change the current branchcleanupdoes not force-remove worktrees and does not delete branchescleanupdeletes the worktree directory (including ignored files); removal fails if the worktree is not clean.env*is copied with no overwrite (symlinks skipped)- refuses to operate if
.worktrees/or any worktree path component is a symlink copy-envonly targets registered worktreesoriginfetch is optional; local base refs are allowed- fetch from
originonly when base looks like a branch - Worktrees live under
.worktrees/