Agent skill

Runnable Worktrees

by cluesmith in cluesmith/codev

Make builder worktrees runnable — the .codev/config.json worktree block (symlinks, postSpawn, devCommand), the afx dev CLI, VSCode dev controls, and per-stack config recipes.

Apache-2.0Auto-check: notesDevelopment

Install Runnable Worktrees

skills CLI
$ npx skills add cluesmith/codev --skill runnable-worktrees -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cluesmith/codev runnable-worktrees --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cluesmith/codev.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/runnable-worktrees .claude/skills/runnable-worktrees && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
runnable-worktrees
GitHub stars
288
Token cost
~1.6k tokens
SKILL.md length
695 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
Apache-2.0

At a glance

Make builder worktrees runnable — the .codev/config.json worktree block (symlinks, postSpawn, devCommand), the afx dev CLI, VSCode dev controls, and per-stack config recipes.

  • Configuring a repo so reviewers can run a builders branch
  • SKILL.md covers Config: the worktree block, CLI, VSCode and URLs are load-bearing, plus 2 more sections
  • Calls pnpm, cargo and expo
  • Afx dev fails to bind

What it does

Runnable Worktrees is an agent skill from cluesmith/codev. Make builder worktrees runnable — the .codev/config.json worktree block (symlinks, postSpawn, devCommand), the afx dev CLI, VSCode dev controls, and per-stack config recipes. Use when configuring a repo so reviewers can run a builder's branch, when afx dev fails to bind or start, when a dev process is orphaned holding a port, or when asked why worktree dev uses the same ports as main.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git worktrees. It works with Visual Studio Code. The repository describes itself as: Codev helps humans and agents co-develop both the context and the code of the project. The licence is Apache-2.0.

When your agent uses it

  • Configuring a repo so reviewers can run a builders branch
  • Afx dev fails to bind
  • A dev process is orphaned holding a port
  • Asked why worktree dev uses the same ports as main

Example prompts

  • “/runnable-worktrees”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 9cd8607. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm
    • cargo
    • expo
    • turbo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Runnable Worktrees loads about 1.6k tokens when it runs. Until then it costs about 104 tokens; SKILL.md has 695 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~104
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:26
    relative path. Root `.env` and `.codev/config.json` are *always* symlinked regardless.
  • NoteMentions a .env fileSKILL.md:106
    {"worktree": {"symlinks": [".env.local", ".env.development.local", "packages/*/.env", "packages/*/.env.local", "turbo.js
  • NoteMentions a .env fileSKILL.md:109
    **npm** — `{"symlinks": [".env.local", ".env.development"], "postSpawn": ["npm ci"], "devCommand": "npm run dev"}`
  • NoteMentions a .env fileSKILL.md:111
    **yarn** — `{"symlinks": [".env.local"], "postSpawn": ["yarn install --frozen-lockfile"], "devCommand": "yarn dev"}`
  • NoteMentions a .env fileSKILL.md:113
    **bun** — `{"symlinks": [".env.local"], "postSpawn": ["bun install --frozen-lockfile"], "devCommand": "bun dev"}`
  • NoteMentions a .env fileSKILL.md:115
    **cargo** — `{"symlinks": [".env"], "postSpawn": [], "devCommand": "cargo run"}`
  • NoteMentions a .env fileSKILL.md:117
    **poetry / uv** — `{"symlinks": [".env", ".env.local"], "postSpawn": ["uv sync"], "devCommand": "uv run python -m myapp"
  • NoteMentions a .env fileSKILL.md:119
    **go mod** — `{"symlinks": [".env"], "postSpawn": ["go mod download"], "devCommand": "go run ./cmd/server"}`

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from cluesmith/codev at commit 9cd8607, republished under its Apache-2.0 licence (© cluesmith). 695 words, ~1,562 tokens.

Download SKILL.mdSave it as .claude/skills/runnable-worktrees/SKILL.md (or your agent's skills folder).
name
runnable-worktrees
description
Make builder worktrees runnable — the `.codev/config.json` `worktree` block (symlinks, postSpawn, devCommand), the `afx dev` CLI, VSCode dev controls, and per-stack config recipes. Use when configuring a repo so reviewers can run a builder's branch, when `afx dev` fails to bind or start, when a dev process is orphaned holding a port, or when asked why worktree dev uses the same ports as main.

Runnable worktrees

When configured, each builder worktree (.builders/<id>/) becomes runnable: reviewers can run whatever your dev command starts — a dev server, cargo run, expo start, a test watcher, a build script — against the builder's branch without cd'ing, installing, or hunting for the command. Opt-in via .codev/config.json; unconfigured repos see zero behavior change.

Config: the worktree block

jsonc
{
  "worktree": {
    "symlinks":   ["..."],   // globs symlinked from the workspace root into each new worktree
    "postSpawn":  ["..."],   // shell commands run inside each new worktree after createWorktree
    "devCommand": "..."      // consumed by `afx dev <builder-id|main>`
  }
}
  • symlinks — globs resolve from the workspace root and link into the worktree at the same relative path. Root .env and .codev/config.json are always symlinked regardless. Symlinks, not copies, so edits to main's env files reflect instantly in a running dev session. A directory match is silently skipped (a glob cannot mask the worktree's own source) unless the entry ends in a slash: ".local-user-data/" is treated as a literal path and links the directory whole — shared with the parent, not branch-isolated. A dangling link is fine if the source does not exist yet.
  • postSpawn — commands run sequentially with cwd = worktree path. A non-zero exit aborts the spawn loudly; the half-built worktree stays for inspection.
  • devCommand — the foreground command that starts your dev process. Required for afx dev.

Codev does not auto-detect your stack. Pick a recipe below.

CLI

bash
afx dev <builder-id>     # start dev in that builder's worktree
afx dev main             # start dev in the MAIN workspace (Codev-managed)
afx dev --stop           # stop the running dev PTY (builder or main)
afx setup <builder-id>   # re-apply symlinks + postSpawn to an existing worktree (idempotent)

One dev PTY at a time, across {main + all builders} — deliberate; see URLs are load-bearing. main is a reserved target running worktree.devCommand in the main checkout as a Codev-managed, swappable PTY, symmetric with builders. Starting a second target prompts to swap; a same-target request prints the existing terminal URL and exits. Dev PTYs are non-persistent — a Tower restart or crash kills them; re-run to restart.

Start main's dev with afx dev main, not a bare pnpm dev. A hand-run pnpm dev is invisible to Codev (which never kills what it did not spawn), so a builder dev started while it holds the ports either fails to bind or — worse — serves main's code under the worktree URL. afx dev main makes it a managed PTY that swap-detection can stop cleanly. This only helps if used consistently.

VSCode

Right-click a builder row in the Codev sidebar (Builders or Needs Attention):

  • Open Builder Terminal — that builder's AI terminal in a tab (same as left-click).
  • Open Worktree Folder — .builders/<id>/ in the OS file manager.
  • Run Worktree Setup — re-applies worktree.symlinks and worktree.postSpawn to an existing worktree (the git steps are skipped). Idempotent. Use when the lockfile changed, when symlinks/postSpawn grew after the builder spawned, when a link was deleted, or when the original setup aborted. Streams install output in a fresh terminal. CLI: afx setup <id>.
  • View Diff — unified main...HEAD diff for that worktree with a file-list pane.
  • Run Dev / Stop Dev — spawn or kill the dev PTY as a Codev: <name> (dev) tab; prompts to swap if another dev is running.

The sidebar's Workspace view carries a dev control for whatever folder the window is rooted at — the main checkout resolves to main, a .builders/<id>/ window resolves to that builder. The row tooltip names the resolved target. Commands are also in the palette (Cmd+Shift+P); no default keybindings.

Show full SKILL.md (199 more words)Show less

URLs are load-bearing

The dev PTY intentionally uses the same ports and URLs as main. OAuth callbacks, CORS allowlists, cookie scoping, CSP connect-src and webhook URLs are all keyed off origin, so running a worktree on a different port would break them.

Consequence: stop main's dev before starting a builder's, or the spawned dev fails at bind time with EADDRINUSE.

Cleanup and orphan recovery

afx dev --stop and the swap path kill the entire PTY process group (SIGTERM, then SIGKILL after 5s), which signals every grandchild of a monorepo orchestrator (pnpm dev, turbo dev, pnpm -r --parallel run dev) at once. Ports are reclaimed by the OS as a consequence — Codev never manipulates ports directly.

If Tower hard-crashes mid-dev and a process is left holding a port outside Codev's records:

bash
lsof -ti :<port> | xargs kill
lsof -ti :3000,:3001,:4000 | xargs kill

Recipes

pnpm monorepo (Next.js / Turbo)

json
{"worktree": {"symlinks": [".env.local", ".env.development.local", "packages/*/.env", "packages/*/.env.local", "turbo.json"], "postSpawn": ["pnpm install --frozen-lockfile"], "devCommand": "pnpm dev"}}

npm — {"symlinks": [".env.local", ".env.development"], "postSpawn": ["npm ci"], "devCommand": "npm run dev"}

yarn — {"symlinks": [".env.local"], "postSpawn": ["yarn install --frozen-lockfile"], "devCommand": "yarn dev"}

bun — {"symlinks": [".env.local"], "postSpawn": ["bun install --frozen-lockfile"], "devCommand": "bun dev"}

cargo — {"symlinks": [".env"], "postSpawn": [], "devCommand": "cargo run"}

poetry / uv — {"symlinks": [".env", ".env.local"], "postSpawn": ["uv sync"], "devCommand": "uv run python -m myapp"}

go mod — {"symlinks": [".env"], "postSpawn": ["go mod download"], "devCommand": "go run ./cmd/server"}

© cluesmith, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .codex/skills/runnable-worktrees of cluesmith/codev.

Open the folder on GitHubat commit 9cd8607

Compare with similar skills

Runnable Worktrees next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Runnable Worktrees compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Runnable Worktrees this skillcluesmith/codev288—~1.6kAutomated safety check: NotesApache-2.0
Git Worktree Managermicrosoft/WindowsAppSDK4.7k—~2kAutomated safety check: PassMIT
Knowledge Extension Ecosystem Lsp Code IntelligenceechoVic/blade-code181—~1.9kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Migrate Core Code to Submodulestinyhumansai/openhuman42k—~2.6kAutomated safety check: PassGPL-3.0
Finishing A Development Branchfarm-fe/farm5.6k34 repos~1.8kAutomated safety check: PassMIT

Similar skills

  • Git Worktree Manager

    microsoft/WindowsAppSDK

    Official

    Creates and manages Git worktrees with PowerShell scripts so separate issues and Copilot sessions each get an isolated branch, build and test environment.

    4.7k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • 覆盖 Session 级 LSP 配置快照、stdio 进程、文档同步、语义查询、诊断回注、崩溃恢复 和子 Session 继承。进入条件:新增语言服务器、修改 LSP 工具、排查诊断缺失/重复、 处理 worktree 或 ACP 差异、修复进程泄漏或 transport 代际问题。不包含:VS Code 扩展桥接(见…

    181 GitHub stars~1.9k tokensUpdated 10 days ago
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 34 repos~1.8k tokens
    DevelopmentAuto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed

More from cluesmith/codev

All 12 skills in this repo
  • Afx

    cluesmith/codev

    Agent Farm CLI — the tool for spawning builders, managing Tower, workspaces, and cron tasks.

    288 GitHub stars~2.4k tokensUpdated 2 days ago
    Auto-check passed
  • Arch Init

    cluesmith/codev

    Adopt an architect identity and recover its state from codev/state/<name.md.

    288 GitHub stars~2.7k tokensUpdated 2 days ago
    Auto-check passed
  • Arch Save

    cluesmith/codev

    Save an architect's state, clear its context, and re-init automatically — the packaged save→clear→re-init refresh cycle.

    288 GitHub stars~3.8k tokensUpdated 2 days ago
    Auto-check passed
  • Builder Refresh

    cluesmith/codev

    Refresh a builder's own context at a protocol boundary — save working state, verify it, clear, and re-orient.

    288 GitHub stars~1.7k tokensUpdated 2 days ago
    Auto-check passed
  • Codev

    cluesmith/codev

    Codev project management CLI — init, adopt, update, and doctor commands.

    288 GitHub stars~962 tokensUpdated 2 days ago
    Auto-check passed
  • Consult

    cluesmith/codev

    AI consultation CLI — query Gemini, Codex, or Claude for reviews and analysis.

    288 GitHub stars~1.1k tokensUpdated 2 days ago
    Auto-check: notes

Categories

Questions about Runnable Worktrees

What does Runnable Worktrees do?

Make builder worktrees runnable — the .codev/config.json worktree block (symlinks, postSpawn, devCommand), the afx dev CLI, VSCode dev controls, and per-stack config recipes. Runnable Worktrees is an agent skill from cluesmith/codev.json worktree block (symlinks, postSpawn, devCommand), the afx dev CLI, VSCode dev controls, and per-stack config recipes.

When should I use Runnable Worktrees?

Runnable Worktrees fits situations like: configuring a repo so reviewers can run a builders branch; afx dev fails to bind; A dev process is orphaned holding a port; asked why worktree dev uses the same ports as main.

How do I install Runnable Worktrees in Claude Code?

Run `npx skills add cluesmith/codev --skill runnable-worktrees -a claude-code`. Or copy the skill folder (.codex/skills/runnable-worktrees in cluesmith/codev) into .claude/skills/runnable-worktrees in your project. Claude Code loads it when a task matches its description.

How do I install Runnable Worktrees in Codex?

Run `npx skills add cluesmith/codev --skill runnable-worktrees -a codex`. Or copy the skill folder (.codex/skills/runnable-worktrees in cluesmith/codev) into .agents/skills/runnable-worktrees in your project. Codex loads it when a task matches its description.

Can I use Runnable Worktrees in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cluesmith/codev --skill runnable-worktrees -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/runnable-worktrees, .gemini/skills/runnable-worktrees, .github/skills/runnable-worktrees and .opencode/skills/runnable-worktrees in your project.

What does Runnable Worktrees need to run?

Going by SKILL.md and its folder, Runnable Worktrees needs the command-line tools its instructions call (pnpm, cargo, expo and turbo). Our summary lists: Python 3.

Does Runnable Worktrees access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Runnable Worktrees safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Runnable Worktrees use?

Runnable Worktrees is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Runnable Worktrees use?

About 1.6k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Runnable Worktrees?

Skills that share tags, products or a category with Runnable Worktrees: Git Worktree Manager (microsoft/WindowsAppSDK, 4.7k stars), Knowledge Extension Ecosystem Lsp Code Intelligence (echoVic/blade-code, 181 stars), Finishing a Development Branch (obra/superpowers, 296k stars) and Migrate Core Code to Submodules (tinyhumansai/openhuman, 42k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Runnable Worktrees?

cluesmith (a GitHub organization) maintains it in cluesmith/codev, which has 288 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 6, 2026.

Source: cluesmith/codev on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.