Git Worktree Parallel Environment Skill
Spin up fully isolated git worktrees — separate ports, databases, and config — so parallel branch environments run side by side without conflicts.
Creates isolated git worktrees (with independent port/database config), explicitly scoped to trigger only when the user explicitly asks for a skill to create one — avoids accidental triggering.
What does this skill do, and when should you use it?
This is one of four skills bundled in the disler/claude-code-hooks-multi-agent-observability repository, located at .claude/skills/create-worktree-skill/. It is a thin wrapper: Claude Code's SlashCommand tool invokes the repo's own /create_worktree_prompt slash command, which creates a git worktree under trees/<branch-name>, assigns non-conflicting ports, writes environment files, installs dependencies, and starts services. The skill deliberately restricts its trigger: it should fire only when the user explicitly asks to use a skill to create a worktree. It depends on the companion slash command and the bun runtime, so it does not work outside the repo's .claude directory.
Extracts a required branch name and an optional port offset from the user's request (stopping to ask if no branch name is given); runs /create_worktree_prompt <branch-name> [port-offset] via the SlashCommand tool; that command creates the git worktree in trees/<branch-name>, auto-increments ports to avoid conflicts, sets up environment files, installs server and client dependencies, and starts both services automatically; then surfaces access URLs, ports in use, and how to stop, restart, or remove the worktree.
- A developer wants an isolated environment on the feature-dashboard branch without disturbing the current working tree
- A team needs services from feature-a, feature-b, and feature-c running simultaneously for comparison testing
- A hotfix on hotfix-security should use a specific port offset (e.g., 5) to avoid port collisions
- Multiple branches each need a fully isolated testing environment with independent ports, databases, and configuration
- The user explicitly asks to use a skill or slash command to create a worktree
What are this skill's strengths and limitations?
- One command handles worktree creation, port allocation, environment config, dependency install, and service startup end to end
- Ports auto-increment across parallel worktrees, eliminating manual conflict management
- SKILL.md explicitly constrains trigger conditions, reducing false activations
- Includes troubleshooting guidance for common failures (port conflicts, branch collisions, missing bun)
- Hard-depends on Claude Code's SlashCommand tool and the repo's /create_worktree_prompt command; unusable outside this .claude directory
- Implicitly requires bun; no support for other package managers is documented
- Part of a four-skill bundle whose README mostly covers the observability system; the skill itself lacks standalone docs and test evidence
- License is not stated in the source, so verify before commercial use
How do you install this skill?
Copy the repo's .claude directory into your project root: cp -R .claude /path/to/your/project/. The skill lives at .claude/skills/create-worktree-skill/ and depends on the /create_worktree_prompt command in the same repo's .claude/commands/, so deploy them together. bun must be installed (used for dependency installation). License is not stated in the source.
How do you use this skill?
In Claude Code, explicitly request the skill, e.g., 'use a skill to create a worktree for feature-auth' (without mentioning skill, it will not trigger). With a port offset: 'invoke the worktree skill on hotfix-security with port offset 5'. Multiple worktrees at once: run it once per branch (feature-a, feature-b, feature-c); ports are staggered automatically (e.g., 4010/5183, 4020/5193, 4030/5203). Troubleshooting: branch already exists as a worktree, ports in use (the command kills them automatically), missing bun dependency, or git worktree errors (handle uncommitted changes first).
How does this skill compare with similar options?
The same author's Claude Code Hooks Mastery project (linked in the README) covers the hook system itself; this skill instead focuses on worktree orchestration within the same Claude Code workflow ecosystem. No other comparators are named in the source.