runnable-worktrees

A configuration and command set that makes isolated Git worktrees—separate working directories for branches—ready to run and review.

In plain words
What is it for?
Use it to configure shared symlinks, setup commands, and a development command for builder worktrees, then start them with afx dev.
Why use it?
It removes the need to manually install dependencies, link shared files, or find the right development command for each worktree.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/cluesmith/codev/runnable-worktrees
Any agent
npx skills add cluesmith/codev --skill runnable-worktrees
Clone the repo
git clone --depth 1 https://github.com/cluesmith/codev

Made for: Claude Code, Codex.

Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,671 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00102 $0.01671
Opus 5 $0.00051 $0.00835
Sonnet 5 $0.00020 $0.00334
Haiku 4.5 $0.00010 $0.00167

Measured yesterday against content hash 10acc07b997b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

runnable-worktrees scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/runnable-worktrees/SKILL.md · 120 lines

How it starts

The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

{
  "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

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.

Read the full file on GitHub · 120 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 120 lines · 102 tokens per session scan A 10acc07b997b

Subscribe to this mod's changes

runnable-worktrees is a skill published in the GitHub repository cluesmith/codev (286 stars, last pushed 5d ago), licensed Apache-2.0. It adds 102 tokens to every session and 1,671 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories