worktrunk
Manage Git worktrees for parallel AI agent workflows with Worktrunk CLI. Use when: running multiple AI coding agents simultaneously on different branches, parallelizing feature development with AI, managing concurrent git worktrees.
What this skill does
# Worktrunk
## Overview
Worktrunk is a CLI for git worktree management, designed for running AI coding agents in parallel. AI agents like Claude Code and Codex can handle longer tasks without supervision, making it possible to manage 5-10+ agents simultaneously. Git worktrees give each agent its own working directory so they don't step on each other's changes.
The problem: git worktree UX is clunky — starting a new worktree requires typing the branch name three times. Worktrunk makes worktrees as easy as branches with three core commands.
## Instructions
### Installation
```bash
# From crates.io
cargo install worktrunk
# Or download pre-built binary from GitHub releases
# https://github.com/max-sixty/worktrunk/releases
```
### Core Commands
**Switch** — create or move to a worktree:
```bash
wt switch feat # Switch to existing worktree
wt switch -c feat # Create new worktree + switch
wt switch -c -x claude feat # Create + launch Claude Code in it
wt switch -c -x "npm test" feat # Create + run any command
```
**List** — show all worktrees with status:
```bash
wt list # Shows branch names, paths, dirty status, ahead/behind
```
**Remove** — clean up worktree and branch:
```bash
wt remove # Remove current worktree
wt remove feat # Remove specific worktree
```
### Workflow Automation with Hooks
```toml
# .worktrunk.toml
[hooks]
on_create = "npm install"
pre_merge = "npm test"
post_merge = "git push origin main"
```
### Copy Build Caches
Avoid redundant dependency installs:
```toml
[create]
copy = ["node_modules", ".next", "dist"]
```
### Path Templates
```toml
[paths]
template = "../{repo}.{branch}" # Default naming pattern
```
## Examples
### Example 1: Parallel Feature Development on a SaaS App
A developer needs to build three independent features for a Node.js SaaS application. They use Worktrunk to run three Claude Code agents in parallel:
```bash
cd ~/projects/saas-app
# Configure hooks for automatic setup
cat > .worktrunk.toml << 'EOF'
[hooks]
on_create = "npm install && npm run build"
pre_merge = "npm test && npm run lint"
[create]
copy = ["node_modules", ".next"]
[paths]
template = "../saas-app.{branch}"
EOF
# Create 3 worktrees, each launching Claude Code with a task
wt switch -c -x "claude --prompt 'Implement Stripe subscription billing with webhooks for plan upgrades/downgrades'" feat/billing
wt switch -c -x "claude --prompt 'Add role-based access control: admin, editor, viewer roles with middleware guards'" feat/rbac
wt switch -c -x "claude --prompt 'Build CSV/JSON export for analytics dashboard with date range filtering'" feat/export
# Monitor progress across all worktrees
wt list
# feat/billing ../saas-app.feat/billing [dirty, ahead 3]
# feat/rbac ../saas-app.feat/rbac [dirty, ahead 5]
# feat/export ../saas-app.feat/export [clean, ahead 2]
# Merge completed features (pre_merge hook runs tests automatically)
wt switch feat/export && wt merge
wt switch feat/rbac && wt merge
wt switch feat/billing && wt merge
```
### Example 2: Bug Fix Sprint with Multiple Agents
A team lead triages 4 bug reports and assigns each to a separate agent working in its own worktree:
```bash
cd ~/projects/api-server
# Spin up one worktree per bug
wt switch -c -x "claude --prompt 'Fix: POST /api/users returns 500 when email contains + character. Add input sanitization and test.'" fix/email-plus
wt switch -c -x "claude --prompt 'Fix: Rate limiter counts OPTIONS preflight requests. Exclude CORS preflight from rate limit middleware.'" fix/rate-limit-cors
wt switch -c -x "claude --prompt 'Fix: Pagination returns duplicate items when records are inserted during traversal. Use cursor-based pagination.'" fix/pagination-dupes
wt switch -c -x "claude --prompt 'Fix: WebSocket connections leak when clients disconnect without close frame. Add heartbeat and cleanup.'" fix/ws-leak
# Check which fixes are done
wt list
# Merge fixes one by one, running tests each time
wt switch fix/email-plus && wt merge
wt switch fix/rate-limit-cors && wt merge
wt switch fix/pagination-dupes && wt merge
wt switch fix/ws-leak && wt merge
# Push all fixes
git push origin main
```
## Guidelines
- Break work into independent, self-contained tasks to avoid merge conflicts
- Branch all worktrees from the same commit to minimize divergence
- Use `on_create` hooks to automatically install dependencies in new worktrees
- Configure `copy` for `node_modules` and build caches to speed up worktree creation
- Use `pre_merge` hooks to run tests before merging each feature
- Merge completed features promptly to keep the base branch fresh
- Clean up worktrees after merging with `wt remove` to keep your workspace tidy
- Run `wt list` regularly to monitor progress across all active agents
- See [worktrunk.dev](https://worktrunk.dev) and [GitHub](https://github.com/max-sixty/worktrunk) for full docs
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.