[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78FFEFD4DETJXHWZ6APRGGG":3,"skill-same:01M78FFEFD4DETJXHWZ6APRGGG":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M78FFEFD4DETJXHWZ6APRGGG","delegate-to-subagents",null,"Decide when to hand work to a subagent instead of doing it yourself, how to brief it, how to run the fix\u002Freview loop when something comes back wrong, and how to verify what comes back. Use when a task is big enough to delegate (independent research, a parallelizable slice, a second opinion, a review pass), when running more than one agent, when a subagent's report claims something is finished, or when a review comes back with findings that need fixing. Skip for single-step edits or when no subagent tooling is available. Bundles an optional PreToolUse\u002FPostToolUse hook (scripts\u002Fcheck_dispatch_brief.py) that nudges on two of the mistakes this skill warns about, plus an execution-state dashboard CLI (scripts\u002Fexecution_manager.py) for a coordinator tracking multiple workers.","songjiun10-collab\u002FHncs","songjiun10-collab","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F293141730?v=4","01M78FEF4NYSK5BRK9HBBT64X1","01M78FEF5AKPHSAAMYT6249TR7",16,"MIT","https:\u002F\u002Fgithub.com\u002Fsongjiun10-collab\u002FHncs\u002Fblob\u002Fmain\u002Fsenior-engineer-mindset\u002Fdelegate-to-subagents\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: delegate-to-subagents\ndescription: >-\n  Decide when to hand work to a subagent instead of doing it yourself, how to brief it, how to run the fix\u002Freview loop when something comes back wrong, and how to verify what comes back. Use when a task is big enough to delegate (independent research, a parallelizable slice, a second opinion, a review pass), when running more than one agent, when a subagent's report claims something is finished, or when a review comes back with findings that need fixing. Skip for single-step edits or when no subagent tooling is available. Bundles an optional PreToolUse\u002FPostToolUse hook (scripts\u002Fcheck_dispatch_brief.py) that nudges on two of the mistakes this skill warns about, plus an execution-state dashboard CLI (scripts\u002Fexecution_manager.py) for a coordinator tracking multiple workers.\n---\n\n# Delegating to Subagents\n\nHanding work to an agent is itself a decision. Delegate badly and it's slower than doing it yourself; trust a report without verifying it and you get told work was done that wasn't.\n\nThe same discipline applies one level up: a principal engineer delegating to another engineer or team needs the same brief + scope + verify, not just AI subagents. This skill stays focused on the AI-subagent mechanism, since that's what the hook below actually wires up.\n\n**Distinguished\u002FFellow angle:** at this tier delegation shifts from handing off tasks to handing off technical *direction* — the deliverable is often a doc, runbook, or review process built to outlive any single delegation, so the practice keeps running after the person who set it up leaves.\n\n**Executive angle (CTO\u002FVP-Eng):** if a delegation pattern keeps recurring (the same kind of review, the same kind of parallel research), that's a signal it should become a role or a team with headcount and budget, not a habit repeated ad hoc by whoever's available.\n\n## Decide whether to delegate first\n\n- Is this an independently investigable\u002Fexecutable chunk, or does every step depend on the last result? The latter is faster done directly, one step at a time. **Hncs example:** `evaluate_*.py`\u002F`calibrate_profile_\u003Cbrand>.py` are deliberately standalone per brand — never importing a sibling, copying the loader instead — so one brand's calibration run is a genuinely independent scope you can hand to its own subagent. The brand-agnostic orchestration\u002Fstatistics code (`summarize()`, `_paired_cv_losses()`, `run_per_brand_calibration()`) is the opposite case: it's shared, not copied, so it is *not* independent scope — a change there has to be one coordinated dispatch, not sliced per brand.\n- **Parallel is normal across independent domains.** Fixing 3 unrelated failures (different files, different causes) means calling dispatch multiple times in one turn — that's what parallel execution looks like. Each agent gets zero session history, a narrow scope (one file \u002F one subsystem), explicit constraints (\"don't touch production code\"), and a concrete deliverable. Related failures (fixing one might fix another) stay sequential, not split into parallel dispatches.\n- **Never let two dispatches edit the same live file at once.** Even across unrelated domains, if files overlap, pull that file out and handle it sequentially.\n  - Deliberately having multiple agents solve the same problem differently, to compare approaches, is a different case — run those in isolated workspaces each (e.g. git worktrees). Note a worktree only sees committed content — if a worker needs uncommitted drafts or scripts, copy those files in explicitly; assuming \"it'll be visible anyway\" means the worker won't find them.\n- \"I don't feel like doing it\" isn't a reason to delegate. Saving context, a genuinely independent domain, or comparing approaches — delegate for a reason.\n- **Scope permissions per role.** Don't give write access to a subagent that's only supposed to review — when responsibilities split, permissions should split too, so a reviewer can't drift into fixing things mid-review. xAI's Grok Build (open-source) ships this as four named tiers on every subagent spawn (`SubagentCapabilityMode::ReadOnly\u002FReadWrite\u002FExecute\u002FAll`, each filtering the actual tool list the child receives) rather than a binary read\u002Fwrite flag — a real system needed more than two buckets.\n- **Flat isn't the only shape.** Dispatching N independent subagents yourself is the default, but for a genuinely multi-role job (triage → fix → verify, or several specialized workstreams that need to hand off to each other), consider one coordinator subagent that dispatches and sequences the others, rather than you tracking every handoff directly. Reserve this for jobs with real inter-agent handoffs — a flat dispatch is simpler and should stay the default for independent, unrelated pieces of work.\n\n## Give a recurring role a name — treat it like a colleague, not a tool call\n\n- **A role you delegate to repeatedly deserves an identity**, not a fresh anonymous dispatch every time. xAI's Grok Bot (official, docs.x.ai\u002Fgrok-bot\u002Foverview) states this directly: \"a Bot = a single persistent, named agent... a persistent, named teammate with a durable state\" — not a chatbot you re-explain things to from zero. The same shift costs nothing here: name the role by what it does (`Bug Reproducer`, `PR Steward`) instead of leaving it as an anonymous `general-purpose` dispatch, and treat that name as an identity you build on across dispatches, not a label on one throwaway call.\n- **Continue it, don't reset it** (see \"Talking to an agent that's already running\" above) — this is the mechanical form of \"colleague, not tool\": a colleague you worked with yesterday doesn't forget everything overnight just because the conversation ended.\n- **Feed corrections back into the identity, not just into one conversation.** When a named role's output needed correcting, write the correction into a `persistent-memory` topic keyed to that role's name (see that skill). The next time you delegate to \"Bug Reproducer,\" it starts already knowing the correction — the same way a real colleague improves from feedback instead of repeating the same mistake with the next person who asks.\n- **What this doesn't buy you for free:** Grok Bot's bots are reported to scope-match and hand off tasks to each other without a human routing every request — but that specific mechanism isn't in the official docs directly, only in third-party writeups, so treat it as unverified. Nothing in this session's own tooling does automatic scope-matching regardless — a named role here still needs you (or a coordinator, see \"Coordinating a hierarchy\" below) to decide each handoff by hand. The metaphor buys identity and memory; it doesn't buy self-organizing delegation.\n\n## Coordinating a hierarchy\n\nIf you do reach for a coordinator, treat it as a real design decision, not just \"add a middle layer\":\n\n- **Depth limit: two levels, no more.** You → coordinator → workers. No coordinator-of-coordinators — past that, the reporting chain gets harder to verify than just staying flat would have been. Not just house style: xAI's Grok Build (open-source) enforces a nesting-depth limit mechanically at spawn time (`SubagentDepthCounter` checked against a configured `MaxSubagentDepth`), not as a convention someone has to remember.\n- **The coordinator gets a narrow brief too**, same as any subagent — an open-ended \"manage this\" mandate drifts into scope creep for a coordinator exactly like it does for a worker.\n- **Give it an explicit escalation path for a stuck worker**: a fixed retry cap, then hand back to you with what was tried — the same \"don't retry with the same instructions forever\" rule that applies at the top applies one level down too.\n- **Decide the reporting shape up front.** Hub-and-spoke (the coordinator digests worker output before it reaches you) cuts noise but can hide a real disagreement between workers; a shared thread (workers see each other's output directly) keeps that visible but adds coupling. Default to hub-and-spoke; use a shared thread only when workers genuinely need each other's intermediate output to do their own job.\n- **Verify-before-claiming applies one level up.** A coordinator's \"all three done, all green\" is still a report, not evidence — spot-check it the same way you'd spot-check any subagent's claim.\n- **Route the coordinator's status traffic to a file\u002Flog**, not back into your live context — same reasoning as \"give long-running work a name and a status line\" below, just one hop further removed. `scripts\u002Fexecution_manager.py` gives this an actual dashboard instead of leaving it as prose (see \"Optional: track execution state with a script\" below) — it tracks status, it doesn't decide anything; noticing a worker's been stuck too long is still your judgment call, the script just puts the information in front of you instead of you having to remember to ask.\n- **Signal to retroactively promote flat to coordinator:** you're mid-task manually sequencing handoffs yourself — agent A's output has to shape agent B's brief, which has to shape agent C's. That hand-sequencing is the coordinator's job, not yours; once you notice you're doing it by hand, that's the cue to insert one.\n\n## Talking to an agent that's already running\n\nThe default model above is one-shot: brief in, wait, read the result. Some environments give you more than that — a way to address a named, already-running (or already-finished) agent directly instead of only dispatching fresh ones. Where that exists:\n\n- **Continue it, don't re-dispatch it.** Messaging a named agent resumes it from its own transcript with full context — for a follow-up, a correction, or new information that should steer the rest of its work, that beats spinning up a fresh dispatch that has to be re-briefed from scratch. Reply to an incoming message by addressing the same name back.\n- **Handing off to a *different* named agent needs a shared place to leave context, not just the message body.** Grok Bot's bots share one persistent computer specifically so a handoff doesn't require re-explaining (\"Bots share one computer... makes handoffs possible without repeating setup\" — docs.x.ai\u002Fgrok-bot\u002Foverview, official). Claude Code has no literal shared filesystem across sessions, but the honest equivalent is the same shared git repo (commit the state, push it) or a `persistent-memory` topic file — write what the next agent needs somewhere durable and discoverable, then message them to look there, rather than trying to cram all of it into the message text.\n- **Subscribe to completion, don't poll.** A one-shot \"notify me when it goes idle\" subscription is the mechanized version of \"wait for the completion signal instead of tight polling\" (Common failures, below) — sending \"are you done?\" messages, or checking status in a loop, is exactly the anti-pattern that exists to replace.\n- **A coordinator's \"shared thread\"** (see \"Coordinating a hierarchy\" above) is this, concretely — workers addressing each other directly by name instead of everything routing through the coordinator.\n- **Never let a peer launder a blocked permission.** If your own session was denied or blocked from an action, don't ask another agent or session to do it for you — that routes around a permission boundary the user's own session hit, not a legitimate use of multi-agent coordination. Take it back to the user instead.\n\nThis capability set isn't universal — plain single-session Claude Code doesn't have it. Treat this section as an addendum to the one-shot model above where it's available, not a replacement for it where it isn't.\n\n- **Even where subagent tooling is sophisticated, live steering is often still absent — check, don't assume.** xAI's Grok Build (open-source, `crates\u002Fcodegen\u002Fxai-grok-tools\u002Fsrc\u002Fimplementations\u002Fgrok_build\u002Ftask\u002F`) has a genuinely rich coordinator protocol behind its `task` tool — spawn, poll-with-timeout query, wait-any\u002Fwait-all on a list of subagents, typed cancel (by id, by turn, by session, by workflow run), buffered completion summaries delivered between turns — and its message enum is explicitly exhaustive (`SubagentEvent`, doc-commented \"kept exhaustive so every actor command is handled\"). It has **no message-injection-into-a-running-child variant at all.** `resume_from` only rehydrates a *previously completed* subagent's transcript into a new one — there's no live \"send this instruction into the subagent that's still working\" path. Don't assume a \"continue a running agent\" capability exists just because a platform has rich subagent orchestration; the two are separable, and a real, carefully-built implementation shipped without the first. This is scoped to Grok Build's own `task` tool specifically — its sibling product Grok Bot (a different, closed-source architecture: persistent named bots sharing one cloud computer, not ephemeral children of one session) documents the opposite as a headline differentiator (\"Bots can collaborate independently, passing context between each other and handing off tasks\" \u002F \"It coordinates independently with other Bots\" — docs.x.ai\u002Fgrok-bot\u002Foverview, official). Not verifiable at the code level like Grok Build was, and \"handing off tasks via a shared computer\" isn't necessarily the same mechanism as live message-injection — but don't conflate the two xAI products' capabilities just because they share a vendor.\n- **Multi-wait is worth naming as an explicit choice**, not just \"wait for it\": `WaitMode::WaitAny` (proceed as soon as one of several finishes — e.g. racing redundant approaches) vs. `WaitMode::WaitAll` (need every one — e.g. independent slices that all feed the next step) are genuinely different decisions with different failure modes if you default to the wrong one.\n\n## Scheduled\u002Funattended execution\n\nBeyond a live dispatch or a continued conversation, some environments can fire a saved prompt at a future time — into this session, a specific other session, or a fresh one — without anyone needing to be present when it fires.\n\n- **Verified, not theoretical:** a one-shot trigger was scheduled 2 minutes out; it fired on its own, delivered as a new turn carrying the actual fire time, and the scheduled command ran for real (a `persistent-memory` append landed in `.claude\u002Fmemory\u002Fscheduled-execution-demo.md`, confirmed by reading the file back afterward) — not a hypothetical capability described secondhand.\n- Use this for the reusable-template-on-a-schedule case from \"How to brief\" above (a recurring brief that re-fires itself instead of you remembering to re-dispatch it), or for a check-in on long-running work instead of manually deciding when to look again.\n- **This isn't the same as \"always running.\"** The trigger fires a fresh turn into a session — the underlying environment can still reclaim an idle container between firings. It gets you unattended re-invocation at a point in time, not a persistent background process running continuously in between.\n- Not universal — this is specific scheduling tooling, not something every Claude Code environment has; confirm yours actually has it before relying on it, the same caveat as \"Talking to an agent that's already running\" above.\n- **Test-run it once before trusting it unattended.** Fire it manually first and check the whole path: the right input actually gets picked up, the output lands where expected, and a failure is visible somewhere instead of silently swallowed. Don't let the first real run also be the first tested run.\n- **Some environments go further: named, saved workflows with pause\u002Fresume\u002Fstop.** xAI's Grok Build TUI (docs.x.ai\u002Fbuild\u002Fmodes-and-commands, official) ships `\u002Fworkflow \u003Cname> [args]` as a saved, resumable background job with explicit `pause`\u002F`resume`\u002F`stop` sub-commands and a live run dashboard (`\u002Fworkflows`) — a different capability shape than the one-shot future-fire trigger above. This session's own trigger tools (`create_trigger`\u002F`update_trigger`) only expose enable\u002Fdisable for a trigger's *future* firings, not pause\u002Fresume of an *already-running* execution — check what your own environment actually exposes rather than assuming the stronger shape is universal.\n\n## How to brief\n\n- Give **the task + interfaces it touches + constraints.** Don't paste a summarized session history — hand over file paths and let the subagent read them itself.\n- Pasted text or a returned summary sits in your context from that point on. Passing a file path is always cheaper.\n- If the target is vague (\"fix this up\"), narrow it yourself before delegating — a vague brief comes back as a vague result.\n- **Record a baseline right before dispatching** (e.g. `git rev-parse HEAD`). Use this baseline later for diffs and review scope — `HEAD~1` silently picks the wrong range if another commit landed in between. `git rev-parse HEAD` alone misses **uncommitted** changes already in the working tree at dispatch time — if there were any, also snapshot `git diff` (and `git diff --cached`) before dispatching, or just commit\u002Fstash first so the baseline is clean. Otherwise a later \"what changed\" diff mixes the subagent's work with whatever was already sitting there.\n- **If the same kind of task recurs, capture the brief once as a reusable template** instead of re-explaining it from scratch each time — and fold in corrections as they come up, so the template actually improves with use instead of staying a stale first draft (see `persistent-memory` for the actual file-based mechanism and a small CLI for it). If your environment has a real scheduler, wire the template into one instead of manually re-dispatching it each time it comes up (see \"Scheduled\u002Funattended execution\" below) — same end state as \"demonstrate a workflow once, replay it on a schedule,\" just built from an explicit saved prompt rather than something the agent is assumed to remember on its own.\n\n## Verify what comes back\n\n- **Don't take the report at face value.** \"Tests passed\" is a claim, not evidence — run it yourself or read the diff (same principle as `verify-before-claiming`; delegating doesn't exempt you).\n- Get reports and reviews **as files.** A long reply dumped into the chat window gets lost to compaction, and the next round has to re-read from scratch.\n- If you asked for a review, don't tell it in advance what not to flag — let findings surface, including ones you expect to dismiss, then judge them yourself afterward. Spec compliance and code quality are **different axes** — don't let one obscure the other.\n- **After running several in parallel**, before merging: read each summary separately → check whether two agents touched the same code (if they overlapped, re-review just that part) → run the full test suite once more to catch combination issues invisible to either agent alone.\n\n## When it's blocked or the review loop won't end\n\n- On a BLOCKED report, don't retry with the same instructions — give concrete feedback and retry, use a stronger model, or split the task. Nothing changes, nothing improves.\n- **Tag *why* it's stuck, not just that it is.** xAI's Grok Build (open-source, `crates\u002Fcodegen\u002Fxai-workflow\u002Fsrc\u002Frun.rs`) types a paused workflow's reason instead of leaving it a bare boolean — `user` (waiting on a human), `back_off` (rate-limited, retry later), `no_progress` (stuck, not converging), `verification` (blocked on a failed check), `infra` (the environment\u002Ftooling broke). The fix differs by kind: retry-with-delay for `back_off`, escalate or reslice for `no_progress`, fix the check itself for `verification`, fix the environment for `infra` — collapsing all of these into one generic \"BLOCKED\" loses exactly the information that says which response applies.\n- Findings from a review go to **one subagent at a time** to fix all of them — spinning up a new subagent per finding rebuilds context from scratch every time.\n- **Cap the fix → re-review loop** (e.g. 3 rounds). Past the cap without resolution, judge it yourself: wrong or trivial → note why and move on; real and material → decide the smallest fix yourself and record it. **Never drop it silently** — record the verdict and the reason either way.\n- **Don't fix it yourself** (except a minor case you judge doesn't need review). A controller fixing things directly skips the review step, and that code piles into your own context.\n- For a hard-to-reverse decision where judgment is split, instead of one more review, put two agents on opposing sides to argue it out — a tradeoff invisible from one side alone sometimes only shows up that way (a heavier tool, for situations like `weigh-tradeoffs` \u002F `adversarial-review`).\n\n## Calibrate how often you interrupt\n\n- Don't ask for confirmation on every step — let the routine, reversible ones go through silently and save the interrupt for the one that actually matters. Asking \"OK to proceed?\" on trivial steps trains the user to rubber-stamp everything, which defeats the point of asking at all.\n- Same bar as `weigh-tradeoffs`: reversible → just do it and show the result after; irreversible or consequential → stop and ask before, not after.\n- **A confirmation gate protects the next action, not what already happened.** If a subagent already sent the email or merged the commit, asking \"OK to proceed?\" afterward is theater — the interrupt has to sit before the irreversible call fires, not at the point where you happen to read the report.\n- A subagent that reproduces a bug, files the ticket, and fixes it — surfacing only the one call that actually needed a human (\"should this also roll out to the EU region?\") — is more useful than one that narrates every intermediate step.\n\n## Give long-running work a name and a status line\n\n- When a delegated agent runs over a longer stretch, don't leave it silent until it finishes — give it a short name and keep a one-line status that updates as it progresses (\"Inbox Manager — sent, inbox at zero, 5 drafts parked\"). A glanceable roster beats a wall of silence followed by one huge report at the end.\n- **There's no live channel for this** — a dispatched agent returns one final result, not a stream of intermediate updates you can watch. The only way to get a status line that actually updates mid-run is to brief the agent to write its own progress to a file (e.g. `.claude\u002Fstatus\u002F\u003Cname>.md`) and glance at that file yourself; there's nothing to \"watch\" otherwise.\n- This is for genuinely long-running or ongoing delegations, not a two-minute task — for a short dispatch, just wait for the completion signal (see \"Common failures\" below).\n\n## Common failures\n\n- **\"Independent\" scope that secretly shares code.** A 2026-08 review of Hncs found 6 brand calibration files had copy-pasted their shared orchestration code byte-for-byte instead of it staying centralized — which had already caused a real bug (a hardcoded `datasets\u002Fleica\u002F...` path left over in 5 of 6 files' error messages). Slicing work \"one dispatch per brand\" looked independent; the code underneath wasn't, and the duplication is what let the bug spread silently. This is the same \"copy the loader\" pattern from \"Decide whether to delegate first\" above, on its wrong side: copying is the right call only for the piece that's genuinely meant to diverge per scope (each brand's loader). Anything with zero reason to diverge — the orchestration\u002Fstatistics code — stays centralized and imported, never copied; that's exactly the boundary this bug crossed.\n- Multiple agents edit the same file at once and clobber each other\n- Moving to the next step without verification just because a subagent said \"done\"\n- A delegated chunk too large for you to review the result — if you can't review it, it was sliced wrong to begin with\n- Checking in on a subagent at tight intervals to catch it being stuck — this only stretches the wait. Wait for the completion signal, then process it.\n\n## Optional: enforce with a hook\n\nTwo of these principles are mechanically catchable — **pasting a long conversation summary verbatim**, and **too many concurrent open dispatches** (2-3 is normal, more than that trips it) — `scripts\u002Fcheck_dispatch_brief.py` detects both right before an Agent call (PreToolUse). By default it **only warns, it doesn't block** (a default chosen with the assumption this may get installed into projects that aren't your own). To actually block, add the environment variable `DELEGATE_HOOK_STRICT=1` to the hook command — the script's header comment documents the exact behavior.\n\nAdd to `.claude\u002Fsettings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Agent\",\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"python3 .claude\u002Fskills\u002Fdelegate-to-subagents\u002Fscripts\u002Fcheck_dispatch_brief.py\" }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Agent\",\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"python3 .claude\u002Fskills\u002Fdelegate-to-subagents\u002Fscripts\u002Fcheck_dispatch_brief.py\" }\n        ]\n      }\n    ]\n  }\n}\n```\n\n`Agent` is the built-in dispatch tool's name (some docs\u002Fblogs from older Claude Code versions still say `Task` — if your version predates the rename, use that instead and confirm against your own `tool_name` in a hook payload). Hook the same script into both PreToolUse and PostToolUse — PostToolUse closes out the specific dispatch that finished, keyed by the call's `tool_use_id` (hook only one side and open dispatches never get closed). If your skill is installed at a different path, update the command path to match. By default it only warns quietly (visible only in the human-facing transcript) — to make Claude actually react to it (i.e. actually block), prefix the command with `DELEGATE_HOOK_STRICT=1` (`\"command\": \"DELEGATE_HOOK_STRICT=1 python3 ...\"`). This hook is example-level enforcement — not a red-team-tested CRITICAL-tier block like Hncs's `protect_never_touch.py`, just a minimal mechanization of this skill's verbal advice. If you need something stronger, use this script as a starting point and adapt it to your project.\n\n**Limitation:** the hook only counts *how many* dispatches are open, it doesn't know *which files* each one touches — two parallel dispatches editing the same file won't trip anything as long as the total count stays under the threshold. Catching that mechanically would mean parsing each brief for the files it intends to touch and cross-checking against the others' — out of scope for this example script; \"never let two dispatches edit the same live file\" (above) stays something you enforce by reading the briefs yourself.\n\n## Optional: track execution state with a script\n\nActing as a coordinator over several workers (see \"Coordinating a hierarchy\") means tracking whose status is what — `scripts\u002Fexecution_manager.py` is a small CLI for that, so it doesn't have to live in your head or get re-derived from scratch every time you check in:\n\n```bash\npython3 scripts\u002Fexecution_manager.py start worker-a \"exploring the auth bug\"\npython3 scripts\u002Fexecution_manager.py update worker-a blocked \"waiting on a prod API key\"\npython3 scripts\u002Fexecution_manager.py dashboard\npython3 scripts\u002Fexecution_manager.py clear worker-a\n```\n\n`dashboard` prints one line per tracked worker — status, elapsed time, and note — and flags any `blocked` entry that's been stuck past `EXECUTION_MANAGER_BLOCKED_WARN_SECONDS` (default 1800s). **Be precise about what this does and doesn't do:** it tracks and displays status; it does not detect that a worker has a problem (something has to call `update ... blocked` — the worker itself, or you noticing), and it does not decide what to do about a stale one — that's still your judgment call, same as everywhere else in this skill. Read \"problem detected → automatic decision → automatic fix\" nowhere in this script; it stops at \"here's what's stale, go look.\"\n\nOptionally wire it as a `PreToolUse` hook on the `Agent` tool so a stale-blocked warning surfaces automatically right before you dispatch yet another worker, instead of only when you remember to run `dashboard` yourself:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Agent\",\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"python3 senior-engineer-mindset\u002Fdelegate-to-subagents\u002Fscripts\u002Fexecution_manager.py hook\" }\n        ]\n      }\n    ]\n  }\n}\n```\n\n**External validation:** xAI's Grok Build TUI (docs.x.ai\u002Fbuild\u002Fmodes-and-commands, official) ships a first-class equivalent — `\u002Ftasks` lists background tasks, subagents, and scheduled tasks together, and `\u002Fworkflows` opens a live run dashboard — a single-view worker\u002Ftask status roster is a validated pattern here, not a one-off idea specific to this script.\n\nThis can sit in the same `PreToolUse`\u002F`Agent` matcher block as `check_dispatch_brief.py` above — Claude Code runs every hook command listed under a matcher, in order (see `settings.json.new`, already handed to the user, for exactly this shape). State lives in its own file (`.claude\u002Fhooks\u002F.execution_manager_state.json` by default, override with `EXECUTION_MANAGER_STATE_FILE`), separate from `check_dispatch_brief.py`'s marker files, so the two don't interfere with each other. Verified with 13 isolated stdin\u002FCLI cases (empty dashboard, start\u002Fupdate\u002Fclear, unknown-status rejection, hook mode silent when nothing's stale, hook mode warning once staleness is simulated, PostToolUse and non-Agent calls both silent, malformed stdin fails open, multiple workers with mixed states).\n","# Delegating to Subagents\n\nHanding work to an agent is itself a decision. Delegate badly and it's slower than doing it yourself; trust a report without verifying it and you get told work was done that wasn't.\n\nThe same discipline applies one level up: a principal engineer delegating to another engineer or team needs the same brief + scope + verify, not just AI subagents. This skill stays focused on the AI-subagent mechanism, since that's what the hook below actually wires up.\n\n**Distinguished\u002FFellow angle:** at this tier delegation shifts from handing off tasks to handing off technical *direction* — the deliverable is often a doc, runbook, or review process built to outlive any single delegation, so the practice keeps running after the person who set it up leaves.\n\n**Executive angle (CTO\u002FVP-Eng):** if a delegation pattern keeps recurring (the same kind of review, the same kind of parallel research), that's a signal it should become a role or a team with headcount and budget, not a habit repeated ad hoc by whoever's available.\n\n## Decide whether to delegate first\n\n- Is this an independently investigable\u002Fexecutable chunk, or does every step depend on the last result? The latter is faster done directly, one step at a time. **Hncs example:** `evaluate_*.py`\u002F`calibrate_profile_\u003Cbrand>.py` are deliberately standalone per brand — never importing a sibling, copying the loader instead — so one brand's calibration run is a genuinely independent scope you can hand to its own subagent. The brand-agnostic orchestration\u002Fstatistics code (`summarize()`, `_paired_cv_losses()`, `run_per_brand_calibration()`) is the opposite case: it's shared, not copied, so it is *not* independent scope — a change there has to be one coordinated dispatch, not sliced per brand.\n- **Parallel is normal across independent domains.** Fixing 3 unrelated failures (different files, different causes) means calling dispatch multiple times in one turn — that's what parallel execution looks like. Each agent gets zero session history, a narrow scope (one file \u002F one subsystem), explicit constraints (\"don't touch production code\"), and a concrete deliverable. Related failures (fixing one might fix another) stay sequential, not split into parallel dispatches.\n- **Never let two dispatches edit the same live file at once.** Even across unrelated domains, if files overlap, pull that file out and handle it sequentially.\n  - Deliberately having multiple agents solve the same problem differently, to compare approaches, is a different case — run those in isolated workspaces each (e.g. git worktrees). Note a worktree only sees committed content — if a worker needs uncommitted drafts or scripts, copy those files in explicitly; assuming \"it'll be visible anyway\" means the worker won't find them.\n- \"I don't feel like doing it\" isn't a reason to delegate. Saving context, a genuinely independent domain, or comparing approaches — delegate for a reason.\n- **Scope permissions per role.** Don't give write access to a subagent that's only supposed to review — when responsibilities split, permissions should split too, so a reviewer can't drift into fixing things mid-review. xAI's Grok Build (open-source) ships this as four named tiers on every subagent spawn (`SubagentCapabilityMode::ReadOnly\u002FReadWrite\u002FExecute\u002FAll`, each filtering the actual tool list the child receives) rather than a binary read\u002Fwrite flag — a real system needed more than two buckets.\n- **Flat isn't the only shape.** Dispatching N independent subagents yourself is the default, but for a genuinely multi-role job (triage → fix → verify, or several specialized workstreams that need to hand off to each other), consider one coordinator subagent that dispatches and sequences the others, rather than you tracking every handoff directly. Reserve this for jobs with real inter-agent handoffs — a flat dispatch is simpler and should stay the default for independent, unrelated pieces of work.\n\n## Give a recurring role a name — treat it like a colleague, not a tool call\n\n- **A role you delegate to repeatedly deserves an identity**, not a fresh anonymous dispatch every time. xAI's Grok Bot (official, docs.x.ai\u002Fgrok-bot\u002Foverview) states this directly: \"a Bot = a single persistent, named agent... a persistent, named teammate with a durable state\" — not a chatbot you re-explain things to from zero. The same shift costs nothing here: name the role by what it does (`Bug Reproducer`, `PR Steward`) instead of leaving it as an anonymous `general-purpose` dispatch, and treat that name as an identity you build on across dispatches, not a label on one throwaway call.\n- **Continue it, don't reset it** (see \"Talking to an agent that's already running\" above) — this is the mechanical form of \"colleague, not tool\": a colleague you worked with yesterday doesn't forget everything overnight just because the conversation ended.\n- **Feed corrections back into the identity, not just into one conversation.** When a named role's output needed correcting, write the correction into a `persistent-memory` topic keyed to that role's name (see that skill). The next time you delegate to \"Bug Reproducer,\" it starts already knowing the correction — the same way a real colleague improves from feedback instead of repeating the same mistake with the next person who asks.\n- **What this doesn't buy you for free:** Grok Bot's bots are reported to scope-match and hand off tasks to each other without a human routing every request — but that specific mechanism isn't in the official docs directly, only in third-party writeups, so treat it as unverified. Nothing in this session's own tooling does automatic scope-matching regardless — a named role here still needs you (or a coordinator, see \"Coordinating a hierarchy\" below) to decide each handoff by hand. The metaphor buys identity and memory; it doesn't buy self-organizing delegation.\n\n## Coordinating a hierarchy\n\nIf you do reach for a coordinator, treat it as a real design decision, not just \"add a middle layer\":\n\n- **Depth limit: two levels, no more.** You → coordinator → workers. No coordinator-of-coordinators — past that, the reporting chain gets harder to verify than just staying flat would have been. Not just house style: xAI's Grok Build (open-source) enforces a nesting-depth limit mechanically at spawn time (`SubagentDepthCounter` checked against a configured `MaxSubagentDepth`), not as a convention someone has to remember.\n- **The coordinator gets a narrow brief too**, same as any subagent — an open-ended \"manage this\" mandate drifts into scope creep for a coordinator exactly like it does for a worker.\n- **Give it an explicit escalation path for a stuck worker**: a fixed retry cap, then hand back to you with what was tried — the same \"don't retry with the same instructions forever\" rule that applies at the top applies one level down too.\n- **Decide the reporting shape up front.** Hub-and-spoke (the coordinator digests worker output before it reaches you) cuts noise but can hide a real disagreement between workers; a shared thread (workers see each other's output directly) keeps that visible but adds coupling. Default to hub-and-spoke; use a shared thread only when workers genuinely need each other's intermediate output to do their own job.\n- **Verify-before-claiming applies one level up.** A coordinator's \"all three done, all green\" is still a report, not evidence — spot-check it the same way you'd spot-check any subagent's claim.\n- **Route the coordinator's status traffic to a file\u002Flog**, not back into your live context — same reasoning as \"give long-running work a name and a status line\" below, just one hop further removed. `scripts\u002Fexecution_manager.py` gives this an actual dashboard instead of leaving it as prose (see \"Optional: track execution state with a script\" below) — it tracks status, it doesn't decide anything; noticing a worker's been stuck too long is still your judgment call, the script just puts the information in front of you instead of you having to remember to ask.\n- **Signal to retroactively promote flat to coordinator:** you're mid-task manually sequencing handoffs yourself — agent A's output has to shape agent B's brief, which has to shape agent C's. That hand-sequencing is the coordinator's job, not yours; once you notice you're doing it by hand, that's the cue to insert one.\n\n## Talking to an agent that's already running\n\nThe default model above is one-shot: brief in, wait, read the result. Some environments give you more than that — a way to address a named, already-running (or already-finished) agent directly instead of only dispatching fresh ones. Where that exists:\n\n- **Continue it, don't re-dispatch it.** Messaging a named agent resumes it from its own transcript with full context — for a follow-up, a correction, or new information that should steer the rest of its work, that beats spinning up a fresh dispatch that has to be re-briefed from scratch. Reply to an incoming message by addressing the same name back.\n- **Handing off to a *different* named agent needs a shared place to leave context, not just the message body.** Grok Bot's bots share one persistent computer specifically so a handoff doesn't require re-explaining (\"Bots share one computer... makes handoffs possible without repeating setup\" — docs.x.ai\u002Fgrok-bot\u002Foverview, official). Claude Code has no literal shared filesystem across sessions, but the honest equivalent is the same shared git repo (commit the state, push it) or a `persistent-memory` topic file — write what the next agent needs somewhere durable and discoverable, then message them to look there, rather than trying to cram all of it into the message text.\n- **Subscribe to completion, don't poll.** A one-shot \"notify me when it goes idle\" subscription is the mechanized version of \"wait for the completion signal instead of tight polling\" (Common failures, below) — sending \"are you done?\" messages, or checking status in a loop, is exactly the anti-pattern that exists to replace.\n- **A coordinator's \"shared thread\"** (see \"Coordinating a hierarchy\" above) is this, concretely — workers addressing each other directly by name instead of everything routing through the coordinator.\n- **Never let a peer launder a blocked permission.** If your own session was denied or blocked from an action, don't ask another agent or session to do it for you — that routes around a permission boundary the user's own session hit, not a legitimate use of multi-agent coordination. Take it back to the user instead.\n\nThis capability set isn't universal — plain single-session Claude Code doesn't have it. Treat this section as an addendum to the one-shot model above where it's available, not a replacement for it where it isn't.\n\n- **Even where subagent tooling is sophisticated, live steering is often still absent — check, don't assume.** xAI's Grok Build (open-source, `crates\u002Fcodegen\u002Fxai-grok-tools\u002Fsrc\u002Fimplementations\u002Fgrok_build\u002Ftask\u002F`) has a genuinely rich coordinator protocol behind its `task` tool — spawn, poll-with-timeout query, wait-any\u002Fwait-all on a list of subagents, typed cancel (by id, by turn, by session, by workflow run), buffered completion summaries delivered between turns — and its message enum is explicitly exhaustive (`SubagentEvent`, doc-commented \"kept exhaustive so every actor command is handled\"). It has **no message-injection-into-a-running-child variant at all.** `resume_from` only rehydrates a *previously completed* subagent's transcript into a new one — there's no live \"send this instruction into the subagent that's still working\" path. Don't assume a \"continue a running agent\" capability exists just because a platform has rich subagent orchestration; the two are separable, and a real, carefully-built implementation shipped without the first. This is scoped to Grok Build's own `task` tool specifically — its sibling product Grok Bot (a different, closed-source architecture: persistent named bots sharing one cloud computer, not ephemeral children of one session) documents the opposite as a headline differentiator (\"Bots can collaborate independently, passing context between each other and handing off tasks\" \u002F \"It coordinates independently with other Bots\" — docs.x.ai\u002Fgrok-bot\u002Foverview, official). Not verifiable at the code level like Grok Build was, and \"handing off tasks via a shared computer\" isn't necessarily the same mechanism as live message-injection — but don't conflate the two xAI products' capabilities just because they share a vendor.\n- **Multi-wait is worth naming as an explicit choice**, not just \"wait for it\": `WaitMode::WaitAny` (proceed as soon as one of several finishes — e.g. racing redundant approaches) vs. `WaitMode::WaitAll` (need every one — e.g. independent slices that all feed the next step) are genuinely different decisions with different failure modes if you default to the wrong one.\n\n## Scheduled\u002Funattended execution\n\nBeyond a live dispatch or a continued conversation, some environments can fire a saved prompt at a future time — into this session, a specific other session, or a fresh one — without anyone needing to be present when it fires.\n\n- **Verified, not theoretical:** a one-shot trigger was scheduled 2 minutes out; it fired on its own, delivered as a new turn carrying the actual fire time, and the scheduled command ran for real (a `persistent-memory` append landed in `.claude\u002Fmemory\u002Fscheduled-execution-demo.md`, confirmed by reading the file back afterward) — not a hypothetical capability described secondhand.\n- Use this for the reusable-template-on-a-schedule case from \"How to brief\" above (a recurring brief that re-fires itself instead of you remembering to re-dispatch it), or for a check-in on long-running work instead of manually deciding when to look again.\n- **This isn't the same as \"always running.\"** The trigger fires a fresh turn into a session — the underlying environment can still reclaim an idle container between firings. It gets you unattended re-invocation at a point in time, not a persistent background process running continuously in between.\n- Not universal — this is specific scheduling tooling, not something every Claude Code environment has; confirm yours actually has it before relying on it, the same caveat as \"Talking to an agent that's already running\" above.\n- **Test-run it once before trusting it unattended.** Fire it manually first and check the whole path: the right input actually gets picked up, the output lands where expected, and a failure is visible somewhere instead of silently swallowed. Don't let the first real run also be the first tested run.\n- **Some environments go further: named, saved workflows with pause\u002Fresume\u002Fstop.** xAI's Grok Build TUI (docs.x.ai\u002Fbuild\u002Fmodes-and-commands, official) ships `\u002Fworkflow \u003Cname> [args]` as a saved, resumable background job with explicit `pause`\u002F`resume`\u002F`stop` sub-commands and a live run dashboard (`\u002Fworkflows`) — a different capability shape than the one-shot future-fire trigger above. This session's own trigger tools (`create_trigger`\u002F`update_trigger`) only expose enable\u002Fdisable for a trigger's *future* firings, not pause\u002Fresume of an *already-running* execution — check what your own environment actually exposes rather than assuming the stronger shape is universal.\n\n## How to brief\n\n- Give **the task + interfaces it touches + constraints.** Don't paste a summarized session history — hand over file paths and let the subagent read them itself.\n- Pasted text or a returned summary sits in your context from that point on. Passing a file path is always cheaper.\n- If the target is vague (\"fix this up\"), narrow it yourself before delegating — a vague brief comes back as a vague result.\n- **Record a baseline right before dispatching** (e.g. `git rev-parse HEAD`). Use this baseline later for diffs and review scope — `HEAD~1` silently picks the wrong range if another commit landed in between. `git rev-parse HEAD` alone misses **uncommitted** changes already in the working tree at dispatch time — if there were any, also snapshot `git diff` (and `git diff --cached`) before dispatching, or just commit\u002Fstash first so the baseline is clean. Otherwise a later \"what changed\" diff mixes the subagent's work with whatever was already sitting there.\n- **If the same kind of task recurs, capture the brief once as a reusable template** instead of re-explaining it from scratch each time — and fold in corrections as they come up, so the template actually improves with use instead of staying a stale first draft (see `persistent-memory` for the actual file-based mechanism and a small CLI for it). If your environment has a real scheduler, wire the template into one instead of manually re-dispatching it each time it comes up (see \"Scheduled\u002Funattended execution\" below) — same end state as \"demonstrate a workflow once, replay it on a schedule,\" just built from an explicit saved prompt rather than something the agent is assumed to remember on its own.\n\n## Verify what comes back\n\n- **Don't take the report at face value.** \"Tests passed\" is a claim, not evidence — run it yourself or read the diff (same principle as `verify-before-claiming`; delegating doesn't exempt you).\n- Get reports and reviews **as files.** A long reply dumped into the chat window gets lost to compaction, and the next round has to re-read from scratch.\n- If you asked for a review, don't tell it in advance what not to flag — let findings surface, including ones you expect to dismiss, then judge them yourself afterward. Spec compliance and code quality are **different axes** — don't let one obscure the other.\n- **After running several in parallel**, before merging: read each summary separately → check whether two agents touched the same code (if they overlapped, re-review just that part) → run the full test suite once more to catch combination issues invisible to either agent alone.\n\n## When it's blocked or the review loop won't end\n\n- On a BLOCKED report, don't retry with the same instructions — give concrete feedback and retry, use a stronger model, or split the task. Nothing changes, nothing improves.\n- **Tag *why* it's stuck, not just that it is.** xAI's Grok Build (open-source, `crates\u002Fcodegen\u002Fxai-workflow\u002Fsrc\u002Frun.rs`) types a paused workflow's reason instead of leaving it a bare boolean — `user` (waiting on a human), `back_off` (rate-limited, retry later), `no_progress` (stuck, not converging), `verification` (blocked on a failed check), `infra` (the environment\u002Ftooling broke). The fix differs by kind: retry-with-delay for `back_off`, escalate or reslice for `no_progress`, fix the check itself for `verification`, fix the environment for `infra` — collapsing all of these into one generic \"BLOCKED\" loses exactly the information that says which response applies.\n- Findings from a review go to **one subagent at a time** to fix all of them — spinning up a new subagent per finding rebuilds context from scratch every time.\n- **Cap the fix → re-review loop** (e.g. 3 rounds). Past the cap without resolution, judge it yourself: wrong or trivial → note why and move on; real and material → decide the smallest fix yourself and record it. **Never drop it silently** — record the verdict and the reason either way.\n- **Don't fix it yourself** (except a minor case you judge doesn't need review). A controller fixing things directly skips the review step, and that code piles into your own context.\n- For a hard-to-reverse decision where judgment is split, instead of one more review, put two agents on opposing sides to argue it out — a tradeoff invisible from one side alone sometimes only shows up that way (a heavier tool, for situations like `weigh-tradeoffs` \u002F `adversarial-review`).\n\n## Calibrate how often you interrupt\n\n- Don't ask for confirmation on every step — let the routine, reversible ones go through silently and save the interrupt for the one that actually matters. Asking \"OK to proceed?\" on trivial steps trains the user to rubber-stamp everything, which defeats the point of asking at all.\n- Same bar as `weigh-tradeoffs`: reversible → just do it and show the result after; irreversible or consequential → stop and ask before, not after.\n- **A confirmation gate protects the next action, not what already happened.** If a subagent already sent the email or merged the commit, asking \"OK to proceed?\" afterward is theater — the interrupt has to sit before the irreversible call fires, not at the point where you happen to read the report.\n- A subagent that reproduces a bug, files the ticket, and fixes it — surfacing only the one call that actually needed a human (\"should this also roll out to the EU region?\") — is more useful than one that narrates every intermediate step.\n\n## Give long-running work a name and a status line\n\n- When a delegated agent runs over a longer stretch, don't leave it silent until it finishes — give it a short name and keep a one-line status that updates as it progresses (\"Inbox Manager — sent, inbox at zero, 5 drafts parked\"). A glanceable roster beats a wall of silence followed by one huge report at the end.\n- **There's no live channel for this** — a dispatched agent returns one final result, not a stream of intermediate updates you can watch. The only way to get a status line that actually updates mid-run is to brief the agent to write its own progress to a file (e.g. `.claude\u002Fstatus\u002F\u003Cname>.md`) and glance at that file yourself; there's nothing to \"watch\" otherwise.\n- This is for genuinely long-running or ongoing delegations, not a two-minute task — for a short dispatch, just wait for the completion signal (see \"Common failures\" below).\n\n## Common failures\n\n- **\"Independent\" scope that secretly shares code.** A 2026-08 review of Hncs found 6 brand calibration files had copy-pasted their shared orchestration code byte-for-byte instead of it staying centralized — which had already caused a real bug (a hardcoded `datasets\u002Fleica\u002F...` path left over in 5 of 6 files' error messages). Slicing work \"one dispatch per brand\" looked independent; the code underneath wasn't, and the duplication is what let the bug spread silently. This is the same \"copy the loader\" pattern from \"Decide whether to delegate first\" above, on its wrong side: copying is the right call only for the piece that's genuinely meant to diverge per scope (each brand's loader). Anything with zero reason to diverge — the orchestration\u002Fstatistics code — stays centralized and imported, never copied; that's exactly the boundary this bug crossed.\n- Multiple agents edit the same file at once and clobber each other\n- Moving to the next step without verification just because a subagent said \"done\"\n- A delegated chunk too large for you to review the result — if you can't review it, it was sliced wrong to begin with\n- Checking in on a subagent at tight intervals to catch it being stuck — this only stretches the wait. Wait for the completion signal, then process it.\n\n## Optional: enforce with a hook\n\nTwo of these principles are mechanically catchable — **pasting a long conversation summary verbatim**, and **too many concurrent open dispatches** (2-3 is normal, more than that trips it) — `scripts\u002Fcheck_dispatch_brief.py` detects both right before an Agent call (PreToolUse). By default it **only warns, it doesn't block** (a default chosen with the assumption this may get installed into projects that aren't your own). To actually block, add the environment variable `DELEGATE_HOOK_STRICT=1` to the hook command — the script's header comment documents the exact behavior.\n\nAdd to `.claude\u002Fsettings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Agent\",\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"python3 .claude\u002Fskills\u002Fdelegate-to-subagents\u002Fscripts\u002Fcheck_dispatch_brief.py\" }\n        ]\n      }\n    ],\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Agent\",\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"python3 .claude\u002Fskills\u002Fdelegate-to-subagents\u002Fscripts\u002Fcheck_dispatch_brief.py\" }\n        ]\n      }\n    ]\n  }\n}\n```\n\n`Agent` is the built-in dispatch tool's name (some docs\u002Fblogs from older Claude Code versions still say `Task` — if your version predates the rename, use that instead and confirm against your own `tool_name` in a hook payload). Hook the same script into both PreToolUse and PostToolUse — PostToolUse closes out the specific dispatch that finished, keyed by the call's `tool_use_id` (hook only one side and open dispatches never get closed). If your skill is installed at a different path, update the command path to match. By default it only warns quietly (visible only in the human-facing transcript) — to make Claude actually react to it (i.e. actually block), prefix the command with `DELEGATE_HOOK_STRICT=1` (`\"command\": \"DELEGATE_HOOK_STRICT=1 python3 ...\"`). This hook is example-level enforcement — not a red-team-tested CRITICAL-tier block like Hncs's `protect_never_touch.py`, just a minimal mechanization of this skill's verbal advice. If you need something stronger, use this script as a starting point and adapt it to your project.\n\n**Limitation:** the hook only counts *how many* dispatches are open, it doesn't know *which files* each one touches — two parallel dispatches editing the same file won't trip anything as long as the total count stays under the threshold. Catching that mechanically would mean parsing each brief for the files it intends to touch and cross-checking against the others' — out of scope for this example script; \"never let two dispatches edit the same live file\" (above) stays something you enforce by reading the briefs yourself.\n\n## Optional: track execution state with a script\n\nActing as a coordinator over several workers (see \"Coordinating a hierarchy\") means tracking whose status is what — `scripts\u002Fexecution_manager.py` is a small CLI for that, so it doesn't have to live in your head or get re-derived from scratch every time you check in:\n\n```bash\npython3 scripts\u002Fexecution_manager.py start worker-a \"exploring the auth bug\"\npython3 scripts\u002Fexecution_manager.py update worker-a blocked \"waiting on a prod API key\"\npython3 scripts\u002Fexecution_manager.py dashboard\npython3 scripts\u002Fexecution_manager.py clear worker-a\n```\n\n`dashboard` prints one line per tracked worker — status, elapsed time, and note — and flags any `blocked` entry that's been stuck past `EXECUTION_MANAGER_BLOCKED_WARN_SECONDS` (default 1800s). **Be precise about what this does and doesn't do:** it tracks and displays status; it does not detect that a worker has a problem (something has to call `update ... blocked` — the worker itself, or you noticing), and it does not decide what to do about a stale one — that's still your judgment call, same as everywhere else in this skill. Read \"problem detected → automatic decision → automatic fix\" nowhere in this script; it stops at \"here's what's stale, go look.\"\n\nOptionally wire it as a `PreToolUse` hook on the `Agent` tool so a stale-blocked warning surfaces automatically right before you dispatch yet another worker, instead of only when you remember to run `dashboard` yourself:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Agent\",\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"python3 senior-engineer-mindset\u002Fdelegate-to-subagents\u002Fscripts\u002Fexecution_manager.py hook\" }\n        ]\n      }\n    ]\n  }\n}\n```\n\n**External validation:** xAI's Grok Build TUI (docs.x.ai\u002Fbuild\u002Fmodes-and-commands, official) ships a first-class equivalent — `\u002Ftasks` lists background tasks, subagents, and scheduled tasks together, and `\u002Fworkflows` opens a live run dashboard — a single-view worker\u002Ftask status roster is a validated pattern here, not a one-off idea specific to this script.\n\nThis can sit in the same `PreToolUse`\u002F`Agent` matcher block as `check_dispatch_brief.py` above — Claude Code runs every hook command listed under a matcher, in order (see `settings.json.new`, already handed to the user, for exactly this shape). State lives in its own file (`.claude\u002Fhooks\u002F.execution_manager_state.json` by default, override with `EXECUTION_MANAGER_STATE_FILE`), separate from `check_dispatch_brief.py`'s marker files, so the two don't interfere with each other. Verified with 13 isolated stdin\u002FCLI cases (empty dashboard, start\u002Fupdate\u002Fclear, unknown-status rejection, hook mode silent when nothing's stale, hook mode warning once staleness is simulated, PostToolUse and non-Agent calls both silent, malformed stdin fails open, multiple workers with mixed states).\n",{"name":5,"description":7},"main","513567c2b0eb44c159ebac74b0491bdcf823c377","senior-engineer-mindset\u002Fdelegate-to-subagents",2,"https:\u002F\u002Fgithub.com\u002Fsongjiun10-collab\u002FHncs","https:\u002F\u002Fgithub.com\u002Fsongjiun10-collab","2026-11-07 16:34:56",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add songjiun10-collab\u002FHncs --skill delegate-to-subagents",{"tool":36,"command":37},"bunx","bunx skills add songjiun10-collab\u002FHncs --skill delegate-to-subagents",{"tool":39,"command":40},"pnpm","pnpm dlx skills add songjiun10-collab\u002FHncs --skill delegate-to-subagents","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsongjiun10-collab\u002FHncs\u002Fblob\u002Fmain\u002Fsenior-engineer-mindset\u002Fdelegate-to-subagents\u002FSKILL.md",true,[44,50],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"scripts\u002Fcheck_dispatch_brief.py","SCRIPT","脚本",8447,"https:\u002F\u002Fgithub.com\u002Fsongjiun10-collab\u002FHncs\u002Fblob\u002Fmain\u002Fsenior-engineer-mindset\u002Fdelegate-to-subagents\u002Fscripts\u002Fcheck_dispatch_brief.py",{"path":51,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":52,"sourceHtmlUrl":53},"scripts\u002Fexecution_manager.py",5836,"https:\u002F\u002Fgithub.com\u002Fsongjiun10-collab\u002FHncs\u002Fblob\u002Fmain\u002Fsenior-engineer-mindset\u002Fdelegate-to-subagents\u002Fscripts\u002Fexecution_manager.py",[55,62,69,76,83,90],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M78FJ7DGE8S2MHJQY4RVTPMF","widen-the-solution-space","Deliberately widen the set of candidate approaches before committing to one. Use before irreversible decisions (architecture, DB schema, data format, public API), when the first solution feels complicated or awkward, when the user is deciding rather than instructing (\"what's the best way to do this?\"), or when a previous attempt at the same problem failed. Skip for routine work with one obvious answer.","https:\u002F\u002Fgithub.com\u002Fsongjiun10-collab\u002FHncs\u002Fblob\u002Fmain\u002Fsenior-engineer-mindset\u002Fwiden-the-solution-space\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":18},"01M78FJ2D6HMAGS8E11VBD4NS0","weigh-tradeoffs","Compare real alternatives explicitly and record why one was chosen. Use when picking between libraries, data structures, architectures, or storage options; when a decision is hard to reverse (schema, public API, data format, dependency); or when the user asks \"which is better, A or B\". Also use to decide how much deliberation a decision even deserves.","https:\u002F\u002Fgithub.com\u002Fsongjiun10-collab\u002FHncs\u002Fblob\u002Fmain\u002Fsenior-engineer-mindset\u002Fweigh-tradeoffs\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M78FHX1P3QMTMC8WPQS0Z669","verify-before-claiming","Run the verification and read its output before saying anything is done, fixed, working, or passing. Use before any completion claim, before committing or opening a PR, before moving to the next task, and after a subagent or tool reports success. Triggers on the words \"should work\", \"fixed\", \"done\", \"passing\", \"looks good\" — and on the urge to celebrate.","https:\u002F\u002Fgithub.com\u002Fsongjiun10-collab\u002FHncs\u002Fblob\u002Fmain\u002Fsenior-engineer-mindset\u002Fverify-before-claiming\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M78FHSBQ30GH1EMSBA8NJZNX","verifiability-first","Turn the task into something verifiable and declare the success criterion before seeing results. Use when the request is vague about \"done\" (\"make it work\", \"improve this\"), when writing tests, when fixing a bug (write the failing reproduction first), or when comparing two approaches. Critical before any measurement or benchmark, where deciding the bar after seeing the numbers guarantees a \"success\".","https:\u002F\u002Fgithub.com\u002Fsongjiun10-collab\u002FHncs\u002Fblob\u002Fmain\u002Fsenior-engineer-mindset\u002Fverifiability-first\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":18},"01M78FHN4P77KF3T47M1NBT7XA","threat-and-scale-check","Check trust boundaries, scale behavior, and layered safety. Use when handling user input, external API responses, files, or auth; when designing permissions, validation, or any safety mechanism; when data volume could grow; or when writing loops that touch I\u002FO. Also use when reviewing whether a single safeguard is the only thing standing between a mistake and a disaster.","https:\u002F\u002Fgithub.com\u002Fsongjiun10-collab\u002FHncs\u002Fblob\u002Fmain\u002Fsenior-engineer-mindset\u002Fthreat-and-scale-check\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":18},"01M78FHGGZKPTBRVWJK83X18CY","surgical-change","Keep every changed line traceable to the request. Use when editing existing code, especially code you didn't write; when tempted to clean up something you noticed while reading; when a diff is growing beyond the ask; or when deciding whether to delete code that looks dead.","https:\u002F\u002Fgithub.com\u002Fsongjiun10-collab\u002FHncs\u002Fblob\u002Fmain\u002Fsenior-engineer-mindset\u002Fsurgical-change\u002FSKILL.md",[],[]]