lanes
Skill9 starsChanged 40 days agoMITView on GitHub
Use when coordinating parallel software work in Git worktrees, including starting or resuming lanes, dispatching bounded tasks, reviewing integration, or reporting lane status. Triggers: "/lanes", "lanes start", "resume the lanes", "lane update", "lane update all", "pause lanes", "set up the lanes harness".
- Reads credentials
- Commits and pushes
4 other projects use a version of this.
Adopted by
Most recently taken up by
- joris887/exosuittheir own version, first seen Nov 1, 2026
- KrishP147/skillstheir own version, first seen Nov 1, 2026
- grrowl/bb-lanestheir own version, first seen Oct 20, 2026
- palpen/claude-skillstheir own version, first seen Apr 14, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- KrishP147/skills★ 37same name
- joris887/exosuit★ 9same name
- grrowl/bb-lanes★ 2same name
- palpen/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 5 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
After installing, the user must restart Claude Code before the opus-lane, sonnet-lane, lane-reviewer, deepseek, glm and codex subagents …
- Distinctive: line 25
Ask only for decisions that cannot be inferred: lane cap, priorities, approval limits, and commit trailer policy.
- Very specific: line 30
Before dispatching, give every task a tier, and record it in the tracker and in the lane's lanes.tsv agent column (e.g.
- Distinctive: line 42
Review before merge: every lane's completed work gets an independent reviewer (§3) that is neither the author nor the orchestrator.
- Very specific: line 49
Registry: add or replace the lane's row in $S/lanes.tsv: lane, agent, task, worktree, relay job.
- Very specific: line 59
Every worker returns a 10–12-line summary.
- Distinctive: line 83
After the second FIX for one task, re-tier (§2) before returning to step 2.
- Very specific: line 88
Step 8: run git worktree remove <path> (never --force), then git branch -d <branch>.
- Distinctive: line 89
Step 9: only with push authorization.
- Very specific: line 96
Never pass --force; a rejected non-fast-forward push is reported, not overridden.
- Very specific: line 108
Relay scripts: never edit them in place while jobs run.
- Very specific: line 116
Pause: stop at safe points. For each lane, write a tracker note "PAUSED <date time>" with worktree, SHA, uncommitted work, next step.
- Distinctive: line 119
Ask the user before anything outward-facing or hard to undo: pushes (unless pre-approved), deploys, external writes or sends, deleting …
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lanes: orchestration harness
You are the orchestrator. You plan, dispatch, act on independent review verdicts, integrate and report. You never review lane work yourself: no reading diffs to judge them, no running reviews or acceptance checks on a lane's result. Do all implementation work in assigned worktrees. Use the main worktree only for orchestration, integration, planning, and writing session-detail logs before context compaction. Workers own only their assigned files in their assigned worktrees.
Paths: K=~/.claude/skills/lanes. The per-project state dir comes from S=$(. $K/lane/lane-env.sh; lanes_state), which is ~/.local/state/lanes/<repo>-<hash>/. It holds lanes.tsv (the lane registry) and lanes/<lane>/ (briefs, reports, reviews). In Codex, also read CODEX.md.
0. Setup check (first use on a machine, or when anything fails)
Run bash $K/install.sh --check. If something is missing, run bash $K/install.sh and relay its ACTION lines to the user exactly. Missing API keys are the user's job: they add DEEPSEEK_API_KEY from platform.deepseek.com and OPENROUTER_API_KEY from openrouter.ai/keys to ~/.bashrc. Never ask the user to paste a key into the chat, and never write a key anywhere yourself.
After installing, the user must restart Claude Code before the opus-lane, sonnet-lane, lane-reviewer, deepseek, glm and codex subagents appear. Until then, use the direct commands in §3. They need no restart.
1. Start or resume on a project (/lanes start)
- Read project instructions (
AGENTS.md,CLAUDE.md), the docs index,git worktree list, open branches, and the current tracker state. Use Beads (bd ready,bd list) when present and follow its project constraints. Keep startup notes to current Beads constraints and recovery pointers; retrieve historical memories by topic as needed. Read recent Git history only when it answers a live question. If the project has no tracker, use its existing convention; ask before introducing Beads. Don't invent a parallel TODO file. - Find unfinished work: worktrees with uncommitted changes (never reset them), unmerged branches, notes saying PAUSED, failing CI.
- Build a short plan: done / in progress / ready / blocked, with dependencies. Give every open task a tier (§2), which decides its lane model before anything is dispatched. Show it as the "lane update all" table (§6).
- Ask only for decisions that cannot be inferred: lane cap, priorities, approval limits, and commit trailer policy.
- Save durable decisions and recovery pointers in the project's tracker or memory. Keep startup notes short; retrieve historical memories by topic.
2. Triage, then route (complexity decides the model from the start)
Before dispatching, give every task a tier, and record it in the tracker and in the lane's lanes.tsv agent column (e.g. Opus (T3)). Pick the highest tier any signal points to. When in doubt between two tiers, pick the higher one.
| Tier | Signals (any one is enough) | Dev lane | Review |
| T3 Complex | Legal meaning, security, difficult defects, or final acceptance | Codex Sol or Claude Opus 5.5 at high effort | Independent reviewer (§3) |
| T2 Moderate | Clear multi-file work needing judgment, cross-cutting changes, or unfamiliar code | Codex Sol at medium effort; sonnet-lane at medium effort when a Claude coding worker fits | Independent reviewer (§3) |
| T1 Routine | Well-specified coding or docs task with clear acceptance checks | DeepSeek; GLM for simple bounded tasks | Independent reviewer (§3) |
| T0 Structural | Bounded counts, hashes, format and unchanged-file checks | Codex Luna or deterministic scripts | Deterministic result; inspect failures only |
- Routine coordination: use gpt-6.1-sol at medium effort in Codex and Opus 5.5 at medium effort in Claude Code. Raise effort to high only for legal meaning, security, difficult defects, or final acceptance. Use Luna for bounded structural checks. Use DeepSeek and GLM only for simple, self-contained tasks; choose GLM for the smallest mechanical tasks.
- Re-tier upward: re-tier as soon as a lane reports the task is harder or riskier than triaged, or after two failed reviews at the current tier. Never downgrade a task mid-flight.
- Fix rounds: they usually stay with the author's tier. A fix round for T3 code may go to T1 when the review findings are precise and local.
- Review before merge: every lane's completed work gets an independent reviewer (§3) that is neither the author nor the orchestrator. Fix rounds loop until the verdict is CLEAN.
- DeepSeek and GLM run only in linked worktrees with no
.envfiles;model-relayrefuses anything else. Never send external models secrets, credentials, customer or contact data, or exports. - Tell the user the tier: in status summaries, show each task's tier and assigned model.
3. Dispatch
- Worktree:
$K/lane/new-worktree.sh <branch> [base]creates<repo>/.claude/worktrees/<branch>and wires JS monoreponode_modulesso workspace packages resolve to the worktree. - Registry: add or replace the lane's row in
$S/lanes.tsv: lane, agent, task, worktree, relay job. - Brief: start from
$K/rules/brief-template.mdand keep it short and complete. State inputs, exact file ownership, acceptance checks, tests, token/output cap, and a stop condition. Write the owned paths, one per line (a trailing/owns a directory), to$S/lanes/<lane>/owned.txt, and the acceptance-check commands to$S/lanes/<lane>/checks.sh; the reviewer uses both. Give the worker a completed boundary; start a fresh worker when prior history no longer helps. For Claude agents, reference$K/rules/LANE_RULES.md. For DeepSeek and GLM, paste it. - T3 and T2 lanes:
Agentwithsubagent_type: opus-lane(T3) orsonnet-lane(T2). Until Claude Code restarts after install, use a plainAgentwith model opus or sonnet. - T1 lanes (DeepSeek, or GLM for simple bounded work), preferred from the orchestrator: Bash with
run_in_background: true:cd <worktree> && RELAY_WAIT_S=6000 model-relay deepseek < $S/lanes/<lane>/brief.md(orglm, per the T1 model choice in §2). It costs no Claude tokens, and you are notified on completion. If the output says STILL RUNNING, runmodel-relay --wait <job>. - Classify, on every lane completion event: from the main worktree run
bash $K/lane/integrate.sh --classify $S/lanes/<lane> <branch>. TRIVIAL (prose-only, ≤ 40 lines, no deletes, no agent-instruction, control or legal files) goes straight to step 5 of §4 with no review. Anything else is REVIEW; never override the class. - Independent review, for every REVIEW lane: dispatch one reviewer per completed lane; independent lanes are reviewed in parallel. Give it the worktree, base ref,
owned.txt, tracker id, acceptance checks, and the lane's report path. It follows$K/rules/REVIEW_RULES.md, returns a TASK/REVISION/SCOPE/CHECKS/FINDINGS/VERDICT block, and saves it to$S/lanes/<lane>/review.md. Only the reviewer writes that file; never write or edit it yourself.- Claude Code:
Agentwithsubagent_type: lane-reviewer(Opus 5.5, medium effort). Until restart, a plainAgentwith model opus whose prompt says to follow REVIEW_RULES.md. - Codex: Bash with
run_in_background: true:cd <worktree> && RELAY_WAIT_S=6000 codex-review <base-ref> $S/lanes/<lane>/owned.txt < checklist.md(gpt-5.6-terra, medium effort). It runschecks.shoutside Codex's read-only sandbox, where test runners cannot write temp files, and passes the result in. The checklist is 3–10 task-specific lines, authority first.
- Claude Code:
- Subagents (
deepseek,glm,codex) are guarded haiku relays. Use them when a Task-tool call is more convenient. Give them the worktree path and the full brief or checklist. - Every worker returns a 10–12-line summary; full evidence stays in
<scratch>/report.md. Routine tool-result payloads target 1,000–2,000 tokens. Read full evidence only when a decision needs it. - Verify who did the work: every relay run leaves
~/.local/state/model-relay.*or~/.local/state/codex-review.*withengine/model,cwd,rcand output. Themodel:line comes from real usage data. DeepSeek and GLM call themselves "Claude", and Codex reviewers misname themselves in REVIEWER; trust the relay's recorded model and effort, not self-reports.
4. Per-task flow
Copy this checklist into the lane's tracker note and tick items as they complete:
- [ ] 1. Triage: tier and lane model recorded
- [ ] 2. Dev in worktree; completion event received
- [ ] 3. Classified (§3); if REVIEW, independent reviewer dispatched and review.md saved
- [ ] 4. TRIVIAL, or verdict CLEAN with REVISION equal to the lane head
- [ ] 5. Integrated with `integrate.sh` (exit 0, MERGED line recorded)
- [ ] 6. Required checks pass
- [ ] 7. Tracker item closed with evidence (SHA, hashes, counts, unchanged files)
- [ ] 8. Worktree and branch removed
- [ ] 9. Pushed (only if authorized)
- [ ] 10. Refill from the ready queue- Step 4, act on the verdict (do not re-review):
- TRIVIAL, or CLEAN with a matching REVISION: go to step 5.
- CLEAN with a different REVISION, a missing block, or a failed reviewer run: no verdict. Return to step 3 with a fresh reviewer.
- FIX: send the FINDINGS verbatim to the same lane: the same Agent handle if it is still live, otherwise a fresh worker of the same tier in the same worktree; for T1, re-run
model-relaywith a remediation brief. Then return to step 2. The re-review in step 3 covers the new revision. - After the second FIX for one task, re-tier (§2) before returning to step 2.
- Step 5:
bash $K/lane/integrate.sh $S/lanes/<lane> <branch>from the main worktree is the only way to merge lane work; never rungit mergefor a lane yourself. It re-checks scope and class, requires a CLEAN review.md for the exact head unless TRIVIAL, merges with--no-ff, and logs the merge SHA in$S/lanes/<lane>/integration.log.- Exit 1 (refused): act on the printed reason. No or stale review returns to step 3; a scope failure returns to step 2.
- Exit 3 (conflict, already aborted): return to step 2 to rebase the lane onto the main branch.
- Step 6 fails:
git revert --no-edit -m 1 <merge-sha from integration.log>on the main worktree, return to step 2 in the lane worktree with the failing output, then repeat steps 3 to 6. - Step 8: run
git worktree remove <path>(never--force), thengit branch -d <branch>. If either refuses (dirty worktree or unmerged branch), stop and report it; usegit branch -Donly whengit cherry <main-branch> <branch>prints no+lines (every commit already integrated). Step 9: only with push authorization. The scan must exit 0 first (1 = leaks, 2 = scanner or range problem); any non-zero exit blocks the push and goes to the user:
base=$(git merge-base HEAD origin/<branch> 2>/dev/null || git merge-base HEAD origin/<main-branch>) bash $K/lane/secret-scan.sh "$base" HEAD && git push origin <branch>Never pass
--force; a rejected non-fast-forward push is reported, not overridden.
On the main worktree, do only orchestration, planning, and integration. Stage explicit paths only. Preserve local edits: never commit -a, overwrite, or revert them. If a merge touches a file with local edits, preserve the diff, integrate, then re-apply it.
5. Token discipline
- Completion events: use worker/relay completion notifications and recorded exit status. Do not repeatedly scan all lanes for progress. A completion event triggers the reviewer (§3); the deterministic scope check (
lane/scope-check.sh) runs inside that review, not in the orchestrator. Uselane-status.shonce at startup or when a specific inconsistency needs investigation. - Compact evidence: worker summaries are 10–12 lines. Routine tool results should be capped at 1,000–2,000 tokens. Keep detailed reports on disk and read them only to resolve a decision or failure.
- Usage ledger: append one row per task to
$S/usage.tsv: task/lane, model, input tokens, cached-input tokens, output tokens, failures/retries, acceptance (accepted,rejected, orpending), and evidence path. Use provider-reported usage; mark unavailable fieldsn/a, never estimate them as observed facts. Default task ceilings (fresh plus cached input / output): structural or draft 2,000/500 tokens; routine 12,000/4,000; moderate 24,000/8,000. State the cap in the brief; stop and rebrief if reached. A larger cap needs a short reason. Keep brief-draft outputs at or below 500 tokens. - Watchdog: runs from a timer (
install.sh --watchdog), not a session cron. - Context compaction: before the first context compaction in each session, create one full archive with the
session-detailskill. Before each later compaction in that session, create one incremental archive using the verified checkpoint from the previous archive. Include the current session identity and covered position so the next boundary can be verified.session-detailprints to chat in Claude Code and writes no file, so write the printed archive verbatim to$S/sessions/<its suggested filename>yourself. Do not compact until that file exists. Keep current Beads constraints and recovery pointers in the archive; followsession-detailformat and privacy rules. - Restarts: restart the orchestrator session at quiet points. Before restarting, write a pause note per active lane in the tracker: worktree, SHA, uncommitted work, and next step.
- Relay scripts: never edit them in place while jobs run. Re-run
install.sh, which replaces them atomically.
6. Reports
- Status reports: target 10–12 lines. Lead with blockers or completed events, then list only changed lane states, decisions, and next steps. Avoid speculative percentages and repeated full status tables.
lane update allmay use one concise table when the user needs the whole tracker.
7. Pause / resume
- Pause: stop at safe points. For each lane, write a tracker note "PAUSED
<date time>" with worktree, SHA, uncommitted work, next step. Remove its test containers:docker ps -aq --filter label=lanes.lane=<lane> | xargs -r docker rm -f. - Resume: subagents do not survive a session restart. Dispatch new ones into the SAME worktrees, telling them to continue the existing work. Reattach relay jobs with
model-relay --waitorcodex-review --wait.
Ask the user before anything outward-facing or hard to undo: pushes (unless pre-approved), deploys, external writes or sends, deleting branches with unmerged work, history rewrites. Ask one question per message.
Additional reference files
These files are also linked from other references. They are listed here so each one is one level from this file.
rules/REVIEW_RULES.md, used byCODEX.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

