delegator
The main session is the shared workspace of the person and the agent, and it keeps only what the next decision needs. delegator puts the orchestration rules ORCH-1 to ORCH-7 at the start of every session, and again after a resume, a clear or a compaction: they hand reading, running, judging and edits to subagents, launch independent ones together and let into the main session only what a decision needs. Hooks, the programs Claude Code runs at fixed points of a session, hold what a program can check: the launch check judges each subagent launch before it starts, and the return check caps what each subagent sends back. delegator also checks the form of gh pr create and gh issue create calls. claude plugin uninstall delegator@yapus removes the plugin.
Depths
A depth is the size class the agent names for a task before its first tool call. Every subagent description starts with it in brackets, such as [deep] S3 ..., and the launch check refuses a description without one. An oracle is the command whose exit code says whether a change passes, such as npm test.
| Depth | When | How the work runs |
|---|---|---|
quick | one file, a decided change, a one-command oracle | in the main session, no plan, no subagent |
standard | the default | subagents for reading, running, judging and edits |
deep | about 400 changed lines, several unknowns, multi-source research or work that outlives one context | a written plan, built and committed one part at a time |
The agent raises the depth when an oracle fails twice or a review asks for rework; lowering it is left to the person.
Subagents
Each subagent is launched as delegator:<name>. The launch check refuses the built-in agent types that stand in for the roster (general-purpose, Explore, Plan, fork, claude), and a subagent launches no other subagent, except a finisher that launches the diff reviewer for its own diff.
| Agent | Job |
|---|---|
builder | decided edits against an oracle, until it passes |
reader | read-only search, distilling long files, logs or diffs |
runner | the named commands, with exit codes and first error lines |
web-researcher | one question about external facts, one URL per claim |
mcp-operator | one task in a browser or a connected app through MCP tools |
plan-writer | the plan of a deep task in .yapus/plans/<topic>.md |
plan-reviewer | a GO or REVISE verdict on a written plan |
finisher | one part of a plan: edit, oracle, review, commit |
diff-reviewer | an APPROVE or REWORK verdict on a finished diff |
Every subagent receives a return contract at its start: the return opens with DONE, PARTIAL, QUESTIONS or BLOCKED and stays within 12,000 characters, about 3,000 tokens, so one return cannot flood the main session. A longer return is sent back once to be shortened and passes on the second try.
Deep Work
Deep work is a task rated deep: it is planned in writing before the first edit and carried out in slices. A slice is one step of the plan with one intent, its own files, acceptance criteria and oracle, committed on its own. The skill /delegator:write-plan runs the flow.
- Plan:
delegator:plan-writerwrites.yapus/plans/<topic>.md, and a subagent measures each fact the plan marks unmeasured. - Plan review: when the plan touches more than one module or a public interface,
delegator:plan-reviewerjudges it once before the first edit, and the plan-writer folds each defect in. - The person's decisions: the agent asks each open decision as one question with its recommendation first, and records the answer in the plan.
- Slices: one
delegator:finisherper slice edits only the slice's files and runs its oracle until it passes or one failure survives two repairs. - Diff review: the finisher writes the slice's diff to a file and launches
delegator:diff-reviewer, the one nested launch the launch check admits, then repairs what a REWORK names. - Commit: the finisher commits the slice alone, never pushes, and returns the commit, the oracle's exit code, the verdict and the path of the detail file
.yapus/plans/<topic>/<slice id>.md, which holds the rest.
Outside deep work, a change of more than 150 lines goes once to delegator:diff-reviewer before the agent reports it done.
Launch Limits
The launch budget is the number of subagent launches one session may make. delegator counts the launches of a session and refuses the one past the budget.
The budget is 41 by default, above the 37 launches of the busiest measured session. /delegator:agent-limit <n> sets another whole number for the session, or with --global for every session.
The launch check also refuses a quick launch and a finisher outside deep. After a refusal the agent tells the person what was refused and why, and does not split the work into smaller launches.
delegator records every launch and return verdict in a file that never leaves the machine; /delegator:agent-report prints the record's counts per agent.
Prompt Log
The prompt log keeps what the person typed, so a compaction does not lose it. delegator writes each prompt, with its time, as one JSON line to .yapus/prompts/<session id>.jsonl under the directory the session opened in. Right after a compaction it gives the session those prompts back, the newest that fit in 6,000 characters, with the paths of the five newest plans in .yapus/plans/.
It creates the prompts directory with a .gitignore that keeps it out of git; a person who wants their prompts in git changes that file.
Commands
Off means no rules at the session's start, no check on its launches, and no prompt written or given back.
| Command | Effect |
|---|---|
/delegator:switch off | delegator off for the session, or with --global for every session |
/delegator:switch on | delegator back on |
/delegator:status | the mode and the limit in force, the session's launches |
/delegator:agent-limit <n> | the launch budget for the session, or with --global for every session |
/delegator:agent-report | the record's counts per agent |
/delegator:write-plan | the deep work flow, from the plan to the slices |