Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

docs(skill): support OpenCode in agent handoffs section (#2108)

Worktrunk Botc0059a533d89
diff --git a/docs/content/tips-patterns.md b/docs/content/tips-patterns.md
index 09fd3dcf4..357f22a4c 100644
--- a/docs/content/tips-patterns.md
+++ b/docs/content/tips-patterns.md
@@ -233,7 +233,7 @@ Creates a worktree that builds on the current branch's changes.
## Agent handoffs
-Spawn a worktree with Claude running in the background:
+Spawn a worktree with an agent CLI running in the background. Examples below use `claude`; for OpenCode, replace `claude` with `'opencode run'`.
**tmux** (new detached session):
{{ terminal(cmd="tmux new-session -d -s fix-auth-bug "wt switch --create fix-auth-bug -x claude -- \||| 'The login session expires after 5 minutes. Find the session timeout config and extend it to 24 hours.'"") }}
@@ -241,9 +241,9 @@ Spawn a worktree with Claude running in the background:
**Zellij** (new pane in current session):
{{ terminal(cmd="zellij run -- wt switch --create fix-auth-bug -x claude -- \||| 'The login session expires after 5 minutes. Find the session timeout config and extend it to 24 hours.'") }}
-This lets one Claude session hand off work to another that runs in the background. Hooks run inside the multiplexer session/pane.
+This lets one agent session hand off work to another that runs in the background. Hooks run inside the multiplexer session/pane.
-The [worktrunk skill](@/claude-code.md) includes guidance for Claude Code to execute this pattern. To enable it, request it explicitly ("spawn a parallel worktree for...") or add to `CLAUDE.md`:
+The [worktrunk skill](@/claude-code.md) includes guidance for Claude Code (and other agent CLIs that load it) to execute this pattern. To enable it, request it explicitly ("spawn a parallel worktree for...") or add to your project instructions (`CLAUDE.md` or `AGENTS.md`):
```markdown
When I ask you to spawn parallel worktrees, use the agent handoff pattern
diff --git a/docs/static/.well-known/agent-skills/index.json b/docs/static/.well-known/agent-skills/index.json
index 3abc85bcb..3ff4500c7 100644
--- a/docs/static/.well-known/agent-skills/index.json
+++ b/docs/static/.well-known/agent-skills/index.json
@@ -6,7 +6,7 @@
"type": "skill-md",
"description": "Guidance for Worktrunk, a CLI tool for managing git worktrees. Covers configuration (user config at ~/.config/worktrunk/config.toml and project hooks at .config/wt.toml), usage, and troubleshooting. Use for \"setting up commit message generation\", \"configuring hooks\", \"automating tasks\", or general worktrunk questions.",
"url": "./worktrunk/SKILL.md",
- "digest": "sha256:dbd54a717dcb6862e2cd467aa4959a47898e4afdfac5cbb4c3d87648b4bec969"
+ "digest": "sha256:860d43ce7eb280e80400ac841a06b52a5f3da34dc822b86d2d0af7f2e6f2e18a"
}
]
}
diff --git a/skills/worktrunk/SKILL.md b/skills/worktrunk/SKILL.md
index 7fd54857d..1c277b503 100644
--- a/skills/worktrunk/SKILL.md
+++ b/skills/worktrunk/SKILL.md
@@ -248,33 +248,33 @@ grep -A 20 "## Warning Messages" reference/shell-integration.md
## Advanced: Agent Handoffs
-When the user requests spawning a worktree with Claude in a background session ("spawn a worktree for...", "hand off to another agent"), use the appropriate pattern for their terminal multiplexer:
+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 appropriate pattern for their terminal multiplexer. Substitute `<agent-cli>` with the CLI you are running as: `claude` for Claude Code, `'opencode run'` for OpenCode.
**tmux** (check `$TMUX` env var):
```bash
-tmux new-session -d -s <branch-name> "wt switch --create <branch-name> -x claude -- '<task description>'"
+tmux new-session -d -s <branch-name> "wt switch --create <branch-name> -x <agent-cli> -- '<task description>'"
```
**Zellij** (check `$ZELLIJ` env var):
```bash
-zellij run -- wt switch --create <branch-name> -x claude -- '<task description>'
+zellij run -- wt switch --create <branch-name> -x <agent-cli> -- '<task description>'
```
**Requirements** (all must be true):
- User explicitly requests spawning/handoff
- User is in a supported multiplexer (tmux or Zellij)
-- User's CLAUDE.md or explicit instruction authorizes this pattern
+- The user's project instructions (`CLAUDE.md` or `AGENTS.md`) or an explicit prompt authorize this pattern
**Do not use this pattern** for normal worktree operations.
-Example (tmux):
+Example (tmux, Claude Code):
```bash
tmux new-session -d -s fix-auth-bug "wt switch --create fix-auth-bug -x claude -- \
'The login session expires after 5 minutes. Find the session timeout config and extend it to 24 hours.'"
```
-Example (Zellij):
+Example (Zellij, OpenCode):
```bash
-zellij run -- wt switch --create fix-auth-bug -x claude -- \
+zellij run -- wt switch --create fix-auth-bug -x 'opencode run' -- \
'The login session expires after 5 minutes. Find the session timeout config and extend it to 24 hours.'
```
diff --git a/skills/worktrunk/reference/tips-patterns.md b/skills/worktrunk/reference/tips-patterns.md
index 64c7a696b..0e1263c3f 100644
--- a/skills/worktrunk/reference/tips-patterns.md
+++ b/skills/worktrunk/reference/tips-patterns.md
@@ -244,7 +244,7 @@ Creates a worktree that builds on the current branch's changes.
## Agent handoffs
-Spawn a worktree with Claude running in the background:
+Spawn a worktree with an agent CLI running in the background. Examples below use `claude`; for OpenCode, replace `claude` with `'opencode run'`.
**tmux** (new detached session):
```bash
@@ -258,9 +258,9 @@ $ zellij run -- wt switch --create fix-auth-bug -x claude -- \
$ 'The login session expires after 5 minutes. Find the session timeout config and extend it to 24 hours.'
```
-This lets one Claude session hand off work to another that runs in the background. Hooks run inside the multiplexer session/pane.
+This lets one agent session hand off work to another that runs in the background. Hooks run inside the multiplexer session/pane.
-The [worktrunk skill](https://worktrunk.dev/claude-code/) includes guidance for Claude Code to execute this pattern. To enable it, request it explicitly ("spawn a parallel worktree for...") or add to `CLAUDE.md`:
+The [worktrunk skill](https://worktrunk.dev/claude-code/) includes guidance for Claude Code (and other agent CLIs that load it) to execute this pattern. To enable it, request it explicitly ("spawn a parallel worktree for...") or add to your project instructions (`CLAUDE.md` or `AGENTS.md`):
```markdown
When I ask you to spawn parallel worktrees, use the agent handoff pattern