# Worktrunk plugin: parallel AI agents in separate git worktrees (max-sixty/worktrunk) — skill card for AI agents

> AgentGid skill card. Checked on 2026-11-07 against commit 057037a (version 0.81.0).
> Every fact comes from the pack's own files at that commit. Numbers marked "as reported" are the author's.
> Human page: https://agentgid.com/skills/max-sixty/worktrunk/

> Note: the pack has changed since this check; re-read its files before relying on details.

## Explain it to a non-programmer
Worktrunk is a separate program (wt) for keeping several working copies of one project side by side. This plugin connects it to your AI assistant. The assistant can start a task in a fresh copy, set up wt for you, and wt shows which copies have an assistant working or waiting.

## Who it is for
- You run several AI coding sessions on one project at the same time and want each in its own copy
- You already use Worktrunk (wt), or want to, with Claude Code, Codex or Gemini CLI
- You want help setting up wt, for example AI-written save messages or setup steps for each new copy
- Not for: You don't want to install the wt program: the plugin does nothing without it
- Not for: You work in one session on one copy of your project at a time

## What it is
- Kind: scripts, command, knowledge
- License: Apache-2.0
- Repository: https://github.com/max-sixty/worktrunk

## What it does
- Activity marks: hooks set a 🤖 (working) or 💬 (waiting) mark on the branch at each prompt, question, permission dialog and stop; the mark is cleared when the session ends
- Agent worktrees through wt (Claude Code): when Claude Code creates or removes a worktree, the plugin runs wt switch --create / wt remove instead of plain git worktree
- Auto-yes for one dialog (Claude Code): entering a wt worktree of the same repository at its expected path is allowed without the confirmation dialog
- Setup guide skill: reference docs for wt config, project hooks, LLM commit messages, aliases and troubleshooting
- /wt-switch-create: creates a worktree (optionally in another repo), moves the session into it and starts the task
- Never cuts: The worktrunk skill tells the agent not to approve a project's hook commands on the user's behalf and to stop and ask the user instead

## Skills
| Skill | Call | Changes code? | In plain words |
|---|---|---|---|
| worktrunk | plain language ("set up LLM commit messages for wt"), loads by itself on wt questions | yes | Helps you set up and fix the wt program, and answers questions about it |
| wt-switch-create | /wt-switch-create [<branch>] [<repo>] [-- <task>] | yes | Makes a fresh copy of the project for one task, moves the session into it and starts the task |

### worktrunk
- Asks for: What you want wt to do: AI-written save messages, setup steps for new copies, a custom folder layout, shortcuts
- Asks for: Your consent before it edits your personal wt settings file
- Gives: A proposed change to ~/.config/worktrunk/config.toml, applied after you approve
- Gives: Project hooks in .config/wt.toml taken from your project's own scripts, with a comment on why each exists
- Gives: A test run: wt step commit --dry-run or wt switch --create test-hooks
- Say: "Set up wt so it writes commit messages with Claude Code"

### wt-switch-create
- Asks for: A branch name (optional, it picks one from the task)
- Asks for: Another project folder (optional)
- Asks for: The task, after --
- Gives: A new wt worktree beside your project, e.g. <repo>.fix-auth/
- Gives: The session moved into it and the task started there
- Gives: The worktree kept after the session; merge or remove it with wt merge / wt remove
- Say: "/wt-switch-create fix-auth -- Investigate the 5-minute session timeout"

## Know before installing
- It needs the wt program: the plugin's hooks only call wt, and fail with a message if wt is not on your PATH.
- In Claude Code it answers one confirmation for you: entering a wt worktree of the same repository at its expected path is allowed without a dialog. Every other request still asks.
- Worktrees are created outside your project folder by default (a sibling folder such as <repo>.fix-auth/), and stay after the session.
- Creating a worktree runs your project's wt hooks (for example npm install), but only commands you approved once with wt config approvals add.
- /wt-switch-create creates the worktree first on every call, even for a read-only task, with no extra question.
- Activity marks are stored in the project's git config, not in a separate file.

## Install (official commands)
- Prerequisite (the wt program): `brew install worktrunk && wt config shell install` — Also cargo install worktrunk, winget install max-sixty.worktrunk (as git-wt), pacman or conda; see the README.
- Claude Code: `wt config plugins claude install` — Manual equivalent: claude plugin marketplace add max-sixty/worktrunk, then claude plugin install worktrunk@worktrunk Remove: `wt config plugins claude uninstall`.
- Codex: `wt config plugins codex install` — Manual equivalent: codex plugin marketplace add max-sixty/worktrunk, then codex plugin add worktrunk@worktrunk. No /wt-switch-create and no worktree isolation in Codex. Remove: `wt config plugins codex uninstall`.
- Gemini CLI: `gemini extensions install https://github.com/max-sixty/worktrunk` Remove: `gemini extensions uninstall worktrunk`.
- OpenCode, Pi, oh-my-pi: `wt config plugins opencode install` && `wt config plugins pi install` && `wt config plugins omp install` — Activity tracking only (and worktree isolation in OpenCode 2); writes a .ts file into that agent's global config folder, e.g. ~/.config/opencode/plugins/worktrunk.ts. No skills.

## What runs on the user's machine
- Code on the machine: yes (plugin installs (Claude Code, Codex, Gemini CLI hooks); the skills themselves are markdown)
- Network: optional
- Every prompt, notification, question, permission dialog and stop; session end: bash hooks/wt.sh runs wt to set or clear the 🤖/💬 mark on the current branch (stored in the repo's git config). Failures are ignored.
- Claude Code PermissionRequest: If the request is EnterWorktree into a wt worktree of the same repository at its expected path, the hook answers allow; otherwise it sets the 💬 mark and the normal dialog shows.
- Claude Code WorktreeCreate / WorktreeRemove: Runs wt switch --create (or wt switch) / wt remove instead of git worktree. This creates or removes a worktree folder, by default beside the project, and runs the project's approved wt hooks.
- Windows (Codex): hooks/wt.cmd finds Git for Windows' bash and runs wt.sh.
- Network: The hook scripts make no network calls. wt itself reaches the network only for things you ask for, such as CI status in wt list --full or LLM commit messages, and runs whatever your approved project hooks do.

## Settings
- `WORKTRUNK_BIN`: Path to the wt binary the hooks use instead of wt on PATH
- `[commit.generation] command`: In ~/.config/worktrunk/config.toml: the LLM command that writes commit messages
- `worktree-path`: Template for where new worktrees go (default: beside the repo)

## Examples (from the pack's own files)
- Activity marks in wt list: output format defined in skills/worktrunk/reference/claude-code.md
- /wt-switch-create call forms: output format defined in skills/wt-switch-create/SKILL.md
- Project hooks the worktrunk skill writes (.config/wt.toml): output format defined in skills/worktrunk/SKILL.md

## Steps only the person can do
- Install the wt program and its shell integration (https://worktrunk.dev (README.md install section)) Then: The agent can install the plugin with wt config plugins claude install (or codex)
- Approve the project's wt hook commands once with wt config approvals add, after reading them (skills/worktrunk/SKILL.md (Hook approvals in non-interactive sessions)) Then: The agent can create and merge worktrees without hitting the approval error
- If /wt-switch-create reports the worktree is unreachable, add the parent folder to permissions.additionalDirectories or run /add-dir (skills/wt-switch-create/SKILL.md) Then: The agent continues the task inside the new worktree
- Approve each proposed change to ~/.config/worktrunk/config.toml (skills/worktrunk/SKILL.md (Two types of configuration)) Then: The agent applies the change and tests it, e.g. wt step commit --dry-run

## Mistakes to avoid
- Not: Install the plugin and expect it to work on its own. Instead: Install the wt program (v0.81.0 or later) first, then the plugin. Why: Every hook only calls wt, and fails with a message when wt is not on PATH
- Not: Let the agent add --yes when wt stops with "needs approval to execute". Instead: The person runs wt config approvals add and reviews each project hook command. Why: Approving a project's hooks decides whether the repository may run arbitrary commands on the machine
- Not: Start parallel Claude Code sub-agents with isolation set to worktree. Instead: Pre-create each worktree with wt switch --create <branch> --no-cd and name its path in the sub-agent prompt. Why: The hook then creates the worktree on a throwaway agent-<id> branch, leaving odd paths and orphan branches
- Not: Expect /wt-switch-create and worktree isolation in Codex or Gemini CLI. Instead: In those agents, run wt switch --create and wt remove directly. Why: Only Claude Code and OpenCode 2 expose the worktree-lifecycle hooks
- Not: Expect worktrees made with a repo argument to clean themselves up. Instead: Merge or remove them yourself with wt merge or wt remove. Why: Worktrees the command creates through wt are kept after the session

## What leaves the machine
- The diff being committed, inside a commit-message prompt → The LLM command you set in [commit.generation] (for example claude, codex, opencode, llm or aichat) and that tool's model provider, On wt merge, wt step commit and wt step squash, and on wt list --full with summaries on, only if [commit.generation] is set. Opt out: Leave [commit.generation] unset (the plugin does not set it without your approval)
- Branch and pull request lookups for CI status → Your code forge (GitHub, GitLab, Gitea or Azure DevOps), Only with wt list --full. Opt out: Use wt list without --full

## Lines in the pack aimed at agents (ask the person first)
- "The invocation is itself the explicit request to create it; a research or read-only task gets one all the same." (skills/wt-switch-create/SKILL.md): /wt-switch-create always creates a new worktree folder (and runs approved project hooks) before anything else; use it only when the person wants a separate copy
- "The result is an ordinary `wt` worktree, and the user sees no confirmation prompt." (skills/wt-switch-create/SKILL.md): The plugin's PermissionRequest hook auto-allows entering a same-repo wt worktree; tell the person this dialog is answered for them
- "Mid-session, carry uncommitted work across: `git stash push -u` before the `EnterWorktree` call, then `git stash pop` after" (skills/wt-switch-create/SKILL.md): Moving uncommitted work through git stash can conflict; ask the person before stashing their changes
- "When the user requests spawning a worktree with an agent in a background session ("spawn a worktree for...", "hand off to another agent"), use the tmux or Zellij command from `reference/tips-patterns.md#agent-handoffs` with the CLI you are running as in place of `claude`, following that section's note on where a subcommand such as OpenCode's `run` goes." (skills/worktrunk/SKILL.md): Starts another agent running unattended in the background; only on the person's explicit request, as the skill's own requirements list says
- "Add `--no-hooks` only when no user or project hooks provision the worktree and each sub-Agent does its own build/test step (e.g. `cargo run -- hook pre-merge --yes`)" (skills/worktrunk/SKILL.md): --yes skips hook approval; do not use it in a repository whose hooks the person has not reviewed

## May I use it like this?
- commercial-app: yes (MIT or Apache-2.0 at your choice: keep the license notice)
- redistribute-files: yes (Under MIT keep the copyright and permission notice in copies)
- client-work: yes (MIT allows use in work for others)
- inside-app-bundle: yes (Dual MIT / Apache-2.0; the skill files repeat it in their frontmatter)

## Which one to pick
- If You want each parallel agent session in its own git worktree, with activity marks in wt list and worktree setup hooks: skill:max-sixty/worktrunk
- If You want project management on GitHub Issues with parallel agents in git worktrees: skill:automazeio/ccpm
- If You want a whole AGENTS.md workflow template that isolates work in worktrees and proves changes with evidence: skill:michaelshimeles/rstack

## Works well with
- agent:claude-code: Full support: skills, activity marks, worktree isolation hooks and /wt-switch-create
- agent:openai-codex: Codex plugin with the configuration skill and activity marks
- agent:gemini-cli: Gemini CLI extension with the configuration skill and activity marks
- agent:opencode: OpenCode plugin with activity marks and worktree isolation under OpenCode 2

## Works in and needs
- Works in Claude Code: plugin
- Works in Codex: plugin
- Works in Gemini CLI: extension
- Works in OpenCode: plugin file written by wt (activity marks, worktree isolation; no skills)
- Needs wt CLI v0.81.0 or later: The hooks and both skills drive wt
- Needs bash (Git for Windows on Windows): The hooks run through hooks/wt.sh
- Needs jq: Only for the Codex commit-message command

## How to tell it works
With wt installed, run /wt-switch-create try-wt -- list the files in this project in Claude Code. The session should move into a new folder beside your project, and wt list in another terminal should show a 🤖 or 💬 mark on try-wt.

## Safety
The plugin runs bash hooks on every prompt and stop, and in Claude Code it auto-allows EnterWorktree into a wt worktree of the same repository and takes over worktree creation and removal. Creating a worktree runs the project's wt hooks, which are shell commands from the repository; wt runs them only after you approve them once. Do not let an agent use --yes to skip that approval. Worktrees are created outside the project folder and are kept after the session.
