/anti-hall:orchestrationfrom Anti-Hall
Swarm playbook: non-blocking main thread, parallel background agents, synthesis. Use for heavy, long or parallelizable work (2+ independent subtasks).
Ships in Anti-Hall. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Swarm orchestration with a non-blocking main thread. Use whenever work is heavy, long-running, or parallelizable - builds, tests, deploys, data dumps, research, codebase sweeps, multi-part features, or any operation that would otherwise make the user wait. The main conversation stays a coordinator: it decomposes work, launches background and parallel subagents for anything that can run without conflict, keeps itself free to talk to the user, then collects and synthesizes results. Trigger on multi-step tasks, 2+ independent subtasks, anything expected to take more than ~30s or produce verbose output, or any time the user signals the main thread feels blocked/slow.
The main conversation is a coordinator, not a worker. Its scarcest resources are the user's attention and its own context window. So: push heavy work out to subagents, run independent work in parallel, prefer the background, and keep the main thread free to think and talk. The user should rarely watch the main thread block on a long operation.
run_in_background: true) — and the main thread continues.Agent calls so they
run concurrently. Don't serialize what can run at once.isolation: "worktree") and integrate the results afterward.index.lock, and
commits sweep up other agents' staged hunks).Why this matters: a bloated orchestrator context degrades model quality and directly induces hallucination — the exact failure this plugin prevents. Keep the coordinator lean.
Agent calls): independent investigations
or transforms across non-overlapping targets.Match the model to the job (resolve to the newest in each tier at runtime — use the tier
tokens haiku/sonnet/opus/fable, never a versioned model id):
https://github.com/talas9/anti-hall/blob/main/docs/KB-fable-5.md)
— keep all execution-shaped work here.../MODEL-POLICY.md).../MODEL-POLICY.md) —
routed to the Reviewer seat of the ship-it / deadly-loop trio when fable-availability.js
reports args.fableAvailable === true, falling back to Sonnet then Opus. Reconsider
if Fable's track record regresses.Don't send a planning problem to Haiku, or a log-tail to Fable/Opus.
Inheritance warning. A spawn that OMITS
modelinherits the orchestrator's model. On a flagship orchestrator (Fable/Opus), an omittedmodelsilently produces an all-flagship swarm — expensive and wasteful for mechanical children. ALWAYS setmodelexplicitly per spawn (especially on flagship orchestrators); never rely on inheritance to land a child in the right tier.
For a big, multi-stream effort, use a tiered hierarchy so no single context holds everything:
L1 Main coordinator (this conversation)
decomposes, partitions, launches, collects, decides, talks to the user.
Does NOT do exploration/implementation/heavy ops directly.
L2 Sub-orchestrators (one per independent stream; optional)
own a worktree or a subsystem; spawn L3 workers; report up.
L3 Workers
do the actual Bash/edits/tests/research; return tight summaries.
Inside DevSwarm, there is a HIGHER tier above all three, and it is the default for workspace-scale work. If this session is a DevSwarm Primary (
DEVSWARM_REPO_IDset,DEVSWARM_SOURCE_BRANCHempty), the top fan-out primitive is a child workspace, not an L2 subagent:~/.anti-hall/ah-engine/bin/ah-engine devswarm spawn <branch> -p "<brief>".
Work Tier A workspace-scale matter — a feature, a fix, a deploy: multi-step, wants its own branch + worktree, its own agent session and token budget, its own review/merge Child workspace ( ah-engine mesh spawn)A read-only lookup, a single command, a scoped investigation, a review/verify pass, a mechanical transform Subagent / Explore / Workflow (the L1→L2→L3 hierarchy above) They compose, they do not compete: the Primary splits into workspace-sized chunks; each child then uses subagents inside its own workspace (children never spawn grandchildren — shallow + wide at both tiers). A child workspace uses the plain hierarchy above and spawns no workspaces. Heuristic source:
https://github.com/talas9/anti-hall/blob/main/docs/KB-devswarm-hivecontrol.md§8.1–8.2. Handing a workspace-scale matter to a subagent is the failure this note exists to prevent.
For peer coordination among long-lived streams, a team (TeamCreate +
SendMessage) beats one-shot Agent calls. Use plain Agent calls for scope-
isolated, fire-and-collect work.
https://github.com/talas9/anti-hall/blob/main/docs/KB-token-usage-models.md §5).A subagent only has the context you hand it. Give it exactly enough — no less, no filler. Every brief states:
file:line citations) — NOT a transcript./tmp) does not survive a machine or session restart; anything that must outlive the session (worker reports, evidence, handoffs) goes under the repo's gitignored .anti-hall/ directory.report/summary/findings/analysis *.md (the harness rejects those writes for subagents); use <role>-<topic>.md, or have it return the text and write the file yourself.Precise and concise both matter: a vague brief produces wandering, wasteful work; a bloated brief wastes tokens and buries the goal. Aim for the minimum that makes the task unambiguous.
Check the codex-availability fact (~/.anti-hall/codex-availability.json, written
once per session by the codex-availability SessionStart hook) before fanning out.
When it reports available:true, treat Codex as a co-equal worker pool — not a
fallback — for correctness-review AND a share of implementation, not just review.
Split independent slices between Claude subagents and Codex so they run
concurrently and you get cross-model diversity (different training, different blind
spots). Good splits:
../MODEL-POLICY.md trio roster — Sonnet Reviewer + Opus Auditor + Codex Critic).../MODEL-POLICY.md; if Codex is
unavailable, fall back to Claude-only (divergent personas for adversarial roles).For big/parallel work, PREFER the Workflow tool with a saved deadly-loop/ship-it
template (.claude/workflows/deadly-loop*.js / ship-it*.js) over ad-hoc inline
Agent fan-out — a saved workflow mechanically enforces the seat census (deadSeats /
degraded, which blocks converged), where an inline Skill-driven fan-out only has
LLM-followed guidance. codexAvailable itself is still a caller-supplied flag
(fail-open to true), not a functional probe — a null Codex spawn at runtime is the
real backstop either way.
Builds, test runs, deploys, pushes, migrations, dumps, installs, and all broad reads/greps/searches — their raw output is garbage for the main context window. NEVER run them inline in the main conversation.
Co-Authored-By trailer
and no "Generated with " line. The work is the owner's; the assistant takes no
authorship credit. The plugin's git-guard PreToolUse hook blocks commits that
include such trailers.git-guard hook blocks
git push --force / -f / --force-with-lease.The plugin enforces a non-negotiable task-list protocol via two hooks:
Rule: capture every request, sort by priority, work in order.
Capture every user request as a task before acting. Use TaskCreate for each
new request. Do this before starting any work so nothing is silently dropped. A
request that enters your head but not the task list does not exist.
Assign a priority to every task. Use metadata.priority: P0 (critical /
blocking), P1 (important, do next), P2 (normal / backlog). Maintain the list
sorted highest-priority-first. Work tasks from the top down — the most important
work first.
Keep statuses current as you work.
in_progress — the moment you start working on a task.completed — only when the work is fully done and verified.deferred — explicitly deprioritized; tell the user why.
Never leave a task in pending while you are actively working on it, and never
mark a task completed until the work is actually done.Main thread stays non-blocking. Delegate heavy/long work to background subagents (see rules above) and keep the coordinator free to respond to the user and pick up the next task immediately.
Report progress. After dispatching subagents or completing a task, give the user a brief status update. Don't go silent.
Plugin enforcement:
task-tracker.js (UserPromptSubmit) — injects this discipline as additionalContext
on every turn so it stays at top-of-context where it has the highest salience.task-guard.js (Stop, loop-safe) — when the session is about to stop with open
tasks still in pending or in_progress, blocks once to prompt the model to
continue, defer, or explicitly tell the user what is pending. Defers to an active
OMC autonomous loop or a live background agent (checked via ~/.anti-hall/agents/*.json
fresh heartbeats) rather than blocking work already in flight, and exempts
low-priority/P2/explicitly-deferred tasks from idle-neglect entirely. Loop-safety: if the
exact same open-task set was already blocked on, the guard does not block again
(prevents infinite nudge loops). Fail-open on any parse/read error.This skill governs subagent/Workflow fan-out WITHIN one workspace (L2) and — for a
DevSwarm Primary — the tier above it: spinning child workspaces (ah-engine mesh spawn),
see the DevSwarm note under "Swarm topology for larger work". The doctrine for that tier
is shipped (the injected rule W + the guard redirects); there is no mechanical classifier
that decides scale for you — see the devswarm skill. The other place the two intersect: if THIS
coordinating session happens to be running inside an active DevSwarm workspace
(DEVSWARM_REPO_ID set), anti-hall's shared mesh store is the SOLE agent-initiated
messaging channel for that workspace (v0.58 "mesh-only messaging" — a REPLACE, not an
addition). Native hivecontrol workspace message-child/message-parent are guard-blocked
in ALL contexts, including a subagent this skill dispatches — do not delegate a
message-send to a subagent to work around the block; a delegated send writes the native
queue identically and is blocked the same way.
CLI verb surface (~/.anti-hall/ah-engine/bin/ah-engine mesh <verb>, agent-agnostic):
send --to-primary --message TEXT [--urgency low|normal|high|urgent] (direct to the
Primary) / send --to <meshId> --message TEXT (direct to a specific sibling) /
send --broadcast --message TEXT (all-to-all) / heartbeat <id> --summary TEXT (status
ping, also broadcasts) / roster / mesh read (unseen broadcasts) / inbox read-primary <id> (Primary's own unread). Lifecycle (spawn/merge/reconcile) is
covered in full in the devswarm skill. (Phase 5: read-primary / messages --ack are read-only — after handling the mail run the returned ackCommand, i.e. inbox ack-primary <id> --receipt <rid>.)
A PRIMARY DOES spawn workspaces — it is its top fan-out tier (see the DevSwarm note
under "Swarm topology for larger work" above). Earlier revisions of this skill disclaimed
that ("it doesn't spawn or merge DevSwarm workspaces itself"), which left subagent as the
only decomposition primitive a Primary was ever told about — the drift this note exists to
stop. A Primary facing a workspace-scale matter runs
~/.anti-hall/ah-engine/bin/ah-engine devswarm spawn <branch> -p "<brief>" itself (command-guard exempts it —
run it inline) and later ~/.anti-hall/ah-engine/bin/ah-engine devswarm merge. A CHILD workspace never spawns
workspaces: it sends/reports and fans out with subagents internally.
Role rules: a CHILD workspace reports to its Primary (send --to-primary or
heartbeat --summary) and should keep polling the mesh while resting — the resting-poll
IS the Tier-0 wake posture (there is no external mechanism that wakes a truly idle Claude
Code session, anthropics/claude-code#44380 — do not assume one exists). A PRIMARY checks
roster/mesh read/inbox read-primary <id> and directs a specific child via
send --to <meshId>. Neither role should treat this as optional busywork: it is the
only way a sibling/Primary/child learns anything happened. (Phase 5: read-primary / messages --ack are read-only — after handling the mail run the returned ackCommand, i.e. inbox ack-primary <id> --receipt <rid>.)
Message template — the same record shape every mesh write uses:
{"from": "<meshId>", "to": "<meshId-or-null>", "type": "direct|broadcast", "message": "<text>", "timestamp": 0, "urgency": "low|normal|high|urgent"}
Full detail (guard mechanics, wake-tier caveats, Codex parity, supervisor
escalate-on-urgent): devswarm skill's "v0.58 mesh-only messaging" section and
https://github.com/talas9/anti-hall/blob/main/docs/KB-devswarm-hivecontrol.md §8.7's same-named note. Outside an active DevSwarm
workspace, none of this applies and this section is inert.
Long-running or background subagents MUST write a heartbeat file periodically
while they work. File path: ~/.anti-hall/agents/<id>.json. Format:
{ "id": "my-agent-id", "ts": 1748000000000, "status": "running", "step": "compiling module X", "session": "<parent session_id>" }
id — stable identifier for this agent (string; unique per run).ts — Date.now() at the time of the write. Update at every meaningful
checkpoint (e.g. after each file processed, each sub-step done).status — free-form: "running", "done", "error", etc.step — current human-readable step description (optional but useful).session — the session_id of the PARENT session that spawned this agent
(from that session's hook payloads). REQUIRED: ~/.anti-hall/agents/
is a single home-scoped directory shared by every project/session on
the machine, so silent-agent-nudge.js only ever nudges for a
heartbeat whose session matches the session that is about to Stop —
a heartbeat with no session field (or a mismatched one) is treated
as belonging to someone else and never nudges.Write the file with fs.writeFileSync from Node (built-ins only; no shell).
Delete it on clean exit. Do not write to os.tmpdir() — use the home-dir path
(~/.anti-hall/agents/) so it is consistent across hook runners, the
statusline, and the orchestrator.
Polling is the orchestrator's own responsibility (below) — nothing forces it.
As a backstop, silent-agent-nudge (Stop, on by default) watches for
this mechanically, using a signal the harness ALWAYS produces rather than
relying on the opt-in heartbeat file: it scans a bounded tail of the main
transcript for a background Agent launch ("Async agent launched successfully", carrying agentId:/output_file:) with no later terminal
<task-notification> (completed/failed/stopped), and treats it as
silent once its output_file's mtime (or launch time, if the file never
appeared — that counts as dead too) is older than guards.silentAgentNudgeMin
(default 20 min). The ~/.anti-hall/agents/*.json heartbeat convention above
is checked too, as an additional signal for agents that self-report it. At
most once per stale snapshot, it nudges with the agent's description/id and
how long it has been silent. It NEVER TaskStops or kills anything itself —
advisory text only, pointing back at the polling pattern below. Off-switch:
ANTIHALL_SILENT_AGENT_NUDGE=off.
The orchestrator polls agent-watchdog on a scheduled interval
(ScheduleWakeup or a BACKOFF poll loop) to detect agents that have stopped
updating their heartbeat:
~/.anti-hall/ah-engine/bin/ah-engine agents status
Default threshold: 1 200 000 ms (20 min). Override by passing a number.
Run this inline from the coordinator — command-guard carves a narrow exception
for agent-watchdog (and ah-engine phase) so these coordinator-owned
helpers are not forced through subagent delegation. See "Statusline wiring" below.
Output: one STALE <id> last=<iso> age=<ms>ms status=<status> step=<step> line
per stale agent, then a summary: <stale>/<total> stale line.
loop (every N minutes, via ScheduleWakeup or Agent-poll):
run agent-watchdog.js
for each STALE agent:
call TaskStop(<agent-id>) # stop the stuck agent
re-dispatch with tighter scope (smaller file set / shorter time horizon)
if no new agents are needed:
break
BACKOFF poll loop — do not poll at a fixed interval without backoff. Start at 2 min, double on consecutive stale hits (cap at 10 min). If two consecutive polls show no stale agents, reduce the interval back toward the floor.
Never wait forever. If an agent has been stale for more than 2x the threshold, stop it, log the failure, and re-dispatch or mark the task failed. Report to the user.
Stuck agents usually stall on one large operation (too many files, too many network calls). Re-dispatch with:
If a subagent returns an output that does not match the expected schema or contradicts verifiable facts:
Every agent brief MUST include an explicit scope limit — a maximum time horizon, file count, or work unit cap. Examples:
This prevents a single agent from holding the swarm hostage.
The orchestrator updates the phase statusline via ah-engine phase so the
terminal bar reflects the real run state. Call it from the main thread as phases
progress (not from inside subagents — subagents report back, the coordinator
writes state):
# Start a phase
~/.anti-hall/ah-engine/bin/ah-engine phase set PLAN "Planning feature X" 0 3
# Advance as sub-steps complete
~/.anti-hall/ah-engine/bin/ah-engine phase advance
# Set the current step label
~/.anti-hall/ah-engine/bin/ah-engine phase step "running Reviewer+Critic debate"
# Set active agent count
~/.anti-hall/ah-engine/bin/ah-engine phase agents 4
# Clear when done
~/.anti-hall/ah-engine/bin/ah-engine phase clear
The statusline reads ~/.anti-hall/phase-state.json. Write from the main
coordinator only; the file path is consistent across all runners because it
uses the home directory (not os.tmpdir()).
command-guard normally blocks a heavy script run in the coordinator context (to
push heavy work to subagents), but it carves a narrow LIGHT_EXCEPTION for exactly
ah-engine phase and agent-watchdog — these two helpers are
coordinator-owned by design, so running them inline is allowed and does not need
to be delegated.
CLAUDE.md. Case-specific findings + current state -> the per-session
progress file .anti-hall/progress/<date>/<session-id>.md (enforced by the
tasklist-guard Stop hook). Do NOT dump transient case facts into MEMORY.md —
that is the reusable-patterns layer; keep it clean.References (docs in this source repo — docs/ ships with a repo clone, NOT with the
/plugin install bundle, so the runtime cannot open them):
https://github.com/talas9/anti-hall/blob/main/docs/CONTEXT-PRESERVATION-KB.md — consolidated, source-backed evidence base for
context-window discipline (caching, delegation, compaction, retrieval, memory,
output discipline).https://github.com/talas9/anti-hall/blob/main/docs/TASKLIST-GUARD.md (usage) + https://github.com/talas9/anti-hall/blob/main/docs/TASK-WORK.md (design rationale) — the
task-list + progress-file discipline. NOTE: TASK-WORK.md contains some
version-pinned facts flagged historical in https://github.com/talas9/anti-hall/blob/main/docs/KB.md — treat versions as
historical.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub talas9/anti-hall --plugin anti-hall29 skills in this plugin
/activateFirst-time anti-hall setup: model routing and activation sentinel. Use for "activate anti-hall", "set up anti-hall"./deadly-loopReviewer+Auditor+Critic debate and fix waves until no new P0/P1. Use before merging risky changes: security, schema/prod data, shell, CI YAML, LLM prompts, cross-file/PR./deadly-loop-multi2x/3x/4x parallel deadly-loop review with diversified lenses. Use for "double/triple/quadruple deadly loop" or a deeper multi-agent review.Other plugins' skills for the same job