/anti-hall:doctorfrom Anti-Hall
Check and repair anti-hall (hooks, guards, legacy cleanup). Use for "is anti-hall working", "anti-hall doctor", "repair anti-hall".
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.
Health-check AND repair anti-hall — confirm the thin client and the engine are installed and healthy, every hook command is the direct form, the guards actually fire (live behavioral self-tests on git-guard / command-guard / edit-guard / swarm-guard / model-routing-guard), legacy statusline cleanup is safe, and (with --repair) apply safe fixes. Plain doctor is read-only. Use when the user asks "is anti-hall working / active / running", "check the hooks", "anti-hall doctor", "repair anti-hall", "fix the daemon", "are the guards on", or after install/update to verify everything is live.
Answers the only question that matters for a guardrail plugin: is it actually running,
and do the guards actually fire? It checks presence AND behavior — not just that files
exist, but that the guards block what they should and allow what they should. It can also
repair: doctor --repair diagnoses everything AND applies the safe fixes (see
Repair mode below). A plain doctor is read-only — it reports and
changes nothing.
~/.anti-hall/ah-engine/bin/ah-hook) and engine. No Node is needed on a hook path.hooks.json is the direct form (thin client first, hooks/install.sh as the fallback), the plugin ships no shell file besides hooks/install.sh, and a hook command or statusLine that still runs a retired ah-hook.sh/ah-run.sh wrapper fails the doctor (ah-engine doctor --repair rewrites it, keeping a backup).git status;
command-guard blocks heavy commands in the coordinator but ALLOWS them in a subagent
(payload agent_id); edit-guard blocks a coordinator Edit but ALLOWS the same Edit in
a subagent (payload agent_id/agent_type), sharing that coordinator-vs-subagent
discriminator with command-guard via coordinator-detect.js; swarm-guard allows a
normal spawn under healthy memory; model-routing-guard blocks a mechanical task pinned
to a flagship model (synthetic payload: fetch/download description + model:"opus" +
subagent_type:"general-purpose" → exit 2) and allows a benign spawn with no model and
no mechanical signals (exit 0); the OMC-deference detection consumed by task-guard / tasklist-guard is built
into the engine.--repair archives them (nothing is deleted)..anti-hall/handovers/<date>/<session_id>/, each with its canonical destination.statusLine remains and can be cleaned up.quick_check via an
isolated --no-warnings read-only probe, journal torn-line scan, store↔summary
parity), data staleness (summary.json age, gated on the daemon actually running
AND a workspace having unread backlog — an idle system never false-alarms),
daemons RUNNING vs merely installed (per-worktree ingest + the supervisor —
distinguishes installed-but-DEAD from not-installed), and a no-other-consumer scan
(a second native hivecontrol workspace monitor process would split the
destructive queue — report-only, never killed). See Runtime health
checks below.doctor-devswarm's
orphanedWorkspaceProcessCheck): a bounded (≤2s), report-only scan for any
LIVE process whose cwd sits inside a workspace worktree that is now
archived (anti-hall's own archived/<id>.json, or the DevSwarm app DB's own
archived builders) or simply gone (an active descriptor whose worktreePath no
longer exists on disk). Prints N process(es) alive with cwd in archived/gone workspaces: pid <pid> (<comm>) cwd=<path> [<reason>]; ... — pid, command name,
and cwd for each — and a suggested MANUAL kill <pid> command. Never kills,
signals, or closes anything itself. macOS reads lsof -a -d cwd -Fpcn;
Linux walks /proc/<pid>/cwd. Silent when nothing is stale to watch for or
the scan finds no hit.hooks.json/skills against anti-hall's
own. See below.anti-hall ACTIVE — N checks passed, or the list of failures.Wired into the existing "DevSwarm liveness supervisor" section (same gate:
isDevswarmActive(env) or a published workspace descriptor), implemented in
doctor-runtime. All four are report-only — none of them
restart, reinstall, or kill anything (that stays doctor-repair.js's job, still
gated the same way):
store/<hash>/devswarm.db,
plus a legacy flat store/devswarm.db if a pre-migration one is present) and, for
each, opens a SEPARATE read-only node:sqlite handle and runs PRAGMA quick_check. WAL means this can never
block the ingest daemon (its single-consumer lock is a distinct O_EXCL
lockfile, not a DB lock). The require('node:sqlite') call happens only
inside a --no-warnings child probe, so its ExperimentalWarning never reaches
doctor's own stderr. The journal backend gets a torn-line scan (a torn line
followed by more valid content is real corruption; a torn trailing line is a
normal in-flight write and is never flagged). Store↔summary parity flags
only summary.total > store.total (a store ahead of a not-yet-derived
summary is normal and never flagged).summary.json only when the daemon is
confirmed RUNNING (check 3) and a workspace has unread > 0; prefers the
ingest daemon's own per-worktree heartbeat (heartbeats/ingest-<hash>.json,
rewritten every sweep) over the blunter generatedAt, which only advances on
an actual insert.listInstalledIngestUnits) and the supervisor: launchctl list / systemctl --user is-active / (cron fallback) heartbeat-or-ps. Distinguishes
installed-but-DEAD (WARN) from not-installed (INFO, not a warning).
v0.66 — alive but ingesting nothing: a daemon can be RUNNING (fresh
heartbeat, live-pid lock) while every hivecontrol workspace monitor spawn
it makes still FAILS (a permanent config fault, e.g. ENOENT/EACCES/ENOTDIR
— commonly a bare binary name plus the scheduler's minimal PATH). The
heartbeat now carries the monitor OUTCOME (consecutiveMonitorFailures /
lastMonitorOkMs / lastMonitorErrorCode — see devswarm-ingest.js's
writeIngestHeartbeat), and repair mode reports this as its own FAILURE
(not "installed and healthy") once 3+ consecutive failures are recorded, or
no monitor poll has succeeded for longer than devswarm.monitorNoOkFailMin
(default 10 min) — since the last success, or since the daemon started
(startedAtMs) when it has never succeeded; inside that window a fresh
daemon reports starting up, not failing. The heartbeat also carries
lastMonitorAttemptMs and lastMonitorError. The remedy depends on
WHICH kind of fault it is (doctor-repair's exported
isMonitorConfigFault()): a genuine config fault — the daemon's own
monitor breaker only stamps lastMonitorErrorCode for a PERMANENT
spawn-error code (ENOENT/EACCES/ENOTDIR — the binary itself cannot be
resolved/executed) — is repaired by reinstalling, which bakes the resolved
absolute binary + PATH into the regenerated unit. A slow or
timing-out hivecontrol (ETIMEDOUT, or any failure without a
resolvable spawn code — lastMonitorErrorCode stays null) is reported as
its own plain-language status (monitorSlowReason()) and is never
reinstalled or restarted: the daemon process is alive and its heartbeat
is fresh, so a reinstall would only interrupt an otherwise-healthy daemon
without making hivecontrol respond any faster. A heartbeat missing these
fields (an older daemon build that has not been relaunched yet) is
UNKNOWN, never a fault. The SAME verdict (same thresholds, same
missing-fields=UNKNOWN rule — one shared predicate, hooks/lib/ doctor-repair.js's exported monitorFaultFor()) also drives the
in-session hot-path banner: ingest-health's
daemonHealth() returns status:'failed' (distinct from 'healthy' and
'stale') for either kind of monitor fault, and buildMonitorFaultBanner()
renders the one-line in-session warning (shown once per fault episode, not
on every prompt). For a config fault it says to run doctor; for a timeout it
says the daemon is healthy, the DevSwarm app's hivecontrol is not
answering, mesh messages are unaffected, and doctor cannot repair it — check
or restart the DevSwarm app — so a daemon that is
alive-but-broken (of either kind) is never misreported as a mere staleness
blip, and repair mode alone decides whether that means reinstall or just a
status line.ps scan for hivecontrol workspace monitor processes; more than
one, or one holding no lock, is a high-severity WARN (report-only — the
single-consumer invariant is never enforced by killing anything here).Its own unconditional top-level section (doctor-runtime's
scanForeignConflicts) — runs regardless of DevSwarm state. Cross-references
every OTHER enabled plugin's hooks.json (found via
~/.claude/plugins/installed_plugins.json, the harness-owned install index) and
skill directory names against anti-hall's own. A foreign PreToolUse hook on
Bash or a second Stop hook is surfaced (WARN — third-party plugin config is
never a reason to fail anti-hall's own exit code); additive UserPromptSubmit/
SessionStart overlap is INFO (non-competing); a skill-name collision is WARN.
Privacy: only the plugin name, event, matcher, and hook script basename
are ever reported — never a full command string (which can carry a local
username/path) or file contents.
Plain doctor is read-only: full diagnosis, no repair pass, nothing changed. Repairs
are opt-in: doctor --repair (alias --fix) runs the diagnosis AND then a repair pass
that fixes what it safely can. The repair pass writes files/units, so the same
Haiku-delegation rule applies (below). When the user asks to "repair" / "fix" anti-hall,
pass --repair; for "is it working?" run it plain.
Flags:
| Invocation | Behavior |
|---|---|
"$HOME/.anti-hall/ah-engine/bin/ah-engine" doctor (no flags) | FULL detection, read-only — no repair pass. This is the default. |
--repair / --fix | FULL detection + apply AUTO-SAFE fixes + GATED daemon fixes only when the DevSwarm gate is open. |
--dry-run | Detection + print exactly what WOULD be fixed. Writes nothing (threads each installer's own --dry-run, migrate-state dryRun:true). |
--check | PURE read-only — detects + reports everything, mutates NOTHING. The CI / scripting path. |
--quiet | One-line verdict only (combines with any of the above). |
Two safety classes:
--dry-run): legacy/GSD/DevSwarm-store state
migration; retired statusline install is skipped and never writes statusLine;
idempotent relaunch of an ALREADY-installed supervisor; refresh of Codex hooks when
a .codex/config.toml exists but the hooks are unwired (it never creates a new .codex).isDevswarmActive(env) (a
DevSwarm-active session) AND resolveWorktree(cwd) is a real git worktree. Covers
the ingest daemon install, the v0.54.1 wrong-path ingest heal (a unit whose
WorkingDirectory no longer points inside a worktree is rebuilt from the right one),
stale ExecStart script, the supervisor FIRST-install, and (v0.58.1) reconcile
— draining every stranded per-worktree native hivecontrol queue into the shared store
(~/.anti-hall/ah-engine/bin/ah-engine mesh reconcile, previously a MANUAL-only verb). Unlike the
daemon fixes, reconcile never touches launchd/systemd, so it needs no scheduler.
When the gate is closed, doctor reports the gap plus the exact manual command and
mutates nothing.One migration registry. The all-store DevSwarm forward-migrations (fold-all-stores,
heal-orphan-partitions, fold-archived-rows, fold-archived-family-descriptors,
reconcile-dual-partition-acks) are listed once in migrations and shared by doctor --repair, update and the
supervisor. Each is stamped done per plugin version in ~/.anti-hall/update-sweep-state.json
after one clean pass, so a repeat --repair skips it with a single marker read instead of
re-scanning every store. Deletion-class repairs (--repair-resurrected) are never in that
set — opting into --repair is not opting into row removal. A twin descriptor the
fold-archived-family-descriptors pass deliberately refuses to retire (its worktree still
exists, or an archived copy already exists and differs) is not a failure: the row is
skipped, lists each twin (8-char id + reason, first 10 then +N more) and says it was left
untouched on purpose — check those two things if you want to resolve it by hand.
Plugin cache prune (opt-in, never automatic). doctor --prune-cache lists the old
~/.claude/plugins/cache/anti-hall/anti-hall/<semver>/ dirs it would remove and their total
size; only doctor --prune-cache --confirmed removes them, logging each removal. It keeps the
newest 3, the installPath registered in installed_plugins.json, every version a live
process runs from (cwd or argv), the running version, and anything it cannot parse; symlinks
and paths outside that root are refused, and nothing is removed if the process scan is
unavailable. Nothing else ever runs it (not update, the supervisor, a cron or a hook).
Setting updates.allowCachePrune (default true) enables the verb.
Leaked scheduler units (always on, report-only). Every run (including plain doctor
and --check) scans each anti-hall launchd/systemd unit file — ingest, supervisor, reaper —
and flags one whose WorkingDirectory is under a temp root or gone, or whose script is
gone. Nothing is unloaded or moved; the report prints the exact bootout + quarantine
(rename, never delete) commands for a human to run.
After each fix, doctor re-runs the relevant detection to confirm it actually took
before reporting FIXED (a spawned installer's exit code is not trusted — launchctl load
can warn). A FAILED repair keeps the exit code non-zero.
Complementarity with update (SKILL step 7): both doctor and the update skill call
the same idempotent installers under the same DevSwarm gate, so running both is harmless —
a double-refresh is a no-op. update refreshes on version change; doctor repairs on
demand.
Windows is not supported.
The doctor (ah-engine doctor) writes units/settings in repair mode (and the
command-guard blocks heavy commands on the main thread), so delegate it to a Haiku
subagent (model:"haiku" — an execution-shaped spawn with no explicit model also trips
model-routing-guard's strict-mode block) and relay the report:
"$HOME/.anti-hall/ah-engine/bin/ah-engine" doctor # diagnose only (default, read-only)
"$HOME/.anti-hall/ah-engine/bin/ah-engine" doctor --repair # diagnose + apply the safe repairs
"$HOME/.anti-hall/ah-engine/bin/ah-engine" doctor --dry-run # show what --repair would fix
"$HOME/.anti-hall/ah-engine/bin/ah-engine" doctor --check # read-only (CI)
The engine runs the doctor (ah-engine doctor); Node's ah-engine doctor answers only when the engine is absent. The engine
doctor names what it does not check yet (the DevSwarm runtime checks of an active session, --prune-cache,
--reclaim-ingest-lock, --logs): run ~/.anti-hall/ah-engine/bin/ah-engine doctor with that flag for those. The explicit
--repair-ingest-orphans, --repair-test-stores and --repair-resurrected flags preview by default and act with --apply.
Add --quiet for just the one-line verdict. Exit code is non-zero if any critical check
(or repair) fails, so it is scriptable in CI too — use --check there to keep it read-only.
After relaying the report, if anything failed: the most common fix is the engine binary missing
(run the activate skill, which installs it). For older anti-hall statusline entries, run uninstall-statusline
to clean them up.
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