codebase-audit

codebase-audit is a command for coding agents from btspoony/mstar-harness. It costs 47 tokens per session (755 once invoked), scanned A, original, MIT.

A read-only codebase review that examines a software project and creates prioritized, standalone improvement plans. A codebase is the project's source files and related structure.

In plain words
What is it for?
Auditing a small or large repository, finding improvement areas, prioritizing them, and preparing plans for later implementation.
Why use it?
It helps identify worthwhile work and organize it into a backlog without changing source files or creating commits.

Command

Part of the morning-star-harness plugin — 25 skills, 5 commands, 14 agents shipped together

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/btspoony/mstar-harness/codebase-audit
Clone the repo
git clone --depth 1 https://github.com/btspoony/mstar-harness

Or install morning-star-harness, the plugin that ships this one along with the rest of its 25 skills, 5 commands, 14 agents.

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/commands/btspoony/mstar-harness/codebase-audit.svg)](https://agentmods.dev/commands/btspoony/mstar-harness/codebase-audit)
Your own site
<a href="https://agentmods.dev/commands/btspoony/mstar-harness/codebase-audit"><img src="https://agentmods.dev/badge/commands/btspoony/mstar-harness/codebase-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 755 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.00047 $0.00755
Opus 5 $0.00023 $0.00378
Sonnet 5 $0.00009 $0.00151
Haiku 4.5 $0.00005 $0.00076

Measured 4d ago against content hash 8e8a5c9735f1, 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 4d 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.

commands/codebase-audit.md · 41 lines

How it starts

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

Audit Codebase

Run a read-only codebase audit that discovers what is worth doing and writes self-contained plans for the normal Prepare → Execute flow.

Read-only. No source edits, no state machine, no commits. Output: prioritized plans in {PLAN_DIR}/audit-<date>/.

Boot

  1. mstar-harness-core
  2. mstar-audit → SKILL.md(common core:hard rules、recon、vet、variant dispatch、## Plan output (all variants))+ references/codebase-audit.md(full-audit 变体:Phase 2 类别 + effort、scope variants、Phase 4 变体细则、audit index 模板)
  3. mstar-rolesreferences/code-reviewer.md(执行角色:audit 执行体)
  4. mstar-conventions (path symbols — {PLAN_DIR}, {HARNESS_DIR})
  5. mstar-host → active host reference (invoke capability for parallel subagents)

Routing(谁执行 audit)

Context Who runs the audit
Small repo (single scan pass feasible) PM dispatches @code-reviewer — single scan pass, then vet and write plans
Large repo (parallel categories needed) @code-reviewer fans out read-only scout / explore subagents per category via Assignment Delegation: allowed (scout/explore only, read-only), then vets and writes plans
Specialist depth needed PM orchestrates an @architect consult for architecture/tech-debt depth (separate dispatch, or folded into the audit delegation brief)

This command is the PM entry point; the audit execution body is code-reviewer(PM dispatch).

The audit is advisory — it does not enter the per-plan state machine (Todo → InProgress → InReview → Done). Its output is plan candidates.

Execute

Execute mstar-audit end to end(SKILL.md common core:Recon → Vet & prioritize;full-audit detail:references/codebase-audit.md —— Phase 2 九类别 fan-out、effort quick / standard / deep、scope variants bare / quick / deep / category focus(security / perf / tests, ...)/ branch / next / roadmap / simplify、Phase 4 变体细则、audit index 输出模板;plan writing → SKILL.md ## Plan output (all variants))。Plans → {PLAN_DIR}/audit-<YYYY-MM-DD>/NNN-<slug>.md + README.md index,per mstar-artifacts/references/plan-quality-bar.md

Read the full file on GitHub · 41 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. 4d ago First seen · 41 lines · 47 tokens per session scan A 8e8a5c9735f1

Subscribe to this mod's changes

codebase-audit is a command published in the GitHub repository btspoony/mstar-harness (57 stars, last pushed today), licensed MIT. It adds 47 tokens to every session and 755 once invoked, about $0.0002 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.