python-code-audit-sweep

python-code-audit-sweep is a skill for Claude Code, Codex from chen3feng/agent-skills. It costs 33 tokens per session (1,532 once invoked), scanned A, original, Apache-2.0.

A quick audit process for Python repositories that separates real bugs, unused code, and style issues without changing program behavior.

In plain words
What is it for?
Finding Python problems with static checks, then grouping them into bug, dead-code, and style changes.
Why use it?
It keeps potentially risky bug fixes separate from safe cleanup, making review easier and the findings clearer.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Finding Python problems with static checks, then grouping them into bug, dead-code, and style changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chen3feng/agent-skills/python-code-audit-sweep
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.

Any agent
npx skills add chen3feng/agent-skills --skill python-code-audit-sweep
Clone the repo
git clone --depth 1 https://github.com/chen3feng/agent-skills

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 python-code-audit-sweep

README.md
[![agentmods](https://agentmods.dev/badge/skills/chen3feng/agent-skills/python-code-audit-sweep/github.svg)](https://agentmods.dev/skills/chen3feng/agent-skills/python-code-audit-sweep)
Your own site
<a href="https://agentmods.dev/skills/chen3feng/agent-skills/python-code-audit-sweep"><img src="https://agentmods.dev/badge/skills/chen3feng/agent-skills/python-code-audit-sweep/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for python-code-audit-sweep

Your own site · 80×15
<a href="https://agentmods.dev/skills/chen3feng/agent-skills/python-code-audit-sweep"><img src="https://agentmods.dev/badge/skills/chen3feng/agent-skills/python-code-audit-sweep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,532 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.00033 $0.01532
Opus 5.5 $0.00013 $0.00613
Sonnet 5.5 $0.00007 $0.00306
Haiku 4.5 $0.00003 $0.00153

Measured 1mo ago against content hash c43a9e1f29dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-code-audit-sweep 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 1mo 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.

skills/python-code-audit-sweep/SKILL.md · 151 lines

How it starts

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

Python code-audit sweep

When to use

The user says something like "check the code for improvements, no feature changes" or "do a general cleanup pass". You have a Python codebase, no specific bug report, and need to surface high-signal, low-risk findings without accidentally changing behavior.

Problem

A naive "cleanup" PR usually fails review because it mixes three very different kinds of change into one blob:

  • A real latent bug (semantics change when fixed).
  • Dead code / unused locals (safe, mechanical).
  • Spelling, wording, anti-patterns in comments (pure style).

Reviewers want to merge (2) and (3) fast and scrutinize (1) carefully. If you stuff them into one PR, the whole thing blocks on the hardest item, and the diff hides the real bug behind dozens of typo fixes.

Solution

Do the audit in two phases: find, then partition into separate PRs.

1. Find (cheap, parallel grep + pyflakes)

# Static analysis: unused imports/vars, undefined names, simple smells.
pyflakes src/ | tee /tmp/pyflakes.txt

# Common anti-patterns (extend as needed).
grep -rnE 'not [a-zA-Z_][a-zA-Z_0-9.()\[\]]* is None' src/   # should be "is not None"
grep -rnE '== None|!= None' src/                             # should be "is (not) None"
grep -rn  'type(str)\|type(int)\|type(list)\|type(dict)' src/ # type() applied to a builtin type

# Typo shortlist — curated, not exhaustive; avoids false positives.
grep -rniE '\b(seperat|writen|recieve|occured|begining|lenght|tranform|initialis|standardalone|dependancy|mutiple|visibilty|accomodate|seperately)\w*' \
    src/ doc/ tool/

# Filenames with unusual punctuation (real bugs on GitHub's Markdown renderer).
find . -name '*,md' -o -name '*.m d' -o -name '*.mdd'

2. Partition into three PRs

Label every finding as A, B, or C. One PR per label, in this order:

Tag Contents Risk Review burden
A Real bugs: broken error messages, dead-assignment-that-hides-a-branch, wrong file extensions. Behavior may change (even if tiny). Highest — maintainer must read carefully.
B Dead locals, unused imports, tuple-unpacking where half is unused. None. Low.
C Typos in comments/docs, not x is None → x is not None, file renames with no in-repo references. None. Lowest.

Read the full file on GitHub · 151 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. 1mo ago First seen · 151 lines · 33 tokens per session scan A c43a9e1f29dc

Subscribe to this mod's changes

python-code-audit-sweep is a skill published in the GitHub repository chen3feng/agent-skills (5 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 33 tokens to every session and 1,532 once invoked, about $0.0001 per session on Opus 5.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.

Related

Other skills, from other repositories

python-code-quality

Code quality checks, linting, formatting, and type checking commands for the Agent Framework Python codebase. Use this when running checks, fixing lint errors, or troubleshooting CI failures.

microsoft/agent-framework · 40 tokens

plugin-architecture-patterns

Design, implement, or diagnose Xberg plugin traits, typed registries, priority collisions, lifecycle, native extractors, and Alef-generated Python plugin bridges. Load for plugin-system work, not ordinary extractor parsing.

xberg-io/xberg · 43 tokens

test-corpus

The testdocuments submodule is a bucket-fetched fixture corpus that is not committed. This skill covers readtestfixture, missing fixtures, valid A/B controls, and submodule push order. Load before running Rust tests on a fresh clone, setting up an A/B control, adding a fixture-backed test, or diagnosing…

xberg-io/xberg · 68 tokens

idapython

IDA Pro Python scripting for reverse engineering. Use when writing IDAPython scripts, analyzing binaries, working with IDA's API for disassembly, decompilation (Hex-Rays), type systems, cross-references, functions, segments, or any IDA database manipulation. Covers ida modules (50+), idautils iterators, and common…

mrexodia/ida-pro-mcp · 77 tokens

stack-trace-python-probe

Internal helper for meta-stack-trace-investigator. Use when a Python traceback needs Python-specific root-cause checks, pytest reproducer guidance, and defensive patch targets.

opensquilla/opensquilla · 40 tokens

memory-optimization

Optimize Python code for reduced memory usage and improved memory efficiency. Use when asked to reduce memory footprint, fix memory leaks, optimize data structures for memory, handle large datasets efficiently, or diagnose memory issues. Covers object sizing, generator patterns, efficient data structures, and memory…

benchflow-ai/skillsbench · 60 tokens