cleo: Command for Claude Code

.claude/commands/orchestrate-saga.md

orchestrate-saga is a command for Claude Code from kryptobaseddev/cleo. It costs 19 tokens per session (2,700 once invoked), scanned A, original, MIT.

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

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; names the SlashCommand tool; mentions Claude Code.

This is kryptobaseddev/cleo's own configuration. It tells Claude Code how to work on cleo itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cleo configures →

Reuse

Borrowing it

Nothing to install: this file belongs to kryptobaseddev/cleo. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/kryptobaseddev/cleo/main/.claude/commands/orchestrate-saga.md
Clone the repo
git clone --depth 1 https://github.com/kryptobaseddev/cleo

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-saga

README.md
[![agentmods](https://agentmods.dev/badge/commands/kryptobaseddev/cleo/orchestrate-saga/github.svg)](https://agentmods.dev/commands/kryptobaseddev/cleo/orchestrate-saga)
Your own site
<a href="https://agentmods.dev/commands/kryptobaseddev/cleo/orchestrate-saga"><img src="https://agentmods.dev/badge/commands/kryptobaseddev/cleo/orchestrate-saga/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for orchestrate-saga

Your own site · 80×15
<a href="https://agentmods.dev/commands/kryptobaseddev/cleo/orchestrate-saga"><img src="https://agentmods.dev/badge/commands/kryptobaseddev/cleo/orchestrate-saga.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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,700 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00019 $0.02700
Opus 5.5 $0.00008 $0.01080
Sonnet 5.5 $0.00004 $0.00540
Haiku 4.5 $0.00002 $0.00270

Measured 1mo ago against content hash 5a61ea220459, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo ago Changed 5a61ea220459
  2. 1mo 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 (159 stars, last pushed today), licensed MIT. It adds 19 tokens to every session and 2,700 once invoked, about $0.0001 per session on Opus 5.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.