The cniska-worktree plugin, in the cniska marketplace, sends Claude Code's own worktrees through agent-worktree.
- Whenever a session starts, resumes, clears or compacts, it adds a short note,
plugin/hooks/note.md, telling the agent to create worktrees withcreateand remove them withremove. - Its
WorktreeCreateandWorktreeRemovehooks send EnterWorktree and a subagent's worktree isolation through the same commands.
Claude Code's ExitWorktree refuses action: "remove" on every worktree a hook created, clean or not (anthropics/claude-code#100761). The note therefore tells the agent to exit with keep and remove with agent-worktree remove, which keeps the dirty-tree refusal that discard_changes: true would bypass.
The plugin brings neither Bun nor the CLI. Install the CLI first, as the README says: with the plugin installed and no CLI on PATH, every Claude Code worktree fails to create. Run agent-worktree doctor under the PATH Claude Code starts with to check it.
To keep the plugin out of a project's shared settings, enable it only in your clone, as Only in your clone says.