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 hsb3v0.1.7MITIn 1 marketplace
Put Claude Code's EnterWorktree and subagent worktrees under the project checkout-root instead of .claude/worktrees (a claude --worktree session stays native, and is flagged at session start): one hook creates them with native branch naming, base ref and .worktreeinclude copying, refuses a bad root or name loudly, and removes a clean agent worktree when the subagent stops. Opt-in per project. Release history: https://github.com/hsb3/dotfiles-agents/releases.
Run automatically on Claude Code events. Claude doesn't decide.
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.
Claude Code puts every worktree it creates (--worktree, EnterWorktree, subagent
isolation: worktree) under .claude/worktrees/, and its worktree.location setting is
not read by the CLI. This plugin owns EnterWorktree and subagent isolation: worktree
creation instead, so those worktrees land under the directory the project names as its
checkout-root in the atelier activation file.
Scope: a claude --worktree session worktree is created before plugin hooks load, so it
stays at the native location (measured on claude 2.1.281 and 2.1.289). With checkout-root
set, the plugin warns at SessionStart when a session starts inside one.
Opt-in per project. Installing it changes where EnterWorktree and subagent
isolation: worktree worktrees in that project are created, so enable it at project
scope, not user scope:
claude plugin install worktree-root@dotfiles-agents --scope project
or add it to the project's .claude/settings.json:
{ "enabledPlugins": { "worktree-root@dotfiles-agents": true } }
For an already installed plugin, claude plugin enable worktree-root@dotfiles-agents
turns it on. Then set the root in the activation file:
---
checkout-root: .worktrees
---
Without the key, worktrees keep the native .claude/worktrees/ placement.
flowchart TD
Ask[Session asks for a worktree] --> Create[worktree-root on WorktreeCreate]
Create --> Main[Resolve the main checkout]
Main --> Key{checkout-root set}
Key -->|yes, valid| Root[Root is that directory]
Key -->|no| Native[Root is .claude/worktrees]
Key -->|invalid| Fail[Creation fails with the reason]
Root --> Add[git worktree add, then copy .worktreeinclude files]
Native --> Add
Add --> Work[Agent works in the worktree]
Work --> Stop[worktree-root on SubagentStop]
Stop -->|clean, no unique commits| Gone[Worktree and branch removed]
Stop -->|dirty, new commits, or not hook-shaped| Kept[Worktree kept for review]
| Hook | Fires | Does |
|---|---|---|
worktree-root | WorktreeCreate, WorktreeRemove, SubagentStop, SessionStart | Creates worktrees under checkout-root with native branch naming, base ref and .worktreeinclude copying; removes them on ExitWorktree remove and after a clean subagent; warns when a session starts inside a native .claude/worktrees checkout while checkout-root is set, and in every session while checkout-root is invalid |
Once a WorktreeCreate hook owns creation, the harness skips its own .worktreeinclude
copy and keeps every agent worktree, so the hook restores both. Removal, after a
subagent or on ExitWorktree, touches only a worktree shaped like one this hook creates
(<root>/<name> on branch worktree-<name>) that has no uncommitted or untracked
change (untracked files count even under status.showUntrackedFiles=no), no
assume-unchanged or skip-worktree entry (either can hide an edit), and no commit other refs lack. Anything else is kept, and ExitWorktree reports
why. With the key set, a native .claude/worktrees path, such as one a claude --worktree session made, is also accepted for removal under the same checks.
A repo using --separate-git-dir, or a session inside a submodule, has no main checkout:
there the plugin keeps native placement under the toplevel's .claude/worktrees, and
refuses a checkout-root key.
Claude Code only. Like native creation it refreshes origin before branching when the
last fetch is over a day old, but it reads worktree.baseRef from settings files, so
--settings, --setting-sources and managed settings can make its base differ from
native. It does not handle worktree.symlinkDirectories or worktree.sparsePaths, does
not git-lock --worktree sessions, and a worktree under a checkout-root cannot be
re-entered with EnterWorktree by path. It does not clean up worktrees left behind by
--worktree sessions, which native creation keeps too. The hook README lists the rest.
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 hsb3/dotfiles-agents --plugin worktree-rootPlugins from other owners that cover similar ground