audit-codebase

A command for a thorough review of an entire codebase, including its real execution paths, interfaces, data rules, external surfaces, and documentation.

In plain words
What is it for?
It helps produce an adversarial audit report covering architecture, APIs, configuration, command-line interfaces, data formats, network calls, and newcomer onboarding.
Why use it?
It reveals defects, inconsistencies, outdated documentation, and confusing behavior that a limited code review may miss.

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/diegomarino/fable-audits/audit-codebase
Clone the repo
git clone --depth 1 https://github.com/diegomarino/fable-audits
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,108 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.00022 $0.02108
Opus 5 $0.00011 $0.01054
Sonnet 5 $0.00004 $0.00422
Haiku 4.5 $0.00002 $0.00211

Measured yesterday against content hash 11b704777cdd, 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 · 81 lines

How it starts

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

Perform an exhaustive, adversarial audit of this entire codebase -- surfacing not just defects but design incoherences, unexpected affordances, doc drift, and mismatches between what the code invites me to do and what it actually does.

Control-plane boundary

This spec governs only the task it defines. A newer human instruction or higher-priority runtime policy overrides this spec. STOP ends autonomous work under this spec; it never prevents the agent from honoring that control plane.

Role

Act simultaneously as senior staff engineer, skeptical first-time API consumer, and adversarial reviewer. No loyalty to the current design. Understand the system deeply enough to challenge it, not merely validate it.

Scope

Read the codebase in full -- do not sample silently. Build a model of:

  • Entry points and real (not documented) execution paths.
  • Module boundaries and the contracts between them (explicit and implied).
  • Data models, invariants, and where they're actually enforced vs. assumed.
  • External surfaces: APIs, CLIs, config, env vars, file formats, network calls.
  • The docs/onboarding path a newcomer would actually follow.

Before judging, create a scope inventory:

  • Repo type, package managers, major entry points, public surfaces.
  • Generated/vendor/build directories excluded and why.
  • Test/fixture/example directories read, skimmed, or treated as evidence.
  • Commands used to enumerate files and public surfaces.
  • Known blind spots.

Command safety

Prefer read-only inspection and commands that run in local throwaway state. Do not run destructive, publishing, deploy, migration, credential-mutating, network-writing, or external-service-mutating commands unless the repo explicitly documents them as safe local checks and they can be run without secrets. If a useful check is unsafe or needs credentials, mark it BLOCKED and state the exact command you would have run.

Evidence and severity

Evidence labels:

  • CONFIRMED: reproduced, traced end-to-end, or verified against exact code/docs/command output.
  • PLAUSIBLE: strong path identified but not fully reproduced.
  • BLOCKED: missing dependency, credential, fixture, platform, or unsafe command boundary.
  • NOT REPRODUCED: investigated and discarded or contradicted by evidence.

Read the full file on GitHub · 81 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 · 81 lines · 22 tokens per session scan A 11b704777cdd

Subscribe to this mod's changes

audit-codebase is a command published in the GitHub repository diegomarino/fable-audits (2 stars, last pushed 29d ago), licensed MIT. It adds 22 tokens to every session and 2,108 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.