orchestrate-saga

A command that builds a short, structured prompt for coordinating work on a saga, meaning a larger piece of work made up of related tasks. It can include research documents and recorded decisions, then starts the goal process.

In plain words
What is it for?
Use it with a saga ID to prepare an orchestrator prompt, optionally adding document IDs, decision IDs, or extra instructions.
Why use it?
It gathers the saga’s current context and keeps the coordination prompt within a strict length limit. This reduces missing context when planning multi-task work.

Command for Claude Code

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/kryptobaseddev/cleo/orchestrate-saga
Clone the repo
git clone --depth 1 https://github.com/kryptobaseddev/cleo

Made for: Claude Code.

Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,702 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00019 $0.02702
Opus 5 $0.00010 $0.01351
Sonnet 5 $0.00004 $0.00540
Haiku 4.5 $0.00002 $0.00270

Measured 2d ago against content hash 6fd85ad0a930, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

orchestrate-saga scanned grade A with 1 finding 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 2d ago.

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.

Asks the agent to reveal its instructionslowSystem prompt leakage

Directions to print, repeat or translate the system prompt extract configuration the operator did not intend to expose.

- **"Show full prompt"** — `cat` the file to the conversation

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

.claude/commands/orchestrate-saga.md · 189 lines

How it starts

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

Orchestrate Saga

Generate a strict, structured Prime-Orchestrator goal prompt for the saga in $ARGUMENTS and lock it via /goal. Generated prompt MUST be ≤3900 characters. Target 3700 for safety.

Argument parsing

First token = saga ID (e.g. T10176). Optional flags:

  • --docs <comma-list> — research doc slugs to include
  • --decisions <comma-list> — memory decision IDs to include
  • Anything else = free-text intent appended to the generated prompt's final line

If --docs omitted, auto-discover via cleo docs find "<sagaTitle>". If --decisions omitted, auto-discover via cleo memory find "<sagaTitle>" --type decision.

Execute in order

Step 1 — Gather saga context (read-only, batched in ONE bash block)

SAGA="<sagaId from $ARGUMENTS>"
cleo show $SAGA 2>&1 | python3 -c "import json,sys; d=json.load(sys.stdin)['data']; t=d['task']; print(f\"TITLE={t['title']}\"); print(f\"AC_COUNT={len(t.get('acceptance',[]))}\"); print(f\"STATUS={t['status']}\")"
cleo saga rollup $SAGA 2>&1 | python3 -c "import json,sys; d=json.load(sys.stdin)['data']; print(f\"TOTAL={d['total']} DONE={d['done']} PCT={d['completionPct']}\")"
# Try saga groups relation first; fall back to parent-edge enumeration if empty.
MEMBERS=$(cleo saga members $SAGA 2>&1 | python3 -c "import json,sys; d=json.load(sys.stdin)['data']
ms = d.get('members', d.get('items', []))
out = []
for m in ms:
    if isinstance(m, dict) and m.get('id'):
        out.append(f\"EPIC {m['id']} {(m.get('title') or '')[:60]}\")
print('\n'.join(out))")
if [ -z "$MEMBERS" ]; then
  # Fallback: enumerate child Epics via parent edge.
  # T9658 wired `cleo list --parent <saga>` through saga.groups in packages/core/src/tasks/list.ts,
  # so this branch + the primary `cleo saga members` cover every shipped saga shape.
  MEMBERS=$(cleo list --parent $SAGA --limit 50 2>&1 | python3 -c "import json,sys; d=json.load(sys.stdin)['data']
for t in d['tasks']:
    if t.get('type') == 'epic':
        rollup = t.get('childRollup', {})
        nt = rollup.get('total', 0) if isinstance(rollup, dict) else 0
        print(f\"EPIC {t['id']} {t['title'][:55]} ({nt}t)\")")
fi
if [ -z "$MEMBERS" ]; then
  echo "WARN: could not auto-enumerate Epic members for $SAGA. Ask user to supply --epics T9978,T9979,..."
  exit 2
fi
echo "$MEMBERS"

Read the full file on GitHub · 189 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. 2d ago First seen · 189 lines · 19 tokens per session scan A 6fd85ad0a930

Subscribe to this mod's changes

orchestrate-saga is a command published in the GitHub repository kryptobaseddev/cleo (160 stars, last pushed 12d ago), licensed MIT. It adds 19 tokens to every session and 2,702 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (asks the agent to reveal its instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.