Skip to content
Skill

Create worktree

Sets up an isolated git or jj worktree with dependencies ready for a feature or fix

Create worktree is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
12
Last commit
License
Apache-2.0
Listing updated

Similar skills

About Create worktree

This skill walks the agent through creating a separate working directory for a branch, so work on several branches can happen side by side. It asks for a worktree name, which is generated if omitted, and a base branch or bookmark, then creates the worktree under a home-directory folder named after the repository. It handles both git and jj workspaces, with a check that stops if the target path already exists.

After creation, the skill copies a local .claude directory into the new worktree when one is present and runs make setup to install dependencies. If setup fails, it removes the new worktree and branch or workspace again. On success it prints the path and branch name along with commands for removing the worktree later.

The skill expects a repository that uses git or jj and provides a make setup target. It is written for Bash and uses the AskUserQuestion tool to collect details. The SKILL.md mentions an optional thoughts initialization flag, but the steps given do not include that setup.

When your agent uses it

Creates a new git/jj worktree for development work with proper setup, dependencies, and optional thoughts initialization. Use when user needs to create a new worktree for feature development or bug fixes.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (4 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the humanlayer plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add jeffh/claude-plugins
/plugin install humanlayer@jeffh-claude-plugins

Or copy only this skill to ~/.claude/skills/create-worktree:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/jeffh/claude-plugins.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/create-worktree &&
cp -R "$tmp/humanlayer/skills/create-worktree" ~/.claude/skills/create-worktree &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/create-worktree inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/create-worktree to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/jeffh/claude-plugins.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/create-worktree &&
cp -R "$tmp/humanlayer/skills/create-worktree" ~/.agents/skills/create-worktree &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/create-worktree inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/create-worktree to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/jeffh/claude-plugins.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/create-worktree &&
cp -R "$tmp/humanlayer/skills/create-worktree" ~/.cursor/skills/create-worktree &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/create-worktree inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/jeffh/claude-plugins.git --path humanlayer/skills/create-worktree

Or copy the folder to ~/.gemini/skills/create-worktree yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/create-worktree:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/jeffh/claude-plugins.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/create-worktree &&
cp -R "$tmp/humanlayer/skills/create-worktree" ~/.copilot/skills/create-worktree &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/create-worktree inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/jeffh/claude-plugins.git

Then copy claude-plugins/humanlayer/skills/create-worktree into your agent's skills folder as create-worktree. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Git worktree creation
Creates a new worktree and branch from a chosen base, or reuses an existing branch with the same name.
jj workspace support
Creates a jj workspace and bookmark in the same layout for users of Jujutsu.
Dependency setup
Runs make setup inside the new worktree so its dependencies are installed.
Automatic cleanup on failure
Removes the new worktree and branch or workspace if the setup step fails.
Random name generation
Creates a short adjective-noun-time name when the user does not supply one.
Config directory copy
Copies an existing .claude directory into the new worktree so agent settings carry over.

Good for

  • Start a worktree for a new feature branch without disturbing the current checkout
  • Create an isolated workspace for a Linear ticket such as ENG-2166
  • Spin up a separate environment to fix a bug while another branch stays in progress
  • Set up a jj workspace for parallel work on a Jujutsu repository

Create worktree FAQ

What does the skill need before Create worktree runs?

The repository needs a make setup target, since the skill runs it in the new worktree, and the agent needs Bash and the AskUserQuestion tool.

Where are the worktrees created?

By default they go in a wt folder under the home directory, in a subfolder named after the repository.

What happens if dependency setup fails?

The skill removes the new worktree and the branch or jj workspace it created, then exits with an error.

Does Create worktree copy my agent settings?

If a .claude directory exists in the original repository, it is copied into the new worktree.

How do I install Create worktree in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/create-worktree to use it in all your projects, or to .claude/skills/create-worktree in one project. Or install the humanlayer plugin, which includes it: /plugin marketplace add jeffh/claude-plugins, then /plugin install humanlayer@jeffh-claude-plugins.

Does Create worktree run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Create worktree?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to Create worktree?

The closest alternatives to Create worktree are Wt, Git workflow, Setup repo skills, Setup matt pocock skills and GitHub workflow.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from jeffh/claude-plugins

  1. Lets Claude hand desktop and browser UI tasks to a Codex agent that drives apps

    • Open source
    • 12 GitHub stars
    • Browser automation
  2. Hands a coding task to a Codex subagent that edits files in the working directory

    • Open source
    • 12 GitHub stars
    • Developer tools
  3. Gets a read-only second code review from a Codex subagent via codex exec

    • Open source
    • 12 GitHub stars
    • Developer tools
  4. Collects timestamp and git or jj repo metadata for research and handoff documents

    • Open source
    • 12 GitHub stars
    • Developer tools
  5. Writes conventional commit messages for jj changes, without Claude attribution

    • Open source
    • 12 GitHub stars
    • Developer tools
  6. Takes jj commits through description, bookmarks, push, and stacked GitHub PRs

    • Open source
    • 12 GitHub stars
    • Developer tools