python-code-review

python-code-review is a skill for Claude Code from existential-birds/beagle. It costs 41 tokens per session (1,067 once invoked), scanned A, original, Apache-2.0.

A checklist for reviewing Python code for common mistakes and maintainability problems. It covers type hints, asynchronous functions, exceptions, formatting, and everyday Python practices.

In plain words
What is it for?
Use it to review Python modules for PEP 8 style, type safety, async and await usage, exception handling, and mutable defaults.
Why use it?
It helps identify unclear types, blocking work inside asynchronous code, swallowed errors, and inconsistent style before they cause bugs.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the beagle-python plugin — 6 skills shipped together

Good fit Use it to review Python modules for PEP 8 style, type safety, async and await usage, exception handling, and mutable defaults.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/existential-birds/beagle/python-code-review
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 existential-birds/beagle --skill python-code-review
Clone the repo
git clone --depth 1 https://github.com/existential-birds/beagle

Made for: Claude Code.

Or install beagle-python, the plugin that ships this one along with the rest of its 6 skills.

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-review

README.md
[![agentmods](https://agentmods.dev/badge/skills/existential-birds/beagle/python-code-review/github.svg)](https://agentmods.dev/skills/existential-birds/beagle/python-code-review)
Your own site
<a href="https://agentmods.dev/skills/existential-birds/beagle/python-code-review"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/python-code-review/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-review

Your own site · 80×15
<a href="https://agentmods.dev/skills/existential-birds/beagle/python-code-review"><img src="https://agentmods.dev/badge/skills/existential-birds/beagle/python-code-review.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,067 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. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk pass 15 Sept 2026
How audits are shown
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.00041 $0.01067
Opus 5.5 $0.00016 $0.00427
Sonnet 5.5 $0.00008 $0.00213
Haiku 4.5 $0.00004 $0.00107

Measured 1mo ago against content hash 89840cbe9245, 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-review 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.

plugins/beagle-python/skills/python-code-review/SKILL.md · 96 lines

How it starts

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

Python Code Review

Quick Reference

Issue Type Reference
Indentation, line length, whitespace, naming references/pep8-style.md
Missing/wrong type hints, Any usage references/type-safety.md
Blocking calls in async, missing await references/async-patterns.md
Bare except, missing context, logging references/error-handling.md
Mutable defaults, print statements references/common-mistakes.md

Review Checklist

PEP8 Style

  • 4-space indentation (no tabs)
  • Line length ≤79 characters (≤72 for docstrings/comments)
  • Two blank lines around top-level definitions, one within classes
  • Imports grouped: stdlib → third-party → local (blank line between groups)
  • No whitespace inside brackets or before colons/commas
  • Naming: snake_case for functions/variables, CamelCase for classes, UPPER_CASE for constants
  • Inline comments separated by at least two spaces

Type Safety

  • Type hints on all function parameters and return types
  • No Any unless necessary (with comment explaining why)
  • Proper T | None syntax (Python 3.10+)

Async Patterns

  • No blocking calls (time.sleep, requests) in async functions
  • Proper await on all coroutines

Error Handling

  • No bare except: clauses
  • Specific exception types with context
  • raise ... from to preserve stack traces

Common Mistakes

  • No mutable default arguments
  • Using logger not print() for output
  • f-strings preferred over .format() or %

Valid Patterns (Do NOT Flag)

These patterns are intentional and correct - do not report as issues:

  • Type annotation vs type assertion - Annotations declare types but are not runtime assertions; don't confuse with missing validation
  • Using Any when interacting with untyped libraries - Required when external libraries lack type stubs
  • Empty __init__.py files - Valid for package structure, no code required
  • noqa comments - Valid when linter rule doesn't apply to specific case
  • Using cast() after runtime type check - Correct pattern to inform type checker of narrowed type

Read the full file on GitHub · 96 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 96 lines · 41 tokens per session scan A 89840cbe9245

Subscribe to this mod's changes

python-code-review is a skill published in the GitHub repository existential-birds/beagle (82 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 41 tokens to every session and 1,067 once invoked, about $0.0002 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-09-16.

Related

Other skills, from other repositories

mcore-linting-and-formatting

Linting and formatting for Megatron-LM. Covers running autoformat.sh, tools (ruff, black, isort, pylint, mypy), and code style rules.

NVIDIA/skills · 44 tokens

splitting-oversized-modules

Split an oversized Python module (a thousand-plus-line logic.py, models.py, api.py, or its test file) into a package of one module per concern, mechanically and provably without changing behavior. Use on a request to split / break up / decompose a god module or move functions out of one, once a human has agreed to…

PostHog/posthog-foss · 197 tokens

splitting-oversized-modules

Split an oversized Python module (a thousand-plus-line logic.py, models.py, api.py, or its test file) into a package of one module per concern, mechanically and provably without changing behavior. Use on a request to split / break up / decompose a god module or move functions out of one, once a human has agreed to…

PostHog/posthog · 197 tokens

plankton-code-quality

Write-time code quality enforcement using Plankton — auto-formatting, linting, and Claude-powered fixes on every file edit via hooks.

loulanyue/awesome-claude-notes · 34 tokens

best-practices

Language-specific best practices, code quality standards, and framework detection rules. Use when executing refactoring workflows, applying code quality rules, detecting frameworks, or checking language-specific patterns for TypeScript, Python, Go, Swift, or React.

FradSer/dotclaude · 52 tokens

coding.make_function_private

Identify private or public functions in a file and rename with underscore.

causify-ai/helpers · 12 tokens