Skip to content
/

worktrunk

worktrunk · max-sixty/worktrunk · ★ 5.2k · last commit 2026-05-26

Primitive shape 4 total
Skills 1 Hooks 3
00

Summary

Worktrunk — Summary

Worktrunk (wt) is a Rust CLI for git worktree management explicitly designed for running AI agents in parallel. Its three core commands (wt switch, wt list, wt merge) make worktrees as easy to use as branches: wt switch -c feature creates a new branch + worktree in one command; wt list shows all worktrees with status, CI state, and AI-generated summaries; wt merge squashes, rebases, fast-forward merges, and cleans up in one step. Additional features include hooks (pre/post-merge, post-start, etc.), LLM commit message generation, an interactive picker with diff/log preview, copy-of-build-caches between worktrees, and a Claude Code plugin that shows agent activity indicators (🤖/💬) in wt list. Unlike the other frameworks in this batch (E2B, Daytona, microsandbox, brood-box, arrakis) which provide sandbox isolation, Worktrunk provides git-worktree-based isolation — it manages the host filesystem workspace isolation rather than VM/container execution isolation. Among the seed frameworks, it is most similar to the isolation mechanism used by superpowers (git-worktree) and taskmaster-ai, but Worktrunk focuses entirely on the worktree management UX rather than agent behavioral augmentation.

01

Overview

Worktrunk — Overview

Origin

Worktrunk (max-sixty/worktrunk) was created by Maxime Roos and first released at the start of 2026. By May 2026 it has 5,197 stars (the second-highest in this batch after Daytona) and 30 contributors. Licensed MIT OR Apache-2.0. Built in Rust.

Philosophy

From the README: "AI agents like Claude Code and Codex can handle longer tasks without supervision, such that it's possible to manage 5-10+ in parallel. Git's native worktree feature give each agent its own working directory, so they don't step on each other's changes. But the git worktree UX is clunky."

Key design values:

  • Worktrees addressed by branch name (not filesystem paths)
  • One command creates both branch + worktree: wt switch -c feature (vs git worktree add -b feat ../repo.feat && cd ../repo.feat)
  • Parallel agent coordination: First-class support for running 5-10+ agents concurrently
  • Data safety above all: "Never risk data loss without explicit user consent. A failed command that preserves data beats a 'successful' one that silently destroys work."
  • Maturing mode: growing user base, external-interface breaks need justification

Context

Worktrunk explicitly links to Anthropic's "Claude Code Best Practices" guide which recommends the worktree pattern. It is the reference implementation of that pattern as a CLI.

Claude Code Plugin

Worktrunk ships as a Claude Code plugin (.claude-plugin/marketplace.json) with:

  • A skill (worktrunk/SKILL.md) for configuration guidance
  • Hooks that track Claude agent activity per worktree (showing 🤖/💬 in wt list)
02

Architecture

Worktrunk — Architecture

Distribution

  • Type: Standalone CLI binary
  • Install (Homebrew): brew install worktrunk && wt config shell install
  • Install (Cargo): cargo install worktrunk && wt config shell install
  • Install (Windows): winget install max-sixty.worktrunk
  • Install (Arch): sudo pacman -S worktrunk
  • Install (Conda/Pixi): conda install -c conda-forge worktrunk
  • Shell integration (wt config shell install) is required for directory-changing commands

Repo Structure

worktrunk/
├── src/
│   ├── main.rs            — entry point
│   ├── cli/               — Clap CLI definitions (mod.rs, config.rs, hook.rs, list.rs, step.rs)
│   ├── commands/          — Command handlers
│   │   ├── worktree/      — switch, remove, list, merge
│   │   ├── step/          — commit, diff, copy-ignored, prune, etc.
│   │   ├── hooks.rs       — hook execution
│   │   └── ...
│   ├── git/               — Repository abstraction + git operations
│   ├── config/            — User + project config parsing (TOML)
│   ├── llm.rs             — LLM commit message generation
│   └── shell/             — Shell integration
├── skills/
│   └── worktrunk/
│       ├── SKILL.md       — Claude Code skill (guidance for wt config)
│       └── reference/     — Auto-synced docs from worktrunk.dev
├── hooks/
│   └── hooks.json         — Claude Code / Codex / Gemini hooks
├── .claude/
│   └── skills/            — Subset of skills for Claude Code
├── .agents/               — Codex/other agent plugin files
├── .claude-plugin/
│   └── marketplace.json   — Claude Code plugin marketplace entry
├── plugins/worktrunk/     — Full plugin directory
├── CLAUDE.md              — Developer contribution guide
└── Cargo.toml             — Rust workspace

Config Files

File Scope Content
~/.config/worktrunk/config.toml User LLM settings, worktree path template, command defaults, user hooks
<repo>/.config/wt.toml Project (git-tracked) Team-wide hooks (pre/post-merge, post-start, etc.)

Target Runtime

  • Rust stable (latest − 1 MSRV)
  • Any OS (macOS, Linux, Windows)
  • No container/VM dependency
03

Components

Worktrunk — Components

Core Commands (wt)

Command Purpose
wt switch <branch> Switch to worktree (create if -c; run command with -x cmd)
wt switch -c -x claude feat Create worktree + start Claude in it
wt list List all worktrees with status, CI state, ahead/behind, LLM summaries
wt list --full Full mode with CI status + AI-generated summaries
wt remove Remove worktree + delete branch if merged
wt remove --force Remove dirty worktree (explicit consent required)
wt merge [target] Squash + rebase + fast-forward merge + cleanup
wt select Interactive TUI picker with diff/log preview
wt step commit Generate LLM commit message + commit staged changes
wt step diff Show diff
wt step squash Squash uncommitted changes
wt step copy-ignored Copy build caches (node_modules, target/) from another worktree
wt step prune Remove stale worktrees
wt step relocate Move worktree to new path
wt step tether Link worktree to different branch
wt step eval Evaluate hook templates
wt step for-each Run command across all worktrees
wt hook <type> Run a specific hook (pre-merge, post-start, etc.)
wt hook pre-merge Run pre-merge hooks (all tests + lints)
wt config show Show resolved config
wt config create Create config file interactively
wt config update Update config value
wt config shell install Install shell integration (cd support)
wt config state set/get/clear Manage per-worktree state variables
wt config plugins claude install Install Claude Code plugin
wt config plugins codex install Install Codex plugin
wt config plugins opencode install Install OpenCode plugin

Hook Types

From hooks.json and docs:

  • BeforeAgent / AfterAgent — track Claude agent activity (🤖/💬 markers)
  • SessionEnd — clear activity marker
  • pre-merge — runs before merge (tests, lints)
  • post-merge — runs after merge
  • pre-start — runs when creating worktree
  • post-start — runs after switching (install deps, start dev server)
  • post-switch — runs after directory switch
  • pre-commit — runs before commit

Claude Code Plugin

hooks.json (BeforeAgent, AfterAgent, SessionEnd):

{
  "hooks": {
    "BeforeAgent": [{ "hooks": [{ "type": "command",
      "command": "bash ... wt config state marker set 🤖 || true" }] }],
    "AfterAgent":  [{ "hooks": [{ "type": "command",
      "command": "bash ... wt config state marker set 💬 || true" }] }],
    "SessionEnd":  [{ "hooks": [{ "type": "command",
      "command": "bash ... wt config state marker clear || true" }] }]
  }
}

Skill (worktrunk/SKILL.md): Guidance for configuring wt.toml and ~/.config/worktrunk/config.toml, setting up LLM commit messages, and debugging hooks.

Skills (3 total in .claude/skills/)

  • release — guide for cutting a Worktrunk release
  • running-tend — operating in CI / tend workflows
  • writing-user-outputs — style guide for user-visible strings
05

Prompts

Worktrunk — Prompts

Worktrunk ships a Claude Code skill (worktrunk/SKILL.md) that teaches Claude Code how to help users configure Worktrunk. This is closer to a "help guide" skill than a behavioral injection.

Verbatim: SKILL.md — Skill Header and Description

---
name: worktrunk
description: Guidance for Worktrunk (the `wt` CLI) — git worktree management, hooks, 
  and config. Load when editing .config/wt.toml or ~/.config/worktrunk/config.toml; 
  adding, modifying, or debugging hooks (post-merge, post-start, pre-commit, pre-merge, 
  post-switch, etc.); configuring commit message generation or command aliases; or 
  troubleshooting wt behavior. Also answers general worktrunk/wt questions.
license: MIT OR Apache-2.0
compatibility: Requires the `wt` CLI (https://worktrunk.dev)
---

Technique: Declarative description-based activation (Claude Code autonomously loads this skill when relevant context is detected). Reference-pointing pattern: the skill mostly says "read the reference docs at reference/X.md" rather than embedding all knowledge inline.

Verbatim: SKILL.md — Core Workflow Instruction

## Determining Which Config to Use

When a user asks for configuration help, determine which type based on:

**User config indicators**:
- "set up LLM" or "configure commit generation"
- "change where worktrees are created"
- "customize commit message templates"
- Affects only their environment

**Project config indicators**:
- "set up hooks for this project"
- "automate npm install"
- "run tests before merge"
- Affects the entire team

Technique: Decision-tree routing — the skill instructs Claude to triage user requests into user-config vs project-config pathways based on intent signals. This is a context-classification pattern (similar to superpowers' routing skills) applied to CLI configuration guidance.

Verbatim: hooks.json (Claude Code Plugin Hooks)

{
  "hooks": {
    "BeforeAgent": [
      {"hooks": [{"type": "command",
        "command": "bash \"${extensionPath}/plugins/worktrunk/hooks/wt.sh\" config state marker set 🤖 || true"}]}
    ],
    "AfterAgent": [
      {"hooks": [{"type": "command",
        "command": "bash \"${extensionPath}/plugins/worktrunk/hooks/wt.sh\" config state marker set 💬 || true"}]}
    ],
    "SessionEnd": [
      {"hooks": [{"type": "command",
        "command": "bash \"${extensionPath}/plugins/worktrunk/hooks/wt.sh\" config state marker clear || true"}]}
    ]
  }
}

Technique: Lifecycle hook injection — these hooks don't modify agent behavior but write state markers to the worktree config so wt list can show which worktrees have active agent sessions (🤖) vs finished sessions (💬). Pure observability instrumentation.

09

Uniqueness

Worktrunk — Uniqueness & Positioning

differs_from_seeds

Worktrunk is the only framework in this batch that uses git-worktree isolation (matching the seed archetype). Among seeds, superpowers uses worktree_per_feature: yes and taskmaster-ai uses worktree: yes for parallel agent work — but these are incidental to their core value (skills/hooks/MCP). Worktrunk's entire value is worktree management UX: it treats worktrees as first-class citizens, makes the create/switch/merge/cleanup lifecycle as simple as branch operations, and adds observability (activity markers, CI status, LLM summaries). Unlike all seeds (which inject behavioral instructions into agents), Worktrunk only manages the filesystem isolation layer and adds workflow automation (hooks, LLM commits). It is closer to an infrastructure tool like brood-box/microsandbox than to superpowers/BMAD — but its isolation is git-based rather than VM-based.

Positioning Within This Batch

Worktrunk is unique in this batch:

  • Only git-worktree isolation (vs microVM/container isolation of all other frameworks)
  • Only Rust CLI focused purely on worktree UX (vs Go/TypeScript/Python)
  • Only Claude Code plugin in this batch that tracks agent activity across multiple worktrees
  • Most complete parallel-agent UX: wt list --full with CI status + AI summaries is unlike anything in the other frameworks

vs other batch members:

  • vs brood-box: brood-box uses microVM; Worktrunk uses git-worktree; different isolation layers
  • vs vibekit: VibeKit dispatches agents; Worktrunk manages the filesystem workspace for agents

Distinctive Opinion

The bottleneck in running many parallel AI agents is not VM isolation (which git worktrees handle adequately) but worktree lifecycle UX — creating, monitoring, merging, and cleaning up multiple branches is too clunky with raw git commands.

Explicit Antipatterns

  • Running agents in the same directory (file conflicts)
  • Force-removing worktrees that have unsaved data
  • Silent destructive side effects during unrelated operations
  • git reset --hard (favors --keep), git checkout --force (favors --merge)

Observable Failure Modes

  1. Git-only isolation: No VM/container boundary — malicious agent code can affect the host OS
  2. Shell integration required: wt config shell install must be run for directory-changing commands; may conflict with other shell customizations
  3. Windows: wt conflicts with Windows Terminal; winget installs as git-wt
  4. MSRV: Rust latest − 1; bumped during weekly tend maintenance (compatibility risk)
  5. LLM commit dependency: wt step commit requires a configured LLM tool; if unavailable, the command fails

Cross-References in This Batch

  • Claude Code plugin hooks (BeforeAgent/AfterAgent/SessionEnd) interact with Claude Code's agent lifecycle events
  • Referenced in Anthropic's "Claude Code Best Practices" guide
  • tend (from the same author) is used for dependency maintenance (running-tend skill)
04

Workflow

Worktrunk — Workflow

Basic Parallel Agent Workflow

# Start 3 agents in parallel
wt switch -x claude -c feature-a -- 'Add user authentication'
wt switch -x claude -c feature-b -- 'Fix the pagination bug'
wt switch -x claude -c feature-c -- 'Write tests for the API'

Each wt switch -c <branch> creates a new branch + worktree. -x claude runs Claude after switching. Arguments after -- are passed to the agent.

Single Branch Workflow

# Create worktree
wt switch --create feature-auth

# Check all worktrees
wt list
# @ feature-auth  +   ↑      +27   -8   ↑1    ...

# PR workflow
wt step commit      # LLM-generated commit
gh pr create        # open PR
wt remove           # cleanup after PR merged

# OR local merge
wt merge main       # squash + rebase + fast-forward + cleanup

Phases

Phase What Happens Artifact
1. Worktree Create wt switch -c feature New branch + worktree directory
2. Agent Work Agent runs in worktree (separate process) Code changes in worktree
3. (Optional) Commit wt step commit — LLM generates commit message Git commit
4a. PR Path Push branch, gh pr create GitHub/GitLab PR
4b. Local Merge wt merge main Fast-forward merge on main
5. Cleanup wt remove (or auto from merge) Worktree + branch deleted

Hooks Example

# .config/wt.toml (project-level)
[[hooks.post-start]]
run = "npm install"  # run after creating/switching worktree

[[hooks.pre-merge]]
run = "cargo test --all"  # run before merge

[[hooks.post-merge]]
run = "wt step prune"  # cleanup stale worktrees

Approval Gates

wt merge includes a pre-merge hook gate: if pre-merge hooks fail (tests, lints), the merge is blocked. This is configurable per-project.

LLM Commit Messages

Configured via user config:

[commit.generation]
command = "claude -p"  # or codex, llm, aichat, etc.

wt step commit generates the message by running the configured LLM command with the diff as input.

06

Memory Context

Worktrunk — Memory & Context

State Model

Worktrunk uses two config files for persistent state:

File Scope Content
~/.config/worktrunk/config.toml User LLM config, worktree path template, approved commands, state variables, user hooks
<repo>/.config/wt.toml Project (git-tracked) Team hooks (pre-merge, post-start, etc.), project-wide settings

Per-Worktree State Variables

wt config state set my-key "value"
wt config state get my-key
wt config state clear my-key

State variables are scoped to individual worktrees and stored in the user config. Used by hooks for per-worktree data (e.g., agent activity markers 🤖/💬).

Worktree Activity Tracking

The Claude Code plugin hooks write activity markers to worktree state:

  • BeforeAgent → sets marker to 🤖 (agent running)
  • AfterAgent → sets marker to 💬 (agent finished, human turn)
  • SessionEnd → clears marker

wt list reads these markers to display activity status in the worktree overview.

LLM Commit Message Context

wt step commit passes the staged diff to the configured LLM command as context. The LLM generates a commit message from the diff. This is ephemeral — no cross-session memory.

No Cross-Session Agent Context

Worktrunk does not persist LLM conversation history, vector embeddings, or agent reasoning state. It manages git worktrees and their metadata — the agent's context lives in the agent's own session (Claude Code, Codex, etc.).

Build Cache Sharing

wt step copy-ignored copies build artifacts (node_modules, target/, etc.) from one worktree to another, avoiding cold-start rebuild times when creating new worktrees. This is filesystem-level context sharing, not LLM context.

07

Orchestration

Worktrunk — Orchestration

Multi-Agent Support

Yes — explicitly designed for 5-10+ parallel AI agents. Each agent gets its own git worktree (separate filesystem directory + branch). wt list shows all worktrees with status, CI state, and which ones have active agent sessions.

# Launch multiple agents in parallel
wt switch -x claude -c feature-a -- 'Add user authentication'
wt switch -x claude -c feature-b -- 'Fix the pagination bug'
wt switch -x claude -c feature-c -- 'Write tests for the API'

Isolation Mechanism

Git worktree — each branch gets its own filesystem directory. Not VM or container isolation; agents share the host OS and filesystem but operate in separate directories. This is coordination isolation (prevent file conflicts) rather than security isolation.

Execution Mode

Interactive one-shot per worktree: Each wt switch -x <agent> starts one agent session in one worktree. Worktrunk itself is not a daemon; it manages the lifecycle of worktrees, not of running agents.

Orchestration Pattern

None built-in beyond worktree management. The human (or an orchestrating script) decides which agents to launch and when to merge.

Multi-Model

No within Worktrunk itself. The -x flag can launch any agent; the human decides which agent per worktree. The step commit LLM command is configurable (claude, codex, llm, aichat).

Hook System

Worktrunk provides project-level hooks (in .config/wt.toml) for workflow automation:

[[hooks.post-start]]
run = "npm install"

[[hooks.pre-merge]]
run = "cargo test"

Hook types:

  • post-start: after creating/switching to worktree (install deps, start dev server)
  • pre-merge: before merge (tests, lints)
  • post-merge: after merge (cleanup)
  • pre-commit: before commit
  • post-switch: after directory switch

Claude Code Plugin Hooks

hooks.json (via BeforeAgent/AfterAgent/SessionEnd) tracks which worktrees have active Claude Code sessions. This is observability, not orchestration.

Git Automation

  • wt step commit: LLM-generated commit message + commit staged changes
  • wt merge: squash + rebase + fast-forward merge + branch/worktree cleanup in one command
  • No automatic PRs (user must explicitly gh pr create or similar)

Consensus Mechanism

None.

08

Ui Cli Surface

Worktrunk — UI & CLI Surface

CLI Binary (wt)

  • Binary name: wt (or git-wt on Windows via winget)
  • Language: Rust
  • Is thin wrapper: No — full worktree manager with its own runtime
  • Shell integration: Required for directory-changing commands (wt config shell install)
  • Key command surface:
wt switch [branch]        — switch/create worktree
wt list [--full]          — list worktrees with status
wt remove                 — remove worktree + branch
wt merge [target]         — squash+rebase+merge+cleanup
wt select                 — interactive TUI picker
wt step commit            — LLM commit message + commit
wt step diff/squash/...   — step utilities
wt hook <type>            — run hook
wt config show/create/update/shell/state/plugins — config management

Interactive TUI Picker (wt select)

  • Browse all worktrees
  • Live preview tabs: diff view, log view
  • Keyboard shortcuts: Enter to switch, 15 for preview tabs
  • Shows CI status, ahead/behind counts, commit messages

wt list Output

Rich status display per worktree:

  Branch        Status        HEAD±    main↕  Remote⇅  Commit    Age   Message
@ feature-auth  +   ↑      +27   -8   ↑1               4bc72dc9  2h    Add auth module
^ main              ^⇡                         ⇡1      0e631add  1d    Initial commit

Symbols: @ current, ^ primary, + staged, ahead, unpushed, 🤖 agent active.

wt list --full

Adds:

  • CI status (GitHub Actions, GitLab CI) per branch
  • AI-generated one-line summaries per branch (via LLM command)
  • PR links

Observability

  • wt list --full: CI + AI summaries per worktree
  • Per-worktree state markers (🤖 agent active, 💬 agent finished) via Claude Code plugin
  • [wt-trace] timing in debug logs for all external commands

IDE Integration

Claude Code plugin — activity tracking via BeforeAgent/AfterAgent hooks. Codex and OpenCode plugins also supported (wt config plugins codex install).

Related frameworks

same archetype · same primary tool · same memory type

claude-mem (thedotmack) ★ 78k

Background worker service captures every tool call as an observation, AI-compresses sessions, and auto-injects relevant past…

pi (badlogic/earendil) ★ 55k

A minimal, hackable, multi-provider terminal coding agent that adapts to your workflows via npm-installable TypeScript Extensions…

Agent Skills (Addy Osmani) ★ 46k

Encodes senior-engineer software development lifecycle as 23 auto-routed skills and 7 slash commands for any AI coding agent.

wshobson/agents Plugin Marketplace ★ 36k

Single Markdown source for 83 domain-specialized plugins that auto-generates idiomatic artifacts for five AI coding harnesses.

TabbyML/Tabby ★ 34k

Self-hosted AI coding assistant server (alternative to GitHub Copilot) with admin dashboard, RAG-based completions, and multi-IDE…

Compound Engineering ★ 17k

Make each unit of engineering work compound into easier future work via brainstorm→plan→execute→review→learn cycles.