Agent Skill
2/7/2026create-worktree
Creates a git worktree for parallel feature development. Use after planning to prepare an isolated development environment with all necessary environment files. Always refer to this when performing additional branch operations.
G
gaebalai
0GitHub Stars
1Views
npx skills add gaebalai/create-worktree
SKILL.md
| Name | create-worktree |
| Description | Creates a git worktree for parallel feature development. Use after planning to prepare an isolated development environment with all necessary environment files. Always refer to this when performing additional branch operations. |
name: create-worktree description: Creates a git worktree for parallel feature development. Use after planning to prepare an isolated development environment with all necessary environment files. Always refer to this when performing additional branch operations. allowed-tools: Bash(git:), Bash(mkdir:), Bash(cp:), Bash(chmod:), Bash(bash:), Bash(make:)
Git Worktree Creator
Automatically creates an isolated worktree environment for feature development after exiting plan mode.
Overview
This skill performs the following steps automatically:
- Creates a worktree in
.worktrees/<feature-name>/ - Creates a new
feature/<feature-name>branch - Copies environment files (configured via
.worktree.confor defaults to.envand.envrc) - Optionally randomizes port variables to avoid conflicts between worktrees
- Optionally runs a setup command
Usage
Basic Usage
# Run the script
bash .claude/skills/create-worktree/scripts/create_worktree.sh <feature-name>
# Example: developing the user-auth feature
bash .claude/skills/create-worktree/scripts/create_worktree.sh user-auth
Result
.worktrees/user-auth/ # worktree directory
├── .env # copied from root (ports randomized if configured)
├── .envrc # copied from root
└── ... # additional env files as configured
Configuration
Create a .worktree.conf file in the repository root to customize behavior. See .worktree.conf.example for a template.
Configuration Options
| Option | Description |
|---|---|
ENV_FILES | Array of environment file paths to copy into the worktree |
PORT_VARS | Array of port variable names to randomize in .env |
SETUP_COMMAND | Command to run after worktree creation (empty to skip) |
Default Behavior (without .worktree.conf)
- Copies
.envand.envrcfrom the repository root - No port randomization
- No setup command
After Completing Work
Removing the Worktree
Use the worktree-cleanup skill to automatically remove the worktree:
cd .worktrees/<feature-name>
bash ../../.claude/skills/worktree-cleanup/scripts/worktree_cleanup.sh
See the worktree-cleanup skill for details.
Manual Worktree Removal
git worktree remove .worktrees/<feature-name>
Details
See REFERENCE.md for more details.
Skills Info
Original Name:create-worktreeAuthor:gaebalai
Download