Worktree Manager Skill
Create, list, and remove git worktrees with a single command, automatically provisioning isolated ports, databases, and config for parallel development.
Full-lifecycle git worktree management (create/remove/list), explicitly excludes scenarios where it shouldn't trigger (e.g. user wants raw git commands).
What does this skill do, and when should you use it?
This is an Agent Skill bundled at .claude/skills/worktree-manager-skill inside disler/claude-code-hooks-multi-agent-observability, providing complete git worktree lifecycle management. It wraps worktree creation, listing, and removal into three slash commands, automatically handling port uniqueness, environment configuration, and operation validation so you never manage raw git worktree commands by hand. The skill explicitly depends on Claude Code's slash-command mechanism (SlashCommand is declared in its frontmatter), so porting it to other agent platforms requires adaptation. It fits developers who already use Claude Code and regularly juggle multiple parallel development environments.
The skill manages three worktree operations: /create_worktree <branch-name> [port-offset] spins up a new parallel development environment; /list_worktrees shows all worktrees and their status; /remove_worktree <branch-name> deletes a worktree. Creation automatically provisions isolated ports, databases, and configuration while guaranteeing port uniqueness; removal cleans up automatically. It executes via the Bash, Read, Write, Edit, Glob, and Grep tools, and its documentation explicitly forbids manual git commands, manual port configuration, or direct directory deletion — everything must go through the slash commands to get validation and error handling.
- A developer running several feature branches in parallel who needs each branch to have its own isolated ports and database
- An engineer debugging bugs across multiple branches at once, using /list_worktrees to see all existing worktrees and their status
- After merging or abandoning a feature, removing the corresponding worktree and its configuration with a single /remove_worktree call
- A new team member wanting to try multi-environment parallel development without memorizing git worktree flags and port setup
- Anyone needing a temporary environment on a branch for verification or a demo, avoiding port conflicts and missed config steps
What are this skill's strengths and limitations?
- Wraps the full create/list/remove worktree lifecycle into three commands with a keyword decision tree, making intent matching unambiguous
- Automatically handles port uniqueness, isolated ports/databases/config on creation, and proper cleanup on removal
- Ships with operations, examples, troubleshooting, and reference docs
- Clearly defines in-scope vs out-of-scope usage, avoiding conflicts with manual git workflows
- Depends on Claude Code-specific slash commands and the SlashCommand tool; not directly usable on other agent platforms
- Repository license is listed as unknown, so commercial use needs independent verification
- The skill is one of 4 bundled in a repo whose README focuses on an observability system; the skill's standalone maturity and test coverage are not documented in the source
- The exact implementation of database/config isolation during worktree creation is not detailed in the documentation
How do you install this skill?
This skill is one of 4 skills bundled in the disler/claude-code-hooks-multi-agent-observability repository. Per the repo's general instructions, copy the .claude directory to your project root: cp -R .claude /path/to/your/project/. The skill lives at .claude/skills/worktree-manager-skill/. The repo does not document a minimal install for this skill alone; copying just the skills subdirectory into your project's .claude/skills/ is the plausible minimal approach but is not explicitly confirmed by the source.
How do you use this skill?
Trigger it with natural language in Claude Code: "create a worktree for feature-x with port offset 1" maps to /create_worktree feature-x 1; "list all worktrees" maps to /list_worktrees; "remove the feature-x worktree" maps to /remove_worktree feature-x. The skill ships with OPERATIONS.md, EXAMPLES.md, TROUBLESHOOTING.md, and REFERENCE.md for detailed steps and troubleshooting. Do not ask Claude to run raw git worktree commands — the skill explicitly lists that as an out-of-scope use.