SkillsLLM
CategoriesBlogAI NewsAbout
HomeAI Agentsopencode-worktree

opencode-worktree

by kdcokenny

Pending

Zero-friction git worktrees for OpenCode. Auto-spawns terminals, syncs files, cleans up on exit.

291stars
14forks
TypeScript
Added 3/9/2026
View on GitHubDownload ZIP
AI Agentsaiai-assistantai-codingdeveloper-toolsgitgit-worktreeopencodeopencode-pluginterminal-automationworktree
Installation
# Add to your Claude Code skills
git clone https://github.com/kdcokenny/opencode-worktree
README.md

opencode-worktree

Git worktrees that spawn their own terminal. Zero-friction isolation for AI-driven development.

An OpenCode plugin that creates isolated git worktrees—where each worktree automatically opens its own terminal with OpenCode running inside. No manual setup, no context switching, no cleanup work.

Why This Exists

You already know you can create git worktrees manually. Or use OpenCode Desktop's UI. So why this plugin?

Manual worktrees require setup: create the worktree, open a terminal, navigate to it, start OpenCode. OpenCode Desktop gives you worktrees, but locks you into the GUI workflow. Each approach has friction.

This plugin eliminates that friction. When the AI calls worktree_create, your terminal spawns automatically, OpenCode is already running, and files are synchronized. When it calls worktree_delete, changes commit automatically and the worktree cleans itself up. It's the difference between having a tool and having a workflow.

Works great standalone, but pairs especially well with tmux for seamless window management. When running inside tmux, worktrees spawn as new windows instead of separate terminal apps—keeping everything organized in a single terminal session with zero external window overhead.

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, integrated experience | Tied to desktop app, less automation | | This plugin | AI-driven workflows, automation, CLI-first users | Adds plugin dependency to your project |

If you prefer manual control or work exclusively in OpenCode Desktop, you may not need this. But if you want AI agents to seamlessly create and manage isolated development sessions—complete with automatic terminal spawning and state cleanup—this is what you're looking for.

How It Works

flowchart LR
    A[Create Worktree] --> B{Terminal Spawns}
    B --> C[OpenCode Running]
    C --> D[Work in Isolation]
    D --> E[Delete Worktree]
    E --> F{Auto-commit & Cleanup}
    F --> G[Session Ends]
  1. Create - AI calls worktree_create("feature/dark-mode")
  2. Terminal spawns - New window opens with OpenCode at ~/.local/share/opencode/worktree/<project-id>/feature/dark-mode
  3. Work - AI experiments in complete isolation
  4. Delete - AI calls worktree_delete("reason")
  5. Cleanup - Changes commit automatically, git worktree removed

Worktrees are stored in ~/.local/share/opencode/worktree/<project-id>/<branch>/ outside your repository.

Installation

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

If you don't have OCX installed, install it from the OCX repository.

Optional: Install kdco-workspace for the full experience—it bundles worktrees with...

Comments (0)
to leave a comment.

No comments yet. Be the first to share your thoughts!

Related Skills

n8n

by n8n-io

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
178,903
55,726
TypeScript
MCP Serversaiapis
View details
gemini-cli

by google-gemini

An open-source AI agent that brings the power of Gemini directly into your terminal.
97,469
12,195
TypeScript
AI Agentsaiai-agents
View details
everything-claude-code

by affaan-m

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
73,757
9,228
JavaScript
AI Agentsai-agentsanthropic
View details
TrendRadar

by sansan0

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
48,795
22,617
Python
MCP Serversaibark
View details
awesome-claude-skills

by ComposioHQ

A curated list of awesome Claude Skills, resources, and tools for customizing Claude AI workflows
43,513
4,373
Python
AI Agentsagent-skillsai-agents
View details
chatgpt-on-wechat

by zhayujie

CowAgent是基于大模型的超级AI助理,能主动思考和任务规划、访问操作系统和外部资源、创造和执行Skills、拥有长期记忆并不断成长。同时支持飞书、钉钉、企业微信应用、微信公众号、网页等接入,可选择OpenAI/Claude/Gemini/DeepSeek/ Qwen/GLM/Kimi/LinkAI,能处理文本、语音、图片和文件,可快速搭建个人AI助手和企业数字员工。
42,164
9,820
Python
AI Agentsaiai-agent
View details