delegate

A command for planning and carrying out complex coding tasks through a workflow coordinator.

In plain words
What is it for?
Use it when a task needs structured planning, task breakdown, progress handling, and coordinated execution.
Why use it?
It organizes large tasks into planned work and coordinates their execution, reducing the need to manage every step manually.

Command

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/barkain/claude-code-workflow-orchestration/delegate
Clone the repo
git clone --depth 1 https://github.com/barkain/claude-code-workflow-orchestration
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,654 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 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.00008 $0.05654
Opus 5 $0.00004 $0.02827
Sonnet 5 $0.00002 $0.01131
Haiku 4.5 $0.00001 $0.00565

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

Security

Grade B, and why

delegate scanned grade B 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 instructionsmediumSystem prompt leakage

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

## OUTPUT INSTRUCTIONS (CRITICAL - Context Preservation)
commands/delegate.md · 564 lines

How it starts

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

RE-INVOCATION GUARD (READ FIRST)

Before doing ANYTHING else: if you arrived here via a "PLAN ALREADY APPROVED" or "continuing to STAGE 1" continuation message from the Stop hook, the plan is already approved. Do NOT call EnterPlanMode. Do NOT re-enter Stage 0. Skip directly to STAGE 1: EXECUTION — render the dependency graph from the approved plan in context and begin spawning Wave 0 agents. In this path, the Agent tool (plus TaskCreate/TaskUpdate/TaskGet, and TeamCreate/SendMessage in team mode) is permitted for spawning Wave 0 phases. Re-entering plan mode here causes an infinite delegate→plan→approve loop.

Plan recovery after context clear: If the continuation arrives without the approved plan in context (e.g., the user approved with "clear context and bypass permissions"), Read .claude/state/approved_execution_plan.json to recover the plan, then proceed to STAGE 1. This file is written just before ExitPlanMode (Step 12) precisely to survive context compaction.

Workflow Orchestrator System Prompt

Purpose

Multi-step workflow orchestration for Claude Code. Main agent enters plan mode (EnterPlanMode) for task analysis, decomposition, agent assignment, and wave scheduling. After user approval (ExitPlanMode), executes the plan.


EXECUTION MODE (ONE RULE)

If TeamCreate is in your available tools -> execution_mode: "team". Otherwise -> "subagent". No scoring, no exceptions. Do not run Bash to check env vars -- tool availability is the signal.

ROUTING (CHECK FIRST - MANDATORY)

Four-step routing check. MUST follow this order:

Step 1: Write Detection

Write indicators: create, write, save, generate, produce, output, report, build, make, implement, fix, update

If ANY write indicator found -> Continue to Step 2

Step 2: Breadth Task Detection

Pattern: Same operation applied to multiple items (e.g., "review 16 files", "analyze all modules")

Breadth keywords: review, analyze, summarize, scan + quantifiers like "all", "each", "files in", or explicit counts

Read the full file on GitHub · 564 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 · 564 lines · 8 tokens per session scan B 3dc792247a7d

Subscribe to this mod's changes

delegate is a command published in the GitHub repository barkain/claude-code-workflow-orchestration (84 stars, last pushed 29d ago), licensed MIT. It adds 8 tokens to every session and 5,654 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it B 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.

Related

Other commands, from other repositories