From whetstone
Manages Git worktrees for isolated parallel development, including creation, listing, switching, and cleanup with environment cloning and dependency installation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/whetstone:ia-git-worktreeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**GATE: If the task runs inside an existing worktree (a worktree path is given and no create/remove/switch is requested), none of the creation flow applies — work in place and skip this skill.** To check: `git rev-parse --show-toplevel` appears as a linked entry in `git worktree list`.
GATE: If the task runs inside an existing worktree (a worktree path is given and no create/remove/switch is requested), none of the creation flow applies — work in place and skip this skill. To check: git rev-parse --show-toplevel appears as a linked entry in git worktree list.
Never call git worktree add directly -- always use the worktree-manager.sh script.
The script handles critical setup that raw git commands don't:
.env, .env.local, .env.test, etc. from main repo.worktrees is in .gitignorepackage.json → npm install, composer.json → composer install, pyproject.toml → pip install -e ., go.mod → go mod downloadAll commands use: bash ${CLAUDE_PLUGIN_ROOT}/skills/ia-git-worktree/scripts/worktree-manager.sh <command>. If CLAUDE_PLUGIN_ROOT is unset (non-Claude-Code harness), resolve the script relative to this skill's own directory.
The manager script branches from a fresh origin/<base>; if the prompt is unanswered it defaults to origin/<base> and lists unpushed commits in its output — report them in the change summary. Details: troubleshooting.md.
| Command | Description | Example |
|---|---|---|
create <branch> [from] | Create worktree + branch (default: from main) | ...worktree-manager.sh create feature-login |
list / ls | List all worktrees with status | ...worktree-manager.sh list |
switch <name> / go | Switch to existing worktree | ...worktree-manager.sh switch feature-login |
copy-env <name> | Copy .env files to existing worktree | ...worktree-manager.sh copy-env feature-login |
cleanup / clean | Interactively remove inactive worktrees | ...worktree-manager.sh cleanup |
After cleanup, run git worktree prune to remove any orphaned worktree metadata from manually deleted directories.
Before creating a worktree, verify the worktree directory is gitignored:
# Verify .worktrees is ignored (should output ".worktrees")
git check-ignore .worktrees || echo "WARNING: .worktrees not in .gitignore"
If not ignored, add it to .gitignore before proceeding.
After creating a worktree, run the project's test suite (or the fastest relevant subset if the full suite exceeds a few minutes) to establish a clean baseline. Pre-existing failures in the worktree should be caught before starting new work -- not discovered mid-implementation.
Before creating worktrees, detect the execution context:
$CODEX_SANDBOX is set or the repo is at a non-standard path (e.g., /tmp/, /workspace/), worktrees may not be supported. Fall back to regular branch switching.git rev-parse --is-bare-repository returns true, worktrees are the only way to have a working directory. Adjust paths accordingly.Adapt the workflow to the detected context rather than failing with a generic error.
/ia-reviewselect:AskUserQuestion if not loaded) or request_user_input (Codex); fall back to numbered options in chat. Options: 1) review in a new worktree 2) switch branch in place/ia-workAlways offer choice:
When work in a worktree is done, verify tests pass, then present exactly 4 options. Ask via AskUserQuestion (Claude Code; load with ToolSearch select:AskUserQuestion if not loaded) or request_user_input (Codex); fall back to numbered options in chat.
gh pr create, keep worktree until mergedWhen completing work in a worktree (before merge or PR), output a structured summary:
CHANGES MADE:
- src/routes/tasks.ts: Added validation middleware
THINGS I DIDN'T TOUCH (intentionally):
- src/routes/auth.ts: Has similar validation gap but out of scope
POTENTIAL CONCERNS:
- The Zod schema is strict -- rejects extra fields. Confirm this is desired.
The "DIDN'T TOUCH" section prevents reviewers from wondering whether adjacent issues were missed or intentionally deferred.
Before writing any git hook, check git config core.hooksPath — Husky repos ignore .git/hooks/ entirely. Personal tooling excludes go in $(git rev-parse --git-path info/exclude), never the tracked .gitignore. Details: hooks-and-excludes.md
git worktree list shows the new entry.worktrees directory confirmed in .gitignorenpx claudepluginhub iliaal/whetstone --plugin whetstoneManage Git worktrees for isolated parallel development. Automates creation, switching, and cleanup with .env copying and .gitignore management. Useful for code reviews and feature work.
This skill manages Git worktrees for isolated parallel development. It handles creating, listing, switching, and cleaning up worktrees with a simple interactive interface, following KISS principles.
Manages Git worktrees for isolated parallel development, handling creation, listing, switching, and cleanup with interactive confirmations. Useful for code review isolation and parallel feature work.