Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By LeeJuOhv3.2.3MITIn 1 marketplace
Set up gitignored files like .env in each new Claude Code worktree and block cleanup that would lose unpushed work. Needs jq installed; hooks auto-configure settings.json on first session start.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Set up local files in each Claude Code worktree and check for unfinished work before cleanup.
A separate worktree lets another session edit a branch while you keep working. If the app needs a gitignored .env, the new checkout alone is not enough to start it. List files to copy in .worktreeinclude and large directories to share in .worktreelink.
When you remove the worktree, the hook checks for uncommitted changes and untracked files. For a branch with an upstream, it also checks for commits you have yet to push. If the branch has no upstream, cleanup keeps the branch.
| Feature | Behavior |
|---|---|
| Branch base | HEAD (configurable via worktreeplus.baseBranch) |
| Worktree path | Configurable via worktreeplus.dirBase |
| Remote tracking | --guess-remote support (respects worktree.guessRemote) |
| Branch prefix | Configurable via worktreeplus.branchPrefix |
| Gitignored files | .worktreeinclude copy / .worktreelink symlink |
| Re-entry behavior | Reuses existing worktree (idempotent) |
| Audit trail | Per-worktree .worktree.log with the create event, base branch, include/link outcomes, and BLOCKED reasons |
| Cleanup protection | Blocks removal if uncommitted changes, untracked files, or unpushed commits; only deletes branches with upstream |
| Setup help | Bundled /worktree-setup skill: view/set/reset settings, and scan your gitignored files to build .worktreeinclude / .worktreelink |
brew install jq)/plugin install worktree-plus@claude-code-zero
Start a new Claude Code session after install. On first session start, hooks are auto-configured in your settings.json (local or global — chosen based on where the plugin is enabled) and the SessionStart message summarizes what was injected. No manual setup needed.
All worktree entry points are enhanced:
claude -w # startup with worktree
claude -w my-feature # named worktree
Mid-session, ask Claude to "create a worktree" — it uses EnterWorktree which triggers the same hooks. Subagents with isolation: "worktree" also benefit.
When a worktree is removed through the hook, worktree-plus blocks removal if the worktree has staged or unstaged changes, untracked files, or commits not pushed to upstream. Branches without an upstream are preserved on removal — only the worktree directory is cleaned up. If git worktree remove fails, the directory is left untouched.
Don't hand-write these from scratch — run /worktree-setup and it scans what your repo actually ignores, proposes a copy/link split with the reasoning for each call, and writes the files once you approve. It merges into existing files rather than overwriting them, so your own entries and comments survive.
Both files take one literal path per line, relative to the repo root. They look like .gitignore but aren't pattern files: .env* is read as a filename, not a glob, and # only starts a comment at the beginning of a line.
.worktreeinclude — files to copy (independent per worktree):
.env
config/secrets.yaml
notes/local-todo.md
.worktreelink — directories to symlink (shared across worktrees, zero disk overhead):
models/
assets/media/
references/
Good .worktreelink candidates are large, branch-invariant gitignored directories that are safe to share: downloaded assets and datasets, content-addressed caches, read-only vendored repos.
Don't link node_modules/, .venv/, or any per-branch dependency state. A symlink makes every worktree share one copy, so an install in one worktree silently mutates the others when two branches need different dependencies. Those belong in .worktreeinclude (copy) — or just reinstall them per worktree, since the git-tracked manifest (package.json, requirements.txt) is already checked out. Git-tracked directories are checked out into each worktree automatically — don't link them either.
All settings live in git config. Use --local for this repo only (default) or --global for all your repos.
Plugin extensions (worktree-plus adds these):
| Key | Default | Example |
|---|---|---|
worktreeplus.baseBranch | HEAD | git config worktreeplus.baseBranch develop |
worktreeplus.branchPrefix | worktree- | git config worktreeplus.branchPrefix "feat-" (literal — include your own separator) |
worktreeplus.dirBase | .claude/worktrees | git config worktreeplus.dirBase ".worktrees" (relative to repo root, or absolute) |
Git native (standard git-worktree config):
| Key | worktree-plus default | Git default |
|---|---|---|
worktree.guessRemote | true (auto-track matching remote branches) | false |
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub leejuoh/claude-code-zero --plugin worktree-plusPlugins from other owners that cover similar ground