# create-worktree-subagent

The create-worktree-subagent subagent creates isolated git worktrees for parallel development. Use it when the request explicitly delegates worktree creation to a subagent.

- subagent · `type=agent` · Claude Code, Cursor, Codex · ★ 1573 repo stars
- Author: disler
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/disler/claude-code-hooks-multi-agent-observability/tree/HEAD/.claude/agents/create_worktree_subagent.md
- Updated: 2026-02-08
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/agents/create-worktree-subagent

## What it does

The subagent reads the requested branch and an optional port offset, then runs `/create_worktree`. That slash command performs the worktree setup, installs dependencies, and starts services. A missing port offset is calculated by the command.

Its configuration grants `SlashCommand`, `Bash`, `Read`, `Write`, `Edit`, `Glob`, and `Grep`, with `sonnet` as the model. The agent is limited to this workflow: it should invoke the slash command instead of running git commands or building a worktree by hand.

The trigger is deliberately narrow. The user must explicitly ask for a subagent or delegate worktree creation to one; a general request to create a worktree does not activate this agent.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/agents/create_worktree_subagent.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/create_worktree_subagent.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/create_worktree_subagent.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/disler/claude-code-hooks-multi-agent-observability/tree/HEAD/.claude/agents/create_worktree_subagent.md

## When to use it
- create a worktree for the feature-auth branch
- pass a port offset into worktree setup
- prepare an isolated environment for parallel development
- delegate worktree creation to a subagent

## Example prompts
- Use a subagent to create a worktree for the `feature-auth` branch.
- Delegate worktree creation for `fix-bug` and pass port offset `3`.
- Set up a parallel environment for the `yellow-bg` branch through a subagent.

## Similar
- [git-worktree-manager](https://affpapa.org/en/nevibecode/skills/git-worktree-manager.md) — skill · 581 installs
- [worktree-cleanup](https://affpapa.org/en/nevibecode/commands/worktree-cleanup.md) — command · 89 installs
- [ce-worktree](https://affpapa.org/en/nevibecode/skills/ce-worktree.md) — skill · 3200 installs
- [git-worktree-isolation](https://affpapa.org/en/nevibecode/skills/git-worktree-isolation.md) — skill · 2300 installs
- [flow-next-worktree-kit](https://affpapa.org/en/nevibecode/skills/flow-next-worktree-kit.md) — skill · ★ 730 repo stars
- [worktree-isolation](https://affpapa.org/en/nevibecode/skills/worktree-isolation.md) — skill · 465 installs

From the same set: [disler/claude-code-hooks-multi-agent-observability](https://affpapa.org/en/nevibecode/by/disler/claude-code-hooks-multi-agent-observability.md) — 20 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
