Opencode Worktree
このコンテンツはまだ日本語訳がありません。
Opencode Worktree is a community plugin (part of the KDCO/OCX ecosystem, not affiliated with OpenCode) providing git worktrees that spawn their own terminal for AI-driven development.
When to use this
| Approach | Best for | Tradeoffs |
|---|---|---|
| Manual git worktree | One-off experiments, full control | Manual setup, no auto-cleanup, context switching |
| OpenCode Desktop UI | Visual workflow | Tied to the desktop app, less automation |
| This plugin | AI-driven workflows, CLI-first users | Adds a plugin dependency to your project |
How it works
When the AI calls worktree_create, your terminal spawns automatically with OpenCode already running inside and files synchronized. When it calls worktree_delete, changes commit automatically and the worktree cleans itself up.
Installation
ocx add kdco/worktree --from https://registry.kdco.dev
If you don’t have OCX installed, get it from the OCX repository. Optional: install kdco-workspace for the full experience — it bundles worktrees with background agents, planning tools, and notifications. Manual installation (copying src/ to .opencode/plugin/) loses OCX’s dependency management and automatic updates.
Pairing
Works great standalone, and pairs especially well with cmux for agentic workflows; tmux is also supported.