codebase-audit

codebase-audit is a skill for Claude Code, Codex from majiayu000/spellbook. It costs 176 tokens per session (2,500 once invoked), scanned A, original, MIT.

A read-only method for auditing an entire codebase across contracts, data integrity, errors, security, architecture, technical debt, configuration, and caching. It produces prioritized findings and a repair roadmap.

In plain words
What is it for?
Use it for a full codebase health check, design review, architecture analysis, hidden-bug search, or a quick audit of a project.
Why use it?
It helps reveal problems that cross file or subsystem boundaries, while requiring serious findings to be checked before reporting them. It also compares results with earlier audits when available.

Skill for Claude CodeCodex

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 skills/majiayu000/spellbook/codebase-audit
Any agent
npx skills add majiayu000/spellbook --skill codebase-audit
Clone the repo
git clone --depth 1 https://github.com/majiayu000/spellbook

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for codebase-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/majiayu000/spellbook/codebase-audit.svg)](https://agentmods.dev/skills/majiayu000/spellbook/codebase-audit)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/spellbook/codebase-audit"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/codebase-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 176 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,500 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.00176 $0.02500
Opus 5 $0.00088 $0.01250
Sonnet 5 $0.00035 $0.00500
Haiku 4.5 $0.00018 $0.00250

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

Security

Grade A, and why

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

The scan reads SKILL.md. This mod also ships 9 executable files (evals/fixture/app/__init__.py, evals/fixture/app/config.py, evals/fixture/app/handlers.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/codebase-audit/SKILL.md · 150 lines

How it starts

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

Codebase Audit — Adaptive Deep Analysis

Comprehensive codebase audit that adapts its agent configuration to the project's tech stack, forces structured findings, adversarially verifies Critical/High findings before they enter the report, diffs against the previous audit's ledger (resolved / still-open / new), and outputs a severity-sorted report plus a phased repair roadmap.

Core Principles

  1. READ-ONLY — Audit agents must never create, modify, or delete files in the target. Every agent prompt starts with the read-only preamble in references/agent-prompts.md.
  2. Inherit the session model — Omit the model param on all agents so they inherit the session model (usually the strongest available). Only override upward if the session model is clearly weak for cross-file reasoning. Never hardcode a specific model name in this skill.
  3. Depth over breadth — Fewer agents with broader merged scopes beat many shallow agents. Each agent traces issues across file boundaries.
  4. Adaptive — Agent count and dimensions vary by stack and mode.
  5. Verified findings — Critical/High findings must survive an adversarial verify pass. Medium findings pass through but are labeled unverified in the report.

Operating Contract

  • Direct actions: read-only inspection, local dependency audits, report writing under the target, and ledger updates under <target>/.audit/ after the user invokes this skill.
  • Escalate before: editing audited project source files, dependency manifests, .gitignore, CI config, remote issues, PR state, or anything outside the requested audit/report scope.
  • Evidence-backed pushback: challenge "all clear" or "resolved" only with file evidence, dependency-audit output, verifier results, or ledger spot-checks.
  • Feedback loop: promote repeated misses into prompt updates, ledger matching rules, or fixture eval cases rather than leaving them as session-only notes.

Gotchas

  • Dependency-audit commands must run from {TARGET_DIR}, not the assistant's incidental cwd.
  • Finder agents must not read evals/expected-findings.json or eval README files when auditing the planted-bug fixture.
  • A previous ledger miss is not proof that a finding was resolved; spot-check the file before marking an old finding resolved.

Read the full file on GitHub · 150 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 · 150 lines · 176 tokens per session scan A f7113c99023c

Subscribe to this mod's changes

codebase-audit is a skill published in the GitHub repository majiayu000/spellbook (263 stars, last pushed 3d ago), licensed MIT. It adds 176 tokens to every session and 2,500 once invoked, about $0.0009 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.

Related

Other skills, from other repositories

fleet

Fan out a fleet of independent agent-deck child sessions from inside a session and check their progress non-blockingly. Use when the user wants to "launch several/N sessions", "fan out", "run agents in parallel", "spin up a fleet", "kick off background agents", or "check progress from the main session" without…

asheshgoplani/agent-deck · 94 tokens

skill-monitor

Analyze skill effectiveness across sessions. Computes per-skill metrics (action rate, friction, outcomes), identifies degrading skills, and generates improvement recommendations. Requires session-scan data in metrics.jsonl.

oliver-kriska/claude-elixir-phoenix · 41 tokens

audit

Project health audit and health check — architecture, performance, tests, dependencies, code quality. Use when assessing overall project health, before releases, or after refactors.

oliver-kriska/claude-elixir-phoenix · 35 tokens

ash-framework

Ash Framework — resources, actions, policies, aggregates, calculations, AshPhoenix.Form, LiveView, migrations. Use when generating resources via mix ash.codegen, editing changes, checks, types, validations, or domain code interfaces.

oliver-kriska/claude-elixir-phoenix · 48 tokens

docs-check

CONTRIBUTOR TOOL - Validate plugin against latest Claude Code documentation. Catches breaking changes, deprecations, discovers new features. Run before releases or periodically. NOT part of the distributed plugin.

oliver-kriska/claude-elixir-phoenix · 43 tokens

demo-5-sandbox-feature-pr

Demo skill for the meta "decode improves decode" flow — launch decode in a sandboxed clone of the course repo, plan and build one small feature inside the Workspace, let Hand-back push the Session Branch, then open a draft PR against the course repo.

decodingai-magazine/building-a-coding-agent-from-scratch-course · 60 tokens