Borrowing it
Nothing to install: this file belongs to flashus/detrix. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/flashus/detrix/main/.claude/commands/audit.mdgit clone --depth 1 https://github.com/flashus/detrixWrote 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/flashus/detrix/audit)<a href="https://agentmods.dev/commands/flashus/detrix/audit"><img src="https://agentmods.dev/badge/commands/flashus/detrix/audit/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/flashus/detrix/audit"><img src="https://agentmods.dev/badge/commands/flashus/detrix/audit.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.00012 | $0.01890 |
| Opus 5.5 | $0.00005 | $0.00756 |
| Sonnet 5.5 | $0.00002 | $0.00378 |
| Haiku 4.5 | $0.00001 | $0.00189 |
Grade A, and why
audit 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 2mo 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 — 215 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a PROJECT MANAGER coordinating a comprehensive code audit. You do NOT read source code yourself. You dispatch subagents and compile their reports.
Scope
The argument provided is: "$ARGUMENTS"
If the argument is empty or blank, you MUST use AskUserQuestion to ask the user BEFORE doing anything else:
Question: "What scope should the audit cover?"
Options:
- "Current branch" — "Audit changes on current branch vs main"
- "Uncommitted changes" — "Audit only uncommitted/staged changes"
- "Full project" — "Audit all 13 crates + clients (takes a while)"
- "Single crate" — "I'll specify which crate to audit"
If the user picks "Single crate", follow up: "Which crate? (e.g. detrix-core, detrix-api)" Then use their answer as the scope.
If the argument IS provided, map it:
branch— audit changes on current branch vs mainuncommitted— audit uncommitted changes onlyproject— audit entire project- A crate name (e.g.
detrix-core) — audit just that crate
CRITICAL: Context Window Management
You MUST NOT read source code files yourself. Your job is to:
- Set up the audit directory
- Run automated tooling (clippy, etc.)
- Dispatch one subagent per crate (they each get a fresh context window)
- Read only the subagent OUTPUT FILES to compile the final report
This architecture lets us audit 13 crates without exhausting the context.
Phase 1: Setup & Automated Checks
mkdir -p .agents/audit
Check which crates were already audited (for resumability):
ls .agents/audit/*.md 2>/dev/null
If audit files already exist, ask the user: "Found existing audit files for [crates]. Skip already-audited crates, or start fresh?"
Run automated checks and save output:
cargo clippy --all -- -D warnings 2>&1 | head -200 > .agents/audit/_clippy.txt
Phase 2: Determine Crates to Audit
For scope branch: identify which crates have changes:
git diff main...HEAD --name-only | grep "^crates/" | cut -d/ -f2 | sort -u
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.
- 2mo ago First seen · 215 lines · 12 tokens per session scan A 4efd279fe0b8
audit is a command published in the GitHub repository flashus/detrix (28 stars, last pushed 2mo ago), licensed MIT. It adds 12 tokens to every session and 1,890 once invoked, about $0.0000 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.
Other commands, from other repositories
code
General code quality review — project guideline compliance, bug detection, code quality analysis.
speckit.review.errors
Error handling review — silent failure detection, catch block analysis, error logging.
errors
Error handling review — silent failure detection, catch block analysis, error logging.
review
A guided command for reviewing code changes by examining the current Git diff, the record of edits between versions. It checks quality, bugs, security, performance, and maintainability.
differential-audit
Audit EARS↔code coherence via a bidirectional differential. With no arguments, opens a scoping conversation that interprets what the user wants audited, maps it to arrows, and captures an explicit EARS selection. With one or more EARS IDs, audits those specs directly using configured defaults. Requires docs/arrows/…
review
Review the current diff against project memory.