Agent Integration
Worktrunk ships a plugin for each supported agent CLI. What a plugin provides depends on the hooks that CLI exposes:
| Capability | Claude Code | Codex | OpenCode | Gemini CLI |
|---|---|---|---|---|
| Configuration skill | β | β | β | |
Activity tracking (π€/π¬ in wt list) | β | β | β | β |
| Worktree isolation | β | |||
/wt-switch-create command | β |
The configuration skill is documentation the agent reads to help set up LLM commits, hooks, and troubleshooting. Activity tracking shows which worktrees have running sessions. Worktree isolation needs worktree-lifecycle hooks and /wt-switch-create needs session working-directory switching β both Claude Code-only, so Codex, OpenCode, and Gemini users invoke wt switch --create and wt remove directly. Codex tracks activity through its own turn-end (Stop) hook, but has no session-exit event, so a marker persists after a Codex session ends until the next session or a manual wt config state marker clear.
Installation
Claude Code
wt config plugins claude install
Manual equivalent:
claude plugin marketplace add max-sixty/worktrunk
claude plugin install worktrunk@worktrunk
Codex
wt config plugins codex install
This configures the Worktrunk marketplace in Codex. Then run /plugins in Codex and install Worktrunk from the marketplace. Manual equivalent:
codex plugin marketplace add max-sixty/worktrunk
To remove the marketplace entry, run wt config plugins codex uninstall. Already-installed plugins are left unchanged.
OpenCode
wt config plugins opencode install
This writes the activity-tracking plugin to OpenCode's global plugins directory, ~/.config/opencode/plugins/worktrunk.ts (honoring $OPENCODE_CONFIG_DIR and $XDG_CONFIG_HOME). wt config plugins opencode uninstall removes it.
Gemini CLI
gemini extensions install https://github.com/max-sixty/worktrunk
Gemini loads the extension natively from the repository, so there is no wt wrapper. gemini extensions uninstall worktrunk removes it.
Configuration skill
With the /worktrunk skill, the agent can help with:
- Setting up LLM-generated commit messages
- Adding project hooks (pre-start, pre-merge, pre-commit)
- Configuring worktree path templates
- Fixing shell integration issues
Claude Code is designed to load the skill automatically when it detects worktrunk-related questions.
Activity tracking
The Claude Code, Codex, OpenCode, and Gemini plugins track agent sessions with status markers in wt list:
wt list
Branch Status HEADΒ± mainβ mainβ¦Β± Remoteβ
Path Commit Age Message
@ main ^β‘ β‘1 . 33323bc1 1d Initial commit
+ feature-api β π€ β1 +1 ../repo.feature-api 70343f03 1d Add REST API endpoints
+ review-ui ? β π¬ β1 +1 ../repo.review-ui a585d6ed 1d Add dashboard component
+ wip-docs ? β ../repo.wip-docs 33323bc1 1d Initial commit
β Showing 4 worktrees, 2 with changes, 2 ahead
- π€ β agent is working
- π¬ β agent is waiting or idle
The Claude Code, OpenCode, and Gemini plugins clear the marker when a session ends. A stale marker can remain if the agent process is killed before its session-end hook runs. Codex exposes no session-exit event, so its marker always persists after a session ends. In every case, wt config state marker clear removes a marker manually.
Manual status markers
Set status markers manually for any workflow:
wt config state marker set "π§" # Current branch
wt config state marker set "β
" --branch feature # Specific branch
git config worktrunk.state.feature.marker '{"marker":"π¬","set_at":0}' # Direct
Worktree isolation (Claude Code only)
Claude Code agents can run in isolated worktrees (isolation: "worktree"). By default, Claude Code creates these with git worktree add. The plugin's WorktreeCreate and WorktreeRemove hooks route this through wt switch --create and wt remove instead, so worktrees created by agents get worktrunk's naming conventions, hooks, and lifecycle management.
/wt-switch-create command (Claude Code only)
/wt-switch-create [<branch>] [<repo>] [-- <task>] starts a task in a fresh worktree without leaving the session: it creates the worktree, switches into it, and runs the task (all arguments optional). The worktree persists like any other; merge or remove it with wt merge / wt remove.
Statusline (Claude Code only)
wt list statusline --format=claude-code outputs a single-line status for the Claude Code statusline. When the CI status cache is stale, this fetches from the network β typically 1β2 seconds β making it suitable for async statuslines but too slow for synchronous shell prompts. If a faster version would be helpful, please open an issue.
~/w/myproject.feature-auth !π€ @+42 -8 β3 β‘1 #3035 Opus π 65% 1.4Γ(10amβ3pm)
When Claude Code provides context window usage via stdin JSON, a moon phase gauge appears (πβπ as context fills). A <n>Γ(<window>) segment appears when Claude's 5-hour or weekly rate limit is on track to be hit before reset β 1.4Γ(10amβ3pm) reads as 1.4Γ the pace that would exactly fill that window. Its colour deepens with severity β dim, then dim-yellow, then yellow β as more of the window would be spent locked out at the cap, so a fast pace that would only tip over near the reset stays dim. Above 90% used it shows usage instead of pace β 93%(10amβ3pm) β near the cap, how much is left matters more than how fast it's going.
Add to ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "wt list statusline --format=claude-code"
}
}