Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/damusix/atomic-claudeWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/damusix/atomic-claude/subagent-diagnose)<a href="https://agentmods.dev/commands/damusix/atomic-claude/subagent-diagnose"><img src="https://agentmods.dev/badge/commands/damusix/atomic-claude/subagent-diagnose/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/damusix/atomic-claude/subagent-diagnose"><img src="https://agentmods.dev/badge/commands/damusix/atomic-claude/subagent-diagnose.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.04349 |
| Opus 5.5 | $0.00000 | $0.01740 |
| Sonnet 5.5 | $0.00000 | $0.00870 |
| Haiku 4.5 | $0.00000 | $0.00435 |
Grade A, and why
subagent-diagnose scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 240 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are the orchestrator. The user has invoked /subagent-diagnose. You will NOT implement the fix yourself. You drive a loop of fresh-context subagents until the failure is resolved, then triage follow-ups. The scratchpad bundle stays — it is retired later, via /git-cleanup or an explicit atomic scratchpad archive, not by this command.
Spec: docs/spec/subagent-diagnose.md — canonical contract. Read it if anything below is ambiguous.
Scratchpad paths come from atomic scratchpad / atomic where --json; if what you find on disk does not match, run atomic migrate --show-log for the change history.
Phase 0 — Context capture (mode-specific)
Parse mode
First positional arg ($ARGUMENTS) must be ci or bug. Anything else → refuse:
Stop. Do not proceed until mode is valid.
ci mode — Phase 0 steps
| Step | Action |
|---|---|
| 0.1 | Resolve argument to a run ID. If no arg given: gh run list --status failure --branch <current-branch> --limit 1 --json databaseId,name,headSha,createdAt. Refuse if no failed run found: no failed run found on branch <branch>. provide a run-id, pr#, or workflow.yml as argument. |
| 0.2 | Capture into BRIEF.md source-pointer section: branch, head SHA, base SHA (git merge-base HEAD origin/main), workflow name, failed step name (from gh run view <id> --json jobs), failure timestamp, provider URL. |
| 0.3 | Topic: diagnose-ci-<run-id> — the run id distinguishes the bundle, not a date. Concurrent-run guard: if atomic scratchpad path "<topic>" resolves, refuse: scratchpad already exists for <topic>; atomic scratchpad archive it or pick a different topic suffix. Stop. Per axiom 3, no silent overwrite. Otherwise run atomic repo init if command -v atomic succeeds (guarantees the .claude/ layout and ignore rules; skip silently otherwise), then SCRATCH=$(atomic scratchpad new "<topic>" --purpose diagnose). |
| 0.4 | Dispatch a general-purpose subagent (model: haiku, foreground, read-only) with this brief: Fetch full logs for CI run <id>, failed step "<step-name>". Write to <SCRATCH>/CONTEXT.md. If logs exceed 64KB, truncate with footer: "[truncated, full log at <provider-url>]". Extract the primary failing assertion / panic / error line and append as a trailing YAML key: top_level_error: "<exact error string>". |
| 0.5 | Read CONTEXT.md. Copy top_level_error value into STATE.md as ## Iteration 0 — baseline entry: top_level_error: <value> + normalized_hash: <sha256 of normalized string, first 12 chars>. |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed a6b9582dca81
- 1mo ago First seen · 240 lines · 0 tokens per session scan A e5cb8f289931
subagent-diagnose is a command published in the GitHub repository damusix/atomic-claude (114 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,349 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
dream
Overnight autoresearch + maintainer sweep that surfaces a MORNING REPORT — suggested changes, issues raised with fixes, and kept improvements. Shadow-first; never auto-pushes. Runs on-demand or scheduled for off-hours.
debloat
Retroactive whole-repo bloat removal (spec H-2ii). Scores an existing repo on the deterministic bloat axes, writes BLOAT-REPORT.md, and — only behind a passing test-suite safety oracle — proposes gated refactor waves as a PR. The zero-risk adoption hook.
maintain
Run automated maintenance — seeker finds bugs from pod logs and raises GitHub issues, fixer picks them up and creates PRs. Can run as a one-shot or scheduled via /schedule.
optimize
Suggest concrete performance improvements for the given file or directory.
save
Save current work state for next session. Creates/updates .planning/ files (CHECKPOINT.md, STATE.md, settings.json) so Heimdall resumes with full context. NOT a rewind — saves forward progress. Run before closing a session or at any milestone.
autonomy
Set Heimdall autonomy (1=Guided, 2=Checkpoint, 3=Full Auto) — how much the agent does before asking. Use with a number, +/- to cycle, or no argument to show current.