audit

A read-only code quality audit that looks for missing tests, unused code, repeated code, testing difficulties, and overly complex code, then files findings as GitHub issues.

In plain words
What is it for?
It helps identify the project language, inspect tests and code with parallel auditors, and report quality-improvement findings in GitHub.
Why use it?
It creates actionable issue records without changing the source code and avoids duplicating already open CQIP issues.

Command for Claude Code

Install

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.

agentmods
npx agentmods add commands/fotoetienne/gru/audit
Clone the repo
git clone --depth 1 https://github.com/fotoetienne/gru

Made for: Claude Code.

Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,620 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00016 $0.01620
Opus 5 $0.00008 $0.00810
Sonnet 5 $0.00003 $0.00324
Haiku 4.5 $0.00002 $0.00162

Measured 3d ago against content hash 79110107f24f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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 3d 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.

.claude/commands/audit.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Run a Code Quality Improvement Plan (CQIP) — a structured codebase audit that identifies test gaps, dead code, duplication, testability issues, and code complexity, then files actionable GitHub issues for all findings.

No source code is modified during this process.

Instructions:

Phase 0: Detect Language & Check for Existing CQIP Issues

  1. Detect the project language by checking for Cargo.toml (Rust), package.json (JS/TS), pyproject.toml/setup.py (Python), build.gradle (Java/Kotlin), etc. Adapt the audit instructions in Phase 1 to use language-appropriate constructs (e.g., #[test] for Rust, describe/it for JS, def test_ for Python).

  2. Check for existing open CQIP issues:

    gh issue list --label cqip --state open --json number,title
    

    If open CQIP issues exist, note them. In Phase 4, skip filing issues that duplicate existing open ones.

Phase 1: Audit (parallel agents)

Spawn two auditor agents in parallel using the Agent tool. Each agent should write its findings to a temp file, then send a summary message back.

Agent 1: Test Auditor

Read every test module and test function across the codebase. For each:

  • Classify each test as high/medium/low value
  • Identify tests to delete: trivial tests, tests that test mocks not behavior, tests with no assertions
  • Identify tests testing the wrong thing: tests that re-implement production logic locally, tests that inline production format strings
  • Identify dead code kept alive by tests: production code with zero non-test callers
  • Identify critical missing coverage: untested code paths most likely to break in production (error handling, state transitions, async loops, timeout machinery)
  • Identify tests to improve: tests with no assertions, tests using real CLI tools instead of mocks

Report findings with specific file paths and line numbers, grouped by module.

Agent 2: Architecture Auditor

Read all source files and audit for:

  • Testability: Where interfaces/traits should be added for dependency injection, functions mixing business logic with I/O, global state blocking parallel tests
  • Long functions: Functions >80 lines with multiple responsibilities — list file:line, length, suggested splits
  • Duplication: Repeated patterns across modules that should be extracted into helpers
  • Dead code: Unused items, unused public API surface, commented-out code
  • API surface: Overly broad visibility (e.g., pub items that should be pub(crate) in a binary crate)

Read the full file on GitHub · 139 lines

Changes

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.

  1. 3d ago First seen · 139 lines · 16 tokens per session scan A 79110107f24f

Subscribe to this mod's changes

audit is a command published in the GitHub repository fotoetienne/gru (11 stars, last pushed 26d ago), licensed Apache-2.0. It adds 16 tokens to every session and 1,620 once invoked, about $0.0001 per session on Opus 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.