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.
npx agentmods add commands/damusix/atomic-claude/subagent-diagnosegit 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.svg" alt="Measured on agentmods" 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 | $0.00000 | $0.04369 |
| Opus 5 | $0.00000 | $0.02184 |
| Sonnet 5 | $0.00000 | $0.00874 |
| Haiku 4.5 | $0.00000 | $0.00437 |
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 5d 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.
- 5d 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 (84 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,369 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
catchup
This command was migrated to a skill in Claude Code 2.1.3. See: examples/skills/catchup/SKILL.md.
security
This command was migrated to a skill in Claude Code 2.1.3. See: examples/skills/security/SKILL.md.
crear-skill
Crear, probar y mejorar skills de forma iterativa. Usa cuando el usuario dice "crear skill", "crear habilidad", "build skill", "create a skill", "skill development", "desarrollar skill", "nueva habilidad". Usa el workflow: draft → test → review → improve → repeat con evaluación cuantitativa y qualitative review.
doctor
Diagnosticar y reparar problemas del framework Don Cheli, git y entorno. Usa cuando el usuario dice "doctor", "problemas del framework", "don cheli no funciona", "repair Don Cheli", "debug setup", "setup broken", "framework broken", "reparar entorno". Detecta y repara issues de configuración, git y dependencias…
dispatcher
Pick the next-best repo to work on across the portfolio — rank free repos, recommend one, claim its lease atomically, and route to the entry command.
cost-tracker
Track session costs, understand token spend, and get optimization tips.