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-duplication.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-duplication)<a href="https://agentmods.dev/commands/flashus/detrix/audit-duplication"><img src="https://agentmods.dev/badge/commands/flashus/detrix/audit-duplication/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-duplication"><img src="https://agentmods.dev/badge/commands/flashus/detrix/audit-duplication.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.00007 | $0.01405 |
| Opus 5.5 | $0.00003 | $0.00562 |
| Sonnet 5.5 | $0.00001 | $0.00281 |
| Haiku 4.5 | $0.00001 | $0.00140 |
Grade A, and why
audit-duplication 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 — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a senior developer analyzing the Detrix codebase for cross-crate and cross-language code duplication. Your goal is to find code that is duplicated or nearly-duplicated across different crates/clients and recommend consolidation.
Scope
"$ARGUMENTS" — if empty, analyze the entire project. If a scope like branch or uncommitted is given, focus on changed crates only.
Strategy: Fingerprint → Compare → Confirm
You CANNOT read all crates at once (context limit). Instead, use a 3-phase approach:
Phase 1: Automated Pattern Search
Use Grep to search across ALL crates simultaneously for duplication signals. Run these searches in parallel — each one is cheap and covers the whole codebase:
1a. Identical/similar function signatures:
Search for common function name prefixes that appear in multiple crates:
- "fn new(" across crates (constructor patterns)
- "fn from_" / "fn to_" / "fn into_" (conversion functions)
- "fn validate" / "fn parse" / "fn format" (utility patterns)
- "fn get_" / "fn find_" / "fn list_" (data access patterns)
1b. Similar struct/enum definitions:
Search for struct/enum names that appear in multiple crates.
Look for structs with similar field sets (e.g., same fields in different DTOs).
1c. Error type duplication:
Search for error enum variants across crates.
Look for similar error messages/patterns.
1d. Conversion boilerplate:
Search for From/TryFrom/Into implementations.
Look for similar .map() / .map_err() / conversion chains.
1e. Similar imports:
Search for identical multi-line use statements that suggest shared patterns.
1f. Copy-pasted blocks:
Search for distinctive string literals, magic numbers, or unique code patterns
that appear in multiple files across different crates.
Write raw search results to .agents/audit/_duplication_raw.md.
Phase 2: Catalog Extraction (via subagents)
Launch subagents in parallel — one per "cluster" of related crates. Each subagent:
- Reads the crate using get_symbols_overview (NOT full file reads)
- Extracts a structured catalog of public API surface
- Writes to
.agents/audit/_catalog_<cluster>.md
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 · 170 lines · 7 tokens per session scan A d3dd52fed450
audit-duplication is a command published in the GitHub repository flashus/detrix (28 stars, last pushed 2mo ago), licensed MIT. It adds 7 tokens to every session and 1,405 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
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.
review-pr
Comprehensive PR review using specialized agents.
speckit.critique.run
Perform a dual-lens critical review of the specification and plan from both product strategy and engineering risk perspectives before implementation.
code-review
Code review a pull request.