A slash command for Claude Code that turns your session into a zero-read orchestrator with iterative quality control loops and tiered memory.
When you give Claude Code a complex task, it reads files, reasons, writes code, and runs out of context window before finishing. At 50-65% token usage, output quality degrades (context rot). You lose work, have to re-explain, and start over.
This protocol forces Claude Code to operate as a pure orchestrator. It never reads files or reasons about content itself. Instead, it:
- Plans the work in a plan file using distillation format (full absolute paths for session recovery)
- Delegates everything to focused agents (each with their own token pool)
- Quality controls every agent output through an iterative loop:
- Task Agent produces output
- QC Agent hunts for problems (not just validates)
- Fix Agent applies fixes using additive improvement (never drops content)
- Loop repeats until genuinely zero issues remain (all severities: CRITICAL, MAJOR, MINOR)
- Manual content fidelity verification after every pipeline run
- Remembers across sessions using a 3-tier memory architecture (recent, distilled, permanent)
- Hands over cleanly when tokens run low, so a fresh session can pick up exactly where you left off
- Zero-read orchestrator: Main session never reads source files (hard limit: 100 lines). Pre-read size check (
wc -l) before any file read. Agents do all the heavy lifting. - Semantic XML structure: All protocol sections use XML tags for precise, unambiguous parsing.
- Loop-until-zero QC: Every substantive output gets Task -> QC -> Fix -> Verify. No arbitrary iteration cap. All severities must resolve. Safety valves only for genuinely stuck situations (same-issue escape after 3 attempts, token-budget escape at 50%).
- Manual content fidelity verification: Automated tests are necessary but not sufficient. Manual count, cross-reference, and spot-check after every pipeline run.
- Enhance without regression: Fix agents must preserve everything from the original plus add improvements. Regression check is mandatory.
- Structured agent output: Every agent writes a
## Summaryheader that the orchestrator reads. Full output stays on disk for downstream agents. - 5-level token budget: GREEN (0-40%), GREEN+ (40-50%, distillation trigger), YELLOW (50-55%, finish wave), ORANGE (55-65%, stop and handover), RED (65%+, emergency handover).
- Self-contained agent prompts: Agents don't see conversation history, so every prompt includes full context, paths, and success criteria.
- 3-tier memory: Recent (plan files), Distilled (topic files), Permanent (MEMORY.md + CLAUDE.md). Adapted from Nuum's memory architecture.
- Reflect-agents: Haiku-powered search agents that retrieve facts from previous sessions without loading full files into orchestrator context.
- Distillation format: Plan files use Context + Facts format (not free-form notes). Recursive distillation when plan files exceed 200 lines.
- Large file strategy: Files >1,000 lines must use Bash + Python (not the Write tool, which has a 32K token limit).
- Cost-effective model selection: Opus for reasoning/QC, Sonnet for standard code/analysis, Haiku for file reading/reflect-agents.
- Anti-polling: Zero-poll waiting for agents. Never call TaskOutput while running (each poll dumps 50-150K tokens).
- 3 cascade patterns: Orchestrator-driven (default), self-chaining, and parallel independent.
- Agent Teams excluded: This protocol uses the Task tool (subagents) only. Agent Teams is a separate system.
SKILL.md # Main protocol (~345 lines, semantic XML)
orchestrate.md # Thin slash command (copy to ~/.claude/commands/)
references/
anti-polling.md # Zero-poll waiting protocol
cascade-pipelines.md # 3 cascade patterns for agent chains
qc-loop.md # Full QC procedure, severity ratings, fix protocol
distillation.md # Memory compression format (Context + Facts)
reflect-agent.md # Search agent for past-session recall
tiered-memory.md # 3-tier memory architecture
Copy the skill and command to your Claude Code directories:
# Create skill directory
mkdir -p ~/.claude/skills/orchestrate/references
# Copy skill files
cp SKILL.md ~/.claude/skills/orchestrate/SKILL.md
cp references/*.md ~/.claude/skills/orchestrate/references/
# Copy the slash command
cp orchestrate.md ~/.claude/commands/orchestrate.mdAfter installation, update the reference paths in SKILL.md to use your full absolute paths (e.g., replace references/ with ~/.claude/skills/orchestrate/references/).
Instead of giving Claude Code a task directly, prefix it with /orchestrate:
/orchestrate fix the authentication bug across the login flow
/orchestrate analyze all 15 papers in the literature folder and create a comparison table
/orchestrate refactor the payment module to use the new API, update tests, and document changes
Claude Code will then plan the work, delegate to agents, QC everything with loop-until-zero rigor, and hand over cleanly if it runs low on tokens.
This is a major update from v1.0:
| Feature | v1.0 | v2.0 |
|---|---|---|
| Structure | Markdown headings | Semantic XML tags |
| Reference files | 3 | 6 (added distillation, reflect-agent, tiered-memory) |
| QC loop | Max 2 iterations | Loop until genuinely zero issues |
| QC severities | CRITICAL/MAJOR only | All severities including MINOR |
| Memory | None | 3-tier (recent/distilled/permanent) |
| Token budget | 2 levels (60%, 70%) | 5 levels (GREEN through RED) |
| Manual verification | Not included | Mandatory after every pipeline run |
| Large files | No guidance | Bash+Python for >1,000 lines |
| Model selection | Not included | Opus/Sonnet/Haiku matrix |
| Pre-read check | Not included | Mandatory wc -l before any read |
| Reflect-agents | Not included | Haiku search agents for past sessions |
| Distillation | Not included | Context + Facts format, recursive compression |
- doc2md — High-fidelity PDF/DOCX/PPTX to Markdown conversion pipeline with multi-stage QC, image extraction, and Claude Code integration. Built to solve the problem of Anthropic's copyright filter blocking PDF reads. Works well with this orchestration protocol for batch document processing workflows.
This protocol was informed by patterns from:
- Official Anthropic subagent and agent teams documentation
- Community repos including multi-agent-shogun, claude_code_agent_farm, voronerd, nexus-hr, and margelo orchestrator patterns
- Real-world experience with context rot, quality regression, and session recovery failures
- Memory architecture inspired by patterns from Nuum and Miriad by Sanity Labs. We evaluated these tools and adapted their best ideas (tiered memory, distillation format, reflect-agents) to work natively within Claude Code's subagent architecture.
MIT