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.00070 | $0.05023 |
| Opus 5.5 | $0.00028 | $0.02009 |
| Sonnet 5.5 | $0.00014 | $0.01005 |
| Haiku 4.5 | $0.00007 | $0.00502 |
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 16d 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 — 315 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
A ci run starts only from a resolved failed run and a topic with no existing scratchpad.
flowchart TD
S["CI source"] --> A{"Argument given?"}
A -->|yes| C["Capture source pointer"]
A -->|no| L{"Failed run found?"}
L -->|no| X1["Stop: no failed run"]
L -->|yes| C
C --> G{"Scratchpad exists?"}
G -->|yes| X2["Stop: scratchpad exists"]
G -->|no| N["Create scratchpad"]
N --> F["Fetch logs"]
F --> B["Record baseline"]
- CI source: {{ template "resolved-provider" "source-control" }} Then detect the CI provider and its CLI the way
/watch-cidoes (signals, then the file tree). For GitHub, GitLab, Bitbucket, or Codeberg CI, read that provider's file under theatomic-git-disciplineskill'sreferences/source-control/, whatever the resolved value, and use itsauth-checkandci-target-resolverows; for any other CI, use its own CLI. - Argument given?: a run-id, branch, pr#, or workflow.yml resolves to a run ID. A pr# resolves to a head SHA through
ci-target-resolve, then to that SHA's failed run. - Failed run found?: the CI source lists the most recent failed run on
<current-branch>with its id, workflow name, head SHA, and time. - Stop: no failed run: refuse with
no failed run found on branch <branch>. provide a run-id, pr#, or workflow.yml as argument. - Capture source pointer: into the
BRIEF.mdsource-pointer section: branch, head SHA, base SHA (git merge-base HEAD <base>), workflow name, failed step name (from the CI source's job detail for the run), failure timestamp, provider URL.<base>comes from: {{ template "base-resolution" . }} - Scratchpad exists?: the concurrent-run guard. Topic:
diagnose-ci-<run-id>— the run id distinguishes the bundle, not a date. Exists whenatomic scratchpad path "<topic>"resolves. - Stop: scratchpad exists: refuse with
scratchpad already exists for <topic>; atomic scratchpad archive it or pick a different topic suffix.Per axiom 3, no silent overwrite. - Create scratchpad:
atomic repo init(guarantees the<state-root>/layout and ignore rules;<state-root>is thestate_rootfield ofatomic where --json,.atomicby default), thenSCRATCH=$(atomic scratchpad new "<topic>" --purpose diagnose). - Fetch logs: Dispatch the harness's default general agent, by name, in the foreground, on the economical reasoning tier, read-only, with this brief:
Fetch full logs for CI run <id>, failed step "<step-name>". CI provider: <detected provider>, CLI: <its CLI>, reference: <absolute path of the source-control reference read above, or none>. 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>". - Record baseline: read
CONTEXT.mdand copy thetop_level_errorvalue intoSTATE.mdas the## Iteration 0 — baselineentry: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.
- 16d ago Changed · +75 lines · +70 tokens per session 0774fe9d9d45
- 2mo ago Changed a6b9582dca81
- 3mo 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 (118 stars, last pushed today), licensed MIT. It adds 70 tokens to every session and 5,023 once invoked, about $0.0003 per session on Opus 5.5. 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.
subagent-diagnose compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| subagent-diagnosedamusix/atomic-claude | Command | 118 | today | MIT | A | 70 | Claude Code |
| agentloop-audit-queryalibaba/loongsuite-pilot | Command | 275 | today | Apache-2.0 | A | 20 | Claude Code |
| maintainrandomittin/heimdall | Command | 5 | today | MIT | A | 40 | Claude Code |
| optimizewesammustafa/opencode-primer | Command | 422 | 5mo ago | MIT | A | 10 | Claude Code, OpenCode |
| dev-error-handlingchristopherlouet/claude-base | Command | 6 | 4d ago | MIT | A | 0 | Claude Code |
| ops-hotfixchristopherlouet/claude-base | Command | 6 | 4d ago | MIT | A | 0 | Claude Code |
| perf-profile.templateevan043/claude-cli-advanced-starter-pack | Command | 62 | 4mo ago | MIT | A | 0 | Claude Code |