kdcokenny

opencode-worktree: Automate Isolated Git Worktrees for OpenCode

An OpenCode V1 plugin that creates Git worktrees, syncs configured files, and launches each one in a separate terminal with OpenCode running. It is archived, with no planned OpenCode V2 port.

Stars
728
Forks
42
Stars, last 14 days
+0
Last commit
24 days ago
Contributors
1

Our take

Archivedarchived by its owners on GitHub, read-only

Health score

19/100

How it is scored
Activity
31
Community
4
Issues
21
Pull requests
21

+0 stars in the last 14 days

  • Fewer contributors than 91% of the projects we track

This is a focused convenience plugin for OpenCode V1, but its archived status and lack of a V2 port make it a legacy choice rather than a forward-looking adoption.

Good fit if

  • You already use OpenCode V1 and want AI-triggered worktree and terminal setup.
  • Your workflow benefits from configurable file syncing and lifecycle hooks.
  • You can accept an MIT-licensed project whose maintenance has ended, with its work largely dependent on one contributor.

Look elsewhere if

  • You use OpenCode V2, whose native worktree workflows are the recommended direction in the project README.
  • You need ongoing maintenance or issue support: the repository is archived, with no recent issue closures or merged pull requests recorded.
  • You want a maintained release cadence: there have been no releases in the past year.
All health signals
Last commit2026-09-16 (24 days ago)
Commits, last 90 days3
Releases, last 12 months0
Contributors1
Issues closed, last 90 days0
Pull requests merged, last 90 days0
Project age9 months

Checked on 2026-10-11 with the GitHub API.

Overview

opencode-worktree is a plugin for OpenCode V1 that turns Git worktree creation and cleanup into an AI-driven workflow. Creating a worktree can sync files, run setup hooks, and open a terminal with OpenCode ready; deleting one can run cleanup hooks, commit changes, and remove the worktree.

It is aimed at CLI-first developers who want AI-assisted tasks isolated from their main checkout without handling each setup step manually. The project is retired and has no planned OpenCode V2 port, so it is relevant mainly to existing OpenCode V1 users or people maintaining a fork.

Key Features

  • Adds worktree_create and worktree_delete tools for creating and removing Git worktrees.
  • Opens a new terminal session with OpenCode in each created worktree.
  • Copies selected files and symlinks configured directories, such as environment files and dependencies.
  • Supports post-create and pre-delete shell hooks for project setup and cleanup.
  • Stores worktrees outside the repository under OpenCode's local data directory.
  • Supports common terminals across macOS, Linux, and Windows, as well as tmux and cmux workflows.
  • Can commit changes automatically before removing a worktree.

Use Cases

  • OpenCode V1 users can delegate a feature experiment to an isolated worktree while keeping their primary checkout untouched.
  • CLI-first developers can start separate OpenCode sessions for parallel tasks without manually opening and configuring terminals.
  • Teams with per-worktree setup needs can sync selected files and run commands such as dependency installation or container startup.
  • Existing users who need to keep a legacy V1 workflow running can use the published code as-is or maintain a fork.

What you need

Detected in the repository

  • TypeScript (main language on GitHub)

License in plain words

MITpermissive

  • Commercial use: yes
  • Modify and redistribute: yes
  • You must keep: the copyright and license notice
  • Share your changes: no

A summary, not legal advice: the LICENSE file is what applies.

Getting Started

For the legacy OpenCode V1 installation, the README gives this OCX command:

ocx add kdco/worktree --from https://registry.kdco.dev

See the README for configuration and manual installation details. The repository advises OpenCode V2 users to use its native workspace/worktree workflows or ordinary Git worktrees instead.

Alternatives

  • agent-worktrees: It manages isolated worktrees for Claude Code from VS Code, rather than creating and launching OpenCode worktrees from a plugin.
ProjectLanguageLicenseStarsStatus
opencode-worktreeTypeScriptMIT728Archived
agent-worktreesTypeScriptMIT1New

Considerations

  • The repository is archived and explicitly retired for OpenCode V1; the owners do not plan a V2 port. Its lifecycle hooks, automatic terminal handoff, and OCX environment bridge are not part of the V2 migration.
  • The project has had recent commits, but no releases in the past year. Maintenance and source synchronization have ended, and the measured contributor history is concentrated in one person.
  • Shell hooks run with the user's privileges in the worktree directory. Review configured commands before using them.
  • Terminal behavior varies by environment. Some terminals open a new window rather than a tab, and some integrations require additional terminal configuration.
  • The README says worktrees can also be used in OpenCode Desktop, but automatic terminal spawning is a CLI-oriented feature.

Found this useful?

Share it with someone who would like opencode-worktree.

Comparisons