orchestrate

orchestrate is a command for Claude Code from LunarWerxs/AgentHydra. It costs 33 tokens per session (3,319 once invoked), scanned A, original, MIT.

A command that coordinates multiple coding-agent sessions by checking their state, gating chats, acting on the results, and delivering staged work.

In plain words
What is it for?
Use it to census open agent instances, review every chat, identify blocked or nearly full sessions, detect collisions, and process the orchestrator’s recommended next steps.
Why use it?
It prevents actions from being taken before every chat has been checked and highlights stalled sessions, handoffs, holds, and shared-worktree conflicts.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: reads .claude/ paths.

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 commands/lunarwerxs/agenthydra/orchestrate
Clone the repo
git clone --depth 1 https://github.com/LunarWerxs/AgentHydra

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for orchestrate

README.md
[![agentmods](https://agentmods.dev/badge/commands/lunarwerxs/agenthydra/orchestrate.svg)](https://agentmods.dev/commands/lunarwerxs/agenthydra/orchestrate)
Your own site
<a href="https://agentmods.dev/commands/lunarwerxs/agenthydra/orchestrate"><img src="https://agentmods.dev/badge/commands/lunarwerxs/agenthydra/orchestrate.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,319 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.1 $0.00033 $0.03319
Opus 5 $0.00016 $0.01659
Sonnet 5 $0.00007 $0.00664
Haiku 4.5 $0.00003 $0.00332

Measured today against content hash 8bfcb0a89ddb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

orchestrate 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 today.

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/commands/orchestrate.md · 163 lines

How it starts

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

THIS DRIVES THE ORCHESTRATOR - orchestrator/ inside the AgentHydra repo (owner order, 2026-09-03: it moved back in "so I don't have to explain that you have to use both"): the v3 rewrite, individual Python scripts (stdlib-only) talking to the AgentHydra daemon over HTTP, now driven through the AgentHydra MCP server's own tools - orchestrator_menu, orchestrator_run {script, args}, orchestrator_loop, orchestrator_switch. Every tool call below has a shell twin (python orch.py <script> ... from orchestrator/); use the tools, they are the same code. The v1/v2 MCP-tool flow (prestart, chat_sweep, courier tools) is GONE; if you find yourself reaching for those, you are reading old habits, not this command. The division of labor is owner law: THE CODE decides state and executes batches; YOU answer only the precise callouts it hands back. Never re-implement any of it, never bypass a rails refusal with raw daemon calls. orchestrator/README.md explains anything that surprises you. Extra instructions, if any: $ARGUMENTS

⛔ A TARGETED MOVE IS NOT A PASS - DO NOT ARM FOR IT (learned 2026-09-03, moving four chats off one account took ~20 minutes that should have been ~1). migrate_chat and chats --move-to are HAND-RUN acts: they do not read the tray icon at all (the icon gates the UNATTENDED lanes, which is the whole point of it), so arming buys a move nothing. What arming DOES do is resume saturate, whose job is to WAKE dormant chats - and a chat with a live engine cannot move until it has been quiet 300 seconds. So when the extra instructions say "move the chats from X" or anything else that is one deliberate act on named chats:

  1. orchestrator_switch {action:"armed"} - if the icon is DOWN, leave it down.
  2. orchestrator_run {script:"chats", args:["--instance","<from>","--move-to","<to>"]} to PLAN, then the same with "--yes","--idle-wait","330" to do it. --idle-wait sleeps out the ONE refusal time cures (turn finished, five minutes not yet up) inside the command, instead of you re-running it on a guess; a working or stuck engine still refuses in a second. The headline counts what LANDED - "N of M attempted" is a partial, read it.
  3. A chat HELD as a duplicate still moves - migrate_chat <id> --to <to> --force --stop-idle --idle-wait 330, one chat per command, because --force is a person's word for ONE act and chats deliberately has no batch form of it. The hold survives the move.
  4. Pick a destination WITHOUT a chat of the same title already on it (audit_twins names the collisions) - identical titles on one account are what the sidebar cannot tell apart.
  5. THEN, if the owner also wants the pass, arm. Never the other way round. Verify with chats --account <from> --all: the answer you want is "holds NO chats".

THE PASS, in order:

  1. orchestrator_loop {} - DRY: census, gate, accounts and usage bands, the four lanes, naming, reconcile, and the judgment queue; touches nothing. STOP AND INVESTIGATE if the census sanity rail fails (0-1 open instances means detection is broken, not a quiet fleet) or the plan reports INCOMPLETE (a read failed; every lane is a lower bound).

  2. orchestrator_run {script:"sweep", args:["--all","--yes"]} - THE ACTING PASS, within caps: archives, console landings (naming pass included), balance moves, staged deliveries - each through its own act script's rails (hold, live-writer, breaker, T-0 recheck, verified outcome). Read the per-row outcomes. A refusal names its reason and is not yours to force; a breaker or hold is information, not an obstacle.

  3. orchestrator_run {script:"interview", args:["--ask"]} - THE JUDGMENT QUEUE, the only part that is yours, and THE PART THAT MAKES CHATS RUN - a pass that leaves it unanswered is a failed pass (the owner's complaint that forced this line, 2026-08-31: "all my chats are sitting idle and it's not making them run"). Each question is self-contained: the chat's own last words plus the exact answer format. Write orchestrator/answers.json ({"answers":[{"sessionId":...,"decision":"reply|hold|archive|skip", ...}]}). THE PROGRESS DEFAULT (owner doctrine): a chat that offers to continue or names its next step gets a REPLY saying which thing to do; hold and skip demand a reason a person would accept, and "waiting on the owner" only counts when the decision is genuinely his (spend, live customers, public exposure, another person's lane). When last words are not enough, open the chat in the desktop and READ it - never guess. Then orchestrator_run {script:"interview", args:["--apply","answers.json"]} - each decision executes through the rails; replies are STAGED and the sweep/courier delivers them under the machine-wide 18-running cap (deferred wakes stay staged; the 5-minute cycle is the round robin).

Read the full file on GitHub · 163 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. today Changed · +10 lines 8bfcb0a89ddb
  2. 2d ago Changed · +115 lines · +10 tokens per session ddc30d84fa5e
  3. 6d ago First seen · 38 lines · 23 tokens per session scan A 8fb9d1d597a9

Subscribe to this mod's changes

orchestrate is a command published in the GitHub repository LunarWerxs/AgentHydra (43 stars, last pushed today), licensed MIT. It adds 33 tokens to every session and 3,319 once invoked, about $0.0002 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.