By thomast8
Create git worktrees from PR numbers / branch names / a live picker (your open PRs and PRs needing your review), and reclaim worktree branches back into main. Graphite-aware. Bundles WorktreeCreate/WorktreeRemove hooks so the session's project directory follows the worktree.
Move a worktree's branch into the main checkout so you can test it there. Removes the worktree as a side-effect (git needs the branch freed up before it can be checked out in main). Defaults to the current worktree when invoked from inside one. Takes an optional PR number, branch name, or worktree path to pick a specific worktree. Use when the user says '/unworktree', '/unworktree 123', '/unworktree feature/foo', or 'pull this branch into main so I can test it'.
Create a git worktree or switch checkout for a PR number, branch name, or an interactively picked 'live' branch (your open PRs + PRs needing your review, Graphite-aware). Worktree mode pulls latest from remote and copies gitignored dev files so the new tree is immediately runnable. Use when the user says '/worktree', '/worktree 123', '/worktree feature/my-branch', or wants to hop onto an existing PR without losing their current checkout.
A one-plugin Claude Code marketplace for /worktree and /unworktree.
/worktree — create a git worktree (or switch checkout) for a PR number, branch name, or an interactively-picked PR from the "needs my review" + "mine" buckets. Graphite-aware. Pulls latest and copies gitignored dev files into the new worktree so it's immediately runnable./unworktree — reclaim a worktree's branch back into the main checkout so you can test it there. Removes the worktree as a side-effect. Auto-stashes worktree work and pops it onto the branch in main.WorktreeCreate hook — enforces <type>/<slug> branch naming, checks out existing local/remote branches instead of silently making a new one, and cuts new branches from origin/<default>.WorktreeRemove hook — info-only logger.Both commands use Claude Code's native EnterWorktree / ExitWorktree tools, so the session's project directory follows the worktree and the desktop app's bottom bar follows along. No manual cd gymnastics.
/plugin marketplace add https://github.com/thomast8/claude-worktree-toolkit.git
/plugin install worktree-toolkit@claude-worktree-toolkit
The plugin bundles its hooks, so there's nothing to paste into settings.json.
You're mid-feature. A teammate asks you to review PR #412. You don't want to stash or lose your env setup.
you: /worktree 412
Claude resolves #412 to its head branch, asks "Open as worktree or Switch checkout?", you pick Open as worktree, and the session lands in <repo>/.claude/worktrees/<safe-branch>/ with your .env files already copied. The desktop app's bottom bar follows along. Your original feature branch in main is untouched.
Skip the PR lookup when you know the branch.
you: /worktree feature/db-recreate
The WorktreeCreate hook:
origin/main as a last resort (and tells you it did).you: /worktree
You get up to 4 options: the 2 oldest PRs waiting on your review + your 2 most recent open PRs. Plus an Other… free-text option for a branch name or PR number. Pre-prompt summary: "Pulled 9 live PRs (3 needs-review, 6 mine). Pick one:"
Main checkouts often have a venv, cached artifacts, or running services that the worktree doesn't. From inside the worktree session:
you: /unworktree
Auto-detects the current worktree, stashes any work, removes the worktree dir, checks out the branch in main, pops the stash. The branch itself is preserved — only the worktree working-tree directory is removed. You can recreate it anytime with /worktree <branch>.
Fast path when the current branch is clean and you really do want to context-switch in place:
you: /worktree feature/quick-hotfix
→ pick "Switch checkout"
Claude runs gt checkout (Graphite) or git checkout (plain). If your tree is dirty, it asks to stash first.
By default, worktrees get .env .env.local .env.*.local .envrc copied from main. Override per-repo:
# <repo>/.claude/worktree.conf
WORKTREE_COPY_GLOBS=".env .env.local .env.test .envrc direnv/envrc"
Don't add node_modules, .venv, build artifacts — run your setup commands inside the new worktree instead.
Full walkthrough with troubleshooting table and explicit non-goals: plugins/worktree-toolkit/USER_GUIDE.md.
git — obviouslygh — GitHub CLI, authenticated (gh auth status should report logged in)jq — JSON parsing in the scriptsgt (Graphite) — optional, auto-detected; without it the Graphite paths are skippedBranch naming enforced by the WorktreeCreate hook: <type>/<slug> where type is one of feat, feature, fix, chore, docs, refactor, test, ci, build, perf, hotfix, release, revert, codex; slug is lowercase kebab-case.
/plugin uninstall worktree-toolkit@claude-worktree-toolkit
/plugin marketplace remove claude-worktree-toolkit
Uninstalling the plugin removes its hooks — nothing lingers in your settings.json.
MIT. See LICENSE. Use it freely, modify it freely, no warranty.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub thomast8/claude-worktree-toolkit --plugin worktree-toolkitRank a repo's active contributors by their current capacity to review a new PR. Defaults to the current branch's PR; accepts a PR number or --repo-only. Scoring is min(load, fitness) where fitness blends familiarity with the changed files, breadth across the repo, and in-repo review engagement.
Synchronous Haiku-generated kebab-case session titles, emitted via hookSpecificOutput.sessionTitle on the first prompt of each Claude Code session. One-shot per session, recursion-safe, 20s timeout with a slugified-prompt fallback.
Negotiate a code or plan review to convergence between Claude and Codex via a shared MCP scratchpad, or get a quick single-shot second opinion from Codex, including mid-planning.
Ultra-compressed communication mode. Cuts 65% of output tokens (measured) while keeping full technical accuracy by speaking like a caveman.
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.