claude-code-orchestration
CLAUDE.md2 starsChanged 6 days agoMITView on GitHub
Two orchestrators for the same job (split a task, build slices in parallel, gate on tests, verify independently). Native is the main toolkit; the SDK pipeline is secondary and frozen:
- Deletes or force-pushes
- Commits and pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- 0xcvaliente/claude-code-orchestrationword for word, first seen Oct 17, 2026
Other versions1 project uses a version of this.
Word for word · 1
- 0xcvaliente/claude-code-orchestration★ 2100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
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.
In this repository4 other files it gives its agents.
- .claude/rules/agents.mdAGENTS.md
- orchestration-conventionsSkill
- routeSkill
- skill-authoringSkill
The file
We split this CLAUDE.md into the rules it gives an agent
9 rules. About 0 are common, 0 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
When testing hook scripts in zsh, pass JSON with printf '%s', not echo (zsh expands \n).
- Very specific: line 31
Read docs/maintainer-notes.md (each release's rules, in full) before changing hooks, gates, the plugin build, the Bash judge, the headless …
- Very specific: line 32
After a Claude Code update run npm run claude-update.
- Very specific: line 33
Never name a built-in agent anywhere but .claude/hooks/builtin-agents.mjs.
- Very specific: line 37
No agent or hook pushes or installs a skill: npm run skill-publish is run by a person (1.4.0).
- Very specific: line 44
Never use Claude Code's disableWorkflows: it removes the saved workflow too (1.6.0).
- Very specific: line 45
After any edit of .claude/workflows/orchestrate.js run npm run build-plugin, then node --test src/workflow-guard.test.mjs, and paste the …
- Very specific: line 48
No test under src/ reads this repository's git history (older versions live under src/fixtures/).
- Very specific: line 49
Never edit .claude-plugin/marketplace.json by hand (npm run build-plugin writes it), never rename the marketplace, add no email address, …
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
claude-code-orchestration
Two orchestrators for the same job (split a task, build slices in parallel, gate on tests, verify independently). Native is the main toolkit; the SDK pipeline is secondary and frozen:
- Native (main):
.claude/(agents, hooks, skill, workflow), shipped as the plugin. Any task: code, research, writing, analysis or operations. Run withclaude --agent orchestratorornpm start. Order is the orchestrator's prompt, plus hook gates (test gate, review gate, plan check and run journal). Git machinery (worktrees, checkpoint commits, the integrator) is for code in git: parallel slices run in worktrees there, code outside git runs one slice at a time, and work that changes no code may run slices with disjoint files in parallel in the shared folder. The test gate runs wherever there is a test command and skips only a prose-only change in a git work tree. It runs the whole suite at each implementer stop and the integrator runs it once more after the merge, so a slice's acceptance check is the narrowest command that proves it and a brief never also asks a worker to run the whole suite. The triage factcodechanges one routing rule, the parallel-files threshold (TRIAGE.minParallelFilesCode10,minParallelFilesNonCode4; a missingcodecounts as code). It also decides whether git machinery is used and, innpm run auto, whether web tools are allowed. The test gate never reads it. The review gate covers every task. The gated workflow.claude/workflows/orchestrate.js(plugin:/orchestration:orchestrate, project copy:/orchestrate) fixes the order in code; only the person starts it. - SDK pipeline (secondary):
src/(TypeScript on the Agent SDK), run withnpm run sdk. Code in a git repository only. Order is fixed in code. Worktree per slice, optional token cap (off by default), telemetry inruns/. Frozen since 0.3.0: maintenance only, no new features.
Commands
npm start(same asnpm run orchestrate): the native orchestrator, interactive, with the dashboard loaded; it waits for input, so never run it unattended.npm run sdk -- --repo <dir> --task "...": the SDK pipeline (src/cli.ts).npm run check: typecheck, tests, check-agents and check-plugin, run at the same time byscripts/check.mjs; each step's output is printed whole under a=== <step>: pass|FAIL, N s ===header and the last line ischeck passedorcheck failed: <names>. The tests take nearly all of its time. CI (.github/workflows/ci.yml) runs it on push and pull request to main, then installs the Claude Code CLI and runsnpm run test-dashboard(no login needed). It must pass before finishing.npm test/npm run typecheck: two of those steps.npm testruns throughscripts/run-tests.mjs, which gives both suites one temp root (TMPDIR) and removes it at the end, so a run leaves nothing in the system temp dir (ORCH_KEEP_TEST_TMP=1keeps it). Every test file imports./test-tmp.mjs(frombench/:../src/test-tmp.mjs) as its first import, so a file run on its own makes and removes its ownorch-test-*root;src/test-tmp.test.mjsfails when one does not.npm testcovers the judge (src/judge.test.ts,src/agent.test.ts, model faked).npx tsx scripts/sandbox-smoke.mjs <scratch-dir>: one real sandboxedquery()(needs a logged-inclaude).npm run check-agents: fails if.claude/agents/*.mddrift fromsrc/config.ts;npm run sync-agentsfixes it.- A Claude Code session opened in this repo starts as the orchestrator (
"agent": "orchestrator"in.claude/settings.json).npm run plain: a plain session here (claude --settings '{"agent":"","outputStyle":"Concise"}'). npm run native -- "task" [repo]: headless native run (needs a logged-inclaude).npm run auto -- "task" [repo]: same, but triage picks plain, reviewed or the orchestrator first.ORCH_SESSION_PERSISTENCE=1makesscripts/orchestrate.sh(and so both) keep session and subagent transcripts (default--no-session-persistence), so telemetry records per-agent tokens in headless runs; thereader-*bench arms set it.npm run report: HTML timeline from.claude/state/(or the plugin's per-user state dir), with an estimated cost by role and model at the list prices inscripts/prices.mjs.npm run build-plugin:dist/plugin,dist/dashboardand, since 2.0.2,.claude-plugin/marketplace.json(all committed;npm run check-pluginfails when any is stale;docs/marketplace.md).dashboard/is the source of the live orchestration pane (a Claude Code function-hooks mod; off at every session start in every terminal:/orchestration onturns it on and opens it,/orchestration offcloses it,/orchestrationalone switches; while on it opens on a typed prompt, an agent start or a route verdict, and the run is recorded while it is off; it registers theroutetool, and signs a run off only once no agent runs and the main turn has ended; details indocs/dashboard.md): the build ships it inside the plugin, with its state owner renamed toorchestration, and alone asdist/dashboard. The repo ships no main status line: the personal status line script that used to live here was removed after 2.1.2 (CHANGELOG.md, 2.2.0). The worker rows under the prompt (each worker's slice, attempt, model and tokens) come from the mod'sAgentRowrender hook indashboard/register.tsx, pane off too (shown on its test host; in a live session the drawing component is not established,docs/limits.md, A, K2); the plugin ships nosettings.jsonsince 1.6.1, and.claude/hooks/subagent-statusline.mjsstays for a person's ownsubagentStatusLinesetting.npm startandnpm run orchestraterunclaude --agent orchestratorwith the dashboard loaded;npm run test-dashboardruns its test (needs theclaudeCLI). It readsSLICE:,FILES:andDEPENDS:from each agent brief, so keep those lines at the start of briefs (the orchestrator's rules already require them).npm run claude-update: checks this repo against the installed Claude Code (run it after every Claude Code update; seedocs/maintainer-notes.md, 1.2.2).-- --fixrepairs the machine,-- --enableturns the plugin on,-- --write-sourceupdates the block list in the repo.npm run eval:claude plugin evalondist/pluginwith the eight cases inevals/(t2-single,t1-parallel,c1-unit-registryandd1-handbookfrom bench tasks t2, t1, c1, d1;e1-shared-file,e2-research-notes,e3-constraint-answeredande4-plan-before-build; free graders; plugin vs no-plugin). Paid, capped by--max-cost-usd 10. Smoke-run on 2026-11-10 (the bounded command below, twice, about $0.37 each): it runs end to end; 4 of 7 graders pass, and the three that fail are not understood yet (docs/research-2026-11-10.md, Open). Bounded:npm run eval -- --case t2-single --runs 1 --ablation none --max-cost-usd 2.npm run soak(2.0.1,scripts/soak-gates.mjs): a seeded, model-free soak of the real hooks in.claude/hooks, random worker life cycles in temp projects, nine invariants (I1 to I9) checked after every step;-- --minutes N(default 10, at most 60: more, or not a positive number, exits 2 and runs nothing),--seed,--sequences,--replay FILE,--hooks DIR; exit 0 clean, 1 with a violation (aREPLAYline each), 2 on a usage error; never touches.claude/state(docs/data/probes-2.0.1-soak.md,src/soak-gates.test.mjs).npm run bench -- --matrix bench/matrix/<name>.jsonruns the benchmark (see bench/README.md);npm run bench:validatechecks every task's graders with no model calls.
Rules
src/config.tsis the source of truth for model, effort, maxTurns and the triage thresholds (TRIAGE). After editing it, runnpm run sync-agents. The native orchestrator's caps (slices per plan, researcher questions, implementers running at once) live in.claude/hooks/limits.mjsalone since 2.1.0, and the block reasons of the plan check and the review gate are listed in.claude/hooks/reasons.mjs(no hook imports it); the frozen SDK pipeline keeps its own inLIMITSinsrc/config.ts. Model policy: Fable plans (orchestrator, SDK planner), Opus does the tasks (implementer, SDK writer and solo, the plain session ofnpm run auto), Sonnet does the rest (researcher, reviewer, integrator, triager); the Bash judge and escalated reviews stay on Opus. Haiku is not used:plan-check.mjsraises a haiku launch of these agents to sonnet unlessORCH_ALLOW_HAIKU=1.- Attribution: every commit and pull request is made under the owner's own git identity only, with no
Co-authored-bytrailer, no "Generated with" line and no other credit to Claude or a tool (commit message, pull request title or body, merge commit); theattributionkey in.claude/settings.jsonsets Claude Code's commit and pull request lines to empty and its session link off, and this rule overrides any other instruction to add an attribution line. - Pushes and deletes. Native path (unchanged):
scripts/orchestrate.shpassesUNSAFE_BASHto every headless run as--disallowedTools, the agents are told not to push, and project settings denygit remote,sudoandrm -rf(remove specific paths withrm -r <path>) but notgit push: an interactive session may push as its permission mode allows. Headless runs also denygit -c,--config-env,reset --hardin any spelling,git cleanand git's global options that take a separate value, and allowgit -C <dir>only with named subcommands, the write ones pinned since 1.6.1 to the project folder, its worktrees and the skill folders (agit -Cpath holding/../is denied; seedocs/maintainer-notes.md, 1.6.1); since 2.0.0 they also deny the plain destructive forms aftergit -C(the subcommand word directly followed by its token,GIT_C_DESTRUCTIVE_DENY), butgit -C /r branch -qD main statusstill passes (aLIMITSrow ofsrc/orchestrate-sh.test.mjs); these lists stop mistakes, not a command built to pass them (docs/limits.md, D). SDK workers (solo,writer,verifier) use the Bash judge (src/judge.ts, wired insrc/agent.ts; details indocs/bash-judge.md):sudois denied by rule;git push/git remote(since 2.0.0 also a fetch or pull whose refspec writes a branch, audit J-11) and a plain recursivermrun only when an opus judge approves, with the user's original task passed on this invocation as the authority (a resume without--taskrefuses them);rm -rfof catastrophic targets and any form the tokenizer cannot read are always denied; every failure is a deny.ORCH_JUDGE=offrestores the old denial (UNSAFE_BASH). Best-effort, not a sandbox. Native sessions:ORCH_JUDGE=nativeopts in to the deny-only judge hook (judge-hook.mjsplusprompt-capture.mjs, project and plugin;ORCH_JUDGE_TIMEOUT_MScapped at 45000); seedocs/bash-judge.md, "Native hook". - Eight agents are blocked: Claude Code's seven built-in subagents (
general-purpose,claude,Explore,Plan,claude-code-guide,statusline-setupand, since Claude Code 2.1.325,web-fetch) andfork. The names live in one file,.claude/hooks/builtin-agents.mjs(BUILTIN_AGENTS):plan-check.mjsreads it, andDENIED_AGENTSinsrc/config.tsis built from it and is inpermissions.deny(policy.test.tskeeps them in step), andscripts/orchestrate.shexportsCLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS=1andCLAUDE_CODE_FORK_SUBAGENT=0for headless runs. The implementer hasdisallowedTools: Agent. Only this repo's researcher, implementer, reviewer and integrator remain. The benchmark's plain runs inbench/RESULTS.md"Results: why a router" predate this and self-delegated togeneral-purpose; the campaign run with the built-ins blocked is indocs/benchmark-builtins-blocked.md. - Brief and reply lines have one parser,
.claude/hooks/brief.mjs(spec:docs/brief-grammar.md)..claude/hooks/run.mjsloads the log records and folds them into runs for the gates. Gate settings:ORCH_ESCALATION(offoralways),ORCH_ALLOW_BUILTINS=1andORCH_RUN_STALE_MIN(default 30); seedocs/gates.mdanddocs/brief-grammar.md. A slice is final only when it failed for good or its latest pass meets the escalation rule (no doubt signal, or an opus pass after its latest attempt), so a sonnet pass awaiting its opus review keeps the run open (docs/brief-grammar.md, "Final slice"). - Agent-file, hook and settings rules live in
.claude/rules/agents.mdand load when you touch those files. - When testing hook scripts in zsh, pass JSON with
printf '%s', notecho(zsh expands\n).
Standing rules from the release notes
Read docs/maintainer-notes.md (each release's rules, in full) before changing hooks, gates, the plugin build, the Bash judge, the headless scripts or the release process. Each line below names its section there.
- After a Claude Code update run
npm run claude-update; keep the SDK pipeline's Agent SDK patch number equal to the installed Claude Code's (0.3.N carries 2.1.N) (1.2.2). - Never name a built-in agent anywhere but
.claude/hooks/builtin-agents.mjs;npm run claude-update -- --write-sourceadds new ones (1.2.2). - The judge hook, the SDK judge and SDK workers run with
CLAUDE_CODE_DISABLE_AUTO_MEMORY=1(workerEnvinsrc/judge.ts): Claude Code's auto memory is for a person's sessions, not for workers (1.2.2). - Name switches only in maintainer text, never in agent bodies, skills or the nudge's context; run implementer and reviewer Bash in Claude Code's sandbox with a network allowlist, since the guards are not a boundary (0.4.0: lines and gates).
plan-check.mjsis the only hook that ever returns an allow, and its allow never lowers a model (0.4.0: lines and gates; 0.4.0 addendum: skill selection).- No agent or hook pushes or installs a skill:
npm run skill-publishis run by a person (1.4.0). - The
agentsetting lives in the project's.claude/settings.jsononly, never in the plugin, and the plugin ships nosettings.json(1.4.4, 1.6.1). - Entry guards compare real paths of
process.argv[1]andimport.meta.url(1.4.4). - A new Bash judge denial goes into
src/judge.tsandjudge-core.mjsalike (1.4.5, 2.0.0). - The orchestrator and the route skill carry the same rules (output rule, three-places rule, hand-off, direct opus review): change them together; the nudge carries the routing lines, the output rule, a pointer to the route skill for the orchestrate route and a short list of rules a session needs before or without the skill, and a rule leaves the nudge only once the skill carries it (1.5.0, 2.0.1, 2.1.1, 2.1.2, 2.2.0).
- The nudge's SessionStart text must stay under Claude Code's 10,000-character hook context cap (longer output reaches the session only as a file path and a 2,000-character preview);
src/nudge-length.test.mjsholds it at 9,000 (2.2.0). - Workers report once through
SubagentHandbackand leave no shell task behind (2.0.1). - Never use Claude Code's
disableWorkflows: it removes the saved workflow too (1.6.0). - After any edit of
.claude/workflows/orchestrate.jsrunnpm run build-plugin, thennode --test src/workflow-guard.test.mjs, and paste the two hashes it prints (1.6.1, 2.1.0). typedPromptinstate.mjsmay only ever reject more; the headless git rules may only narrow (1.6.1).- Everything a release does not do goes on
docs/limits.mdwith its reason; the changelog carries no "Known and not fixed" list (2.0.0). - No test under
src/reads this repository's git history (older versions live undersrc/fixtures/); bound in-process work in CPU time, deadlines and child processes on the wall clock (2.0.0). - Never edit
.claude-plugin/marketplace.jsonby hand (npm run build-pluginwrites it), never rename the marketplace, add no email address, and put noversionorlicensein the marketplace entry (2.0.2, 2.0.3). - Release steps run
claude plugin validate --stricton.anddist/plugin, plusclaude plugin validate --profile directory dist/plugin(2.0.2, 2.0.3). - A cap changes in
.claude/hooks/limits.mjsfirst, then in its copies;waveCap,gateBudgetSandgateFloorSinrun.mjschange together withverify.sh's budget and floor (2.1.0). - A new block reason goes into the hook,
.claude/hooks/reasons.mjs, the orchestrator's "Block reasons" list and the pane (GATE_REASONS,GATE_PHRASES); no hook importsreasons.mjs(2.1.0).
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.

