python-audit

python-audit is a command for Claude Code from acaprino/daodan. It costs 111 tokens per session (1,242 once invoked), scanned A, original, MIT.

A command that audits a Python codebase with tools for linting, type checking, unused code, complexity, and tests. It combines the results into a prioritized list and asks before applying fixes.

In plain words
What is it for?
Use it before a release review or when you need a broad Python check covering style, types, complexity, dead code, and tests.
Why use it?
It brings several common code-quality checks together and helps separate urgent issues from less important ones. It also avoids changing files without approval.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions CLAUDE.md.

Part of the python-development plugin — 9 skills, 3 commands, 3 agents shipped together

Good fit Use it before a release review or when you need a broad…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/acaprino/daodan/python-audit
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.

Clone the repo
git clone --depth 1 https://github.com/acaprino/daodan

Made for: Claude Code.

Or install python-development, the plugin that ships this one along with the rest of its 9 skills, 3 commands, 3 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 python-audit

README.md
[![agentmods](https://agentmods.dev/badge/commands/acaprino/daodan/python-audit.svg)](https://agentmods.dev/commands/acaprino/daodan/python-audit)
Your own site
<a href="https://agentmods.dev/commands/acaprino/daodan/python-audit"><img src="https://agentmods.dev/badge/commands/acaprino/daodan/python-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 111 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,242 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00111 $0.01242
Opus 5 $0.00056 $0.00621
Sonnet 5 $0.00022 $0.00248
Haiku 4.5 $0.00011 $0.00124

Measured 2d ago against content hash 1f0baa15305f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

python-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 2d 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.

exports/claude/plugins/python-development/commands/python-audit.md · 133 lines

How it starts

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

Python Audit

End-to-end Python code-quality audit. Runs the five tools that matter most, aggregates findings, and outputs a prioritized fix list.

CRITICAL RULES

  1. Use uv for tool execution -- uvx ruff, uvx mypy, uvx vulture when not in project deps; uv run ... when they are.
  2. Run all phases in parallel where possible -- ruff + vulture + complexity can run concurrently; type-check is separate.
  3. Never auto-fix without approval -- always show the diff / finding count first, ask before applying.
  4. Scale output to scope -- for small modules report everything; for 10K+ file repos summarize and prioritize.

Procedure

Phase 1 -- Lint (ruff)

uvx ruff check "$ARGUMENTS" --output-format=json > .python-audit/ruff.json
uvx ruff format --check "$ARGUMENTS"

Summarize:

  • Total issues by rule category (E/F/W/B/I/N/UP/PL/RUF/PERF)
  • Top 5 rules by frequency
  • Auto-fixable count (ruff check --fix preview)

Phase 2 -- Types (mypy or pyright)

Detect the project's type checker:

  • mypy.ini, [tool.mypy] in pyproject -> mypy
  • pyrightconfig.json, basedpyright in deps -> pyright / basedpyright
  • Neither -> run mypy in strict mode
uvx mypy --config-file pyproject.toml "$ARGUMENTS" > .python-audit/mypy.txt
# or
uvx pyright "$ARGUMENTS" --outputjson > .python-audit/pyright.json

Summarize:

  • Total errors / warnings
  • Hot files (top 5 by error count)
  • Missing-annotation clusters (disallow_untyped_defs violations)

Phase 3 -- Dead Code (vulture + ruff unused)

uvx vulture "$ARGUMENTS" --min-confidence 80 > .python-audit/vulture.txt
uvx ruff check "$ARGUMENTS" --select F401,F811,F841 --output-format=json > .python-audit/ruff-unused.json

Apply framework-aware filtering:

  • Django: ignore admin.py handlers, models.Meta, signals.py
  • FastAPI: ignore @app.* / @router.* decorated functions
  • pytest: ignore conftest.py fixtures, test_* functions
  • click: ignore @click.command() / @click.group() targets

Read the full file on GitHub · 133 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. 2d ago First seen · 133 lines · 111 tokens per session scan A 1f0baa15305f

Subscribe to this mod's changes

python-audit is a command published in the GitHub repository acaprino/daodan (8 stars, last pushed yesterday), licensed MIT. It adds 111 tokens to every session and 1,242 once invoked, about $0.0006 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-09-05.