# Create worktree

> Create worktree is an open-source agent skill for developer tools. Sets up an isolated git or jj worktree with dependencies ready for a feature or fix. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/jeffh/claude-plugins/tree/main/humanlayer/skills/create-worktree
- **Repository:** https://github.com/jeffh/claude-plugins
- **GitHub stars:** 12
- **License:** Apache-2.0
- **Skill name:** create-worktree
- **Collection:** https://github.com/jeffh/claude-plugins
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/jeffh/claude-plugins/tree/HEAD/humanlayer/skills/create-worktree)
- [Asks for: Bash, AskUserQuestion](https://github.com/jeffh/claude-plugins/blob/HEAD/humanlayer/skills/create-worktree/SKILL.md)
- [License: Apache-2.0](https://github.com/jeffh/claude-plugins/tree/HEAD/humanlayer/skills/create-worktree)

## Features

- **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

## Install

### Claude Code

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

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

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

```sh
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.

### Codex

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

```sh
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.

### Cursor

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

```sh
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.

### Gemini CLI

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

```sh
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.

### VS Code

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

```sh
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.

### Other agents

Get the folder:

```sh
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.

## 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.

## Alternatives

- [Wt](https://ai-powered.com/skills/wt-timvw): Wt is an open-source agent skill for developer tools.
- [Git workflow](https://ai-powered.com/skills/git-workflow-nabwinsaud): Git workflow is an open-source agent skill for developer tools.
- [Setup repo skills](https://ai-powered.com/skills/setup-repo-skills): Setup repo skills is an open-source agent skill for developer tools.
- [Setup matt pocock skills](https://ai-powered.com/skills/setup-matt-pocock-skills): Setup matt pocock skills is an open-source agent skill for developer tools.
- [GitHub workflow](https://ai-powered.com/skills/github-workflow): GitHub workflow is an open-source agent skill for developer tools.
- [Workshop create](https://ai-powered.com/skills/workshop-create): Workshop create is an open-source agent skill for developer tools.
- [Vibe workstream orchestration](https://ai-powered.com/skills/vibe-workstream-orchestration): Vibe workstream orchestration is an open-source agent skill for developer tools.
- [Create branch](https://ai-powered.com/skills/create-branch): Create branch is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/create-worktree
