create-worktree

Create an isolated Git worktree with a feature branch and copied environment files.

64|1|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/shikajiro/claude-code-skill-example --skill create-worktree-shikajiro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-worktree
Source: https://github.com/shikajiro/claude-code-skill-example/tree/main/.claude/skills/create-worktree
Command: npx skills add https://github.com/shikajiro/claude-code-skill-example --skill create-worktree-shikajiro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

It removes the manual setup burden of creating a dedicated branch and isolated Git worktree for parallel feature development, so you can start implementing immediately after planning.

Core Features & Use Cases

  • Automated Git worktree creation: Creates .worktrees/<feature-name>/ and a feature/<feature-name> branch to keep work isolated.
  • Environment bootstrap: Copies root and service-specific environment files (and randomizes ports in the root .env) so the new worktree runs consistently.
  • Project setup execution: Runs make setup inside the new worktree when a Makefile exists.

Use case: After planning a feature like user-auth, you want a clean, parallel workspace with the correct environment configuration and ports ready for development without repeating setup steps.

Quick Start

Run the skill script with your feature name to generate the worktree, branch, copied env files, and execute setup: bash .claude/skills/create-worktree/scripts/create_worktree.sh user-auth.

Frequently Asked Questions about create-worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Git worktree for parallel feature development?

Creating an isolated Git worktree involves generating a `.worktrees/<feature-name>/` directory and a `feature/<feature-name>` branch. This skill automates that process, allowing you to start parallel development immediately after planning.

What is the best way to copy environment files when setting up a new Git worktree?

Copying environment files during worktree setup is handled automatically by copying `.env*` files across root, frontend, backend, and agent directories. It also randomizes ports in the root `.env` file to prevent conflicts during parallel development.

Does this worktree creation process run project setup scripts automatically?

Yes, worktree creation executes project setup scripts automatically by running `make setup` inside the new worktree directory whenever a Makefile is available, ensuring the environment is fully bootstrapped.

Can I use this for hotfix and fix workflows, or only for feature branches?

You can use this for hotfix and fix workflows as well as feature branches. The skill creates an isolated environment with copied configuration files applicable to any feature, fix, or hotfix parallel development workflow.

Why do I need to randomize ports in a Git worktree environment?

You need to randomize ports in a Git worktree environment to prevent network conflicts when running multiple instances of services simultaneously. The skill automatically randomizes ports in the root `.env` file during the environment bootstrap.