audit-codebase

A time-limited codebase audit that checks security, performance, reliability, tooling, and testing, then ranks its findings with explanations.

In plain words
What is it for?
Use it to find and prioritize risks, quality problems, and maintenance issues across a repository, optionally using a GitHub or Atlassian ticket for context.
Why use it?
It gives you a structured review of an unfamiliar codebase without requiring you to inspect every area manually. You can limit the audit by topic, depth, and time.

Command

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/lugassawan/swe-workbench/audit-codebase
Clone the repo
git clone --depth 1 https://github.com/lugassawan/swe-workbench
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 933 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.00029 $0.00933
Opus 5 $0.00015 $0.00466
Sonnet 5 $0.00006 $0.00187
Haiku 4.5 $0.00003 $0.00093

Measured yesterday against content hash a84d48888f71, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

audit-codebase 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 yesterday.

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.

commands/audit-codebase.md · 59 lines

How it starts

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

Cold-start audit of this codebase across multiple domains.

Step 1 — Parse arguments

From $ARGUMENTS, extract:

  • --time-box <duration> — default 30m. Any trailing m/h suffix is accepted (e.g. 30m, 2h).
  • --scope <list> — default all. Comma-separated domain names: security, perf, reliability, tooling, testing, or all.
  • --depth <quick|standard|deep> — default standard. Controls fan-out behaviour:
    • quick — single-pass auditor, no fan-out.
    • standard — single-pass auditor, no fan-out.
    • deep — auditor + security-auditor on top-N security findings + debugger on top-N reproducing reliability findings.
  • Ticket ref — scan first: any token matching #\d+, [A-Z]+-\d+, or an atlassian.net/GitHub URL is a ticket ref. Collect first match and remove it from the remaining argument string before further parsing; ignore if none.
  • --top-n <int> — default 10. After ticket-ref tokens are consumed, any bare integer in the remaining $ARGUMENTS not preceded by a flag name is treated as --top-n (integer sniff, same convention as commands/review.md).

Step 2 — Ticket context (when a ref is present)

If a ticket ref was found in Step 1, invoke swe-workbench:ticket-context with that ref and prepend its summary to the audit context passed in Step 3.

Step 3 — Invoke workflow skill

Pass the parsed values as plain prose to swe-workbench:workflow-codebase-audit:

"Time-box: <time-box>. Scope: <scope>. Depth: <depth>. Top-N: <top-n>."

Append the ticket-context summary from Step 2 if present.

The skill handles phase orchestration, schema enforcement, fan-out (deep mode), and ranked rendering. This command does not produce Plan-mode output — the audit is read-only by definition.

Output

The swe-workbench:workflow-codebase-audit skill (via the swe-workbench:auditor subagent) produces a ranked findings document. Expect:

  • Summary header — scope, depth, and time-box used; total finding count by domain.
  • Ranked findings — ordered by severity (Critical → High → Medium → Low), each with: domain tag, File:Line anchor, concise issue title, root-cause reasoning chain, and counter-evidence note (what was checked that did NOT confirm the finding).
  • Domain sectionssecurity, perf, reliability, tooling, testing (only domains in --scope are rendered; all renders all five).
  • Next-action recommendations — top-N actionable fixes the team should address first, keyed to finding IDs.

Read the full file on GitHub · 59 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. yesterday First seen · 59 lines · 29 tokens per session scan A a84d48888f71

Subscribe to this mod's changes

audit-codebase is a command published in the GitHub repository lugassawan/swe-workbench (2 stars, last pushed 2d ago), licensed MIT. It adds 29 tokens to every session and 933 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-31.