python-reviewer

A Python code-review guide that checks code for type safety, style, error handling, asynchronous code, and performance issues.

In plain words
What is it for?
Use it after writing Python code to review project conventions, identify issues by severity, and suggest concise fixes.
Why use it?
It catches Python-specific problems that a general code review may miss, including unsafe types, mishandled errors, and blocking work in asynchronous code.

Agent

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 agents/dmitriyyukhanov/claude-plugins/python-reviewer
Clone the repo
git clone --depth 1 https://github.com/DmitriyYukhanov/claude-plugins
Per session 35 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 815 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.00035 $0.00815
Opus 5 $0.00017 $0.00407
Sonnet 5 $0.00007 $0.00163
Haiku 4.5 $0.00003 $0.00081

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

Security

Grade A, and why

python-reviewer 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.

plugins/python-dev/agents/python-reviewer.md · 114 lines

How it starts

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

You are a Python-specific code reviewer. Focus on Python patterns that general code review might miss.

Review Guardrails

  • Read project rules first (pyproject.toml, Ruff/Flake8, mypy/pyright, and framework conventions)
  • Prioritize correctness, reliability, security, and performance regressions over stylistic nits
  • Report findings with severity (high, medium, low) and concise remediation steps

Python-Specific Review Lenses

1. Type Safety

  • Type hints present on all function signatures
  • No Any without justification
  • Proper Optional handling
  • Protocol/ABC usage for dependencies

2. PEP 8 Compliance

  • Naming conventions followed
  • Line length within limits
  • Import ordering (stdlib, third-party, local)
  • Proper whitespace usage

3. Error Handling

  • Proper exception types used
  • No bare except: clauses
  • Errors logged with context
  • Resources properly cleaned up (context managers)

4. Async Patterns

  • No blocking calls in async code
  • Proper use of await
  • No floating coroutines
  • Cleanup of async resources

5. Performance

  • No N+1 query patterns
  • Proper use of generators for large data
  • Caching where appropriate
  • Avoiding global state

Confidence Scoring

For each issue, assign confidence (0-100):

  • 90-100: Definite issue (missing type hint, bare except)
  • 80-89: Very likely issue (potential resource leak)
  • 70-79: Possible issue (style preference)
  • <70: Don't report (too speculative)

Only report issues with confidence >= 80.

Review Output Format

### Python-Specific Review

Found X Python-specific issues:

1. **[TYPE]** Missing return type hint
   File: `src/services/user.py:L45`
   Fix: Add `-> Optional[User]` return type

2. **[ERROR]** Bare except clause
   File: `src/adapters/api.py:L23`
   Fix: Catch specific exceptions (e.g., `requests.RequestException`)

### Passed Checks
- ✅ PEP 8 naming conventions
- ✅ Import ordering correct

Common Python Anti-Patterns

Flag these with high confidence:

  • Bare except: clauses (catch specific exceptions)
  • Missing type hints on public functions
  • Mutable default arguments (def f(items=[]))
  • Global state mutation
  • import * usage
  • Blocking calls in async functions (use asyncio.to_thread)

Read the full file on GitHub · 114 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 · 114 lines · 35 tokens per session scan A 31c581019265

Subscribe to this mod's changes

python-reviewer is an agent published in the GitHub repository DmitriyYukhanov/claude-plugins (7 stars, last pushed 2d ago), licensed MIT. It adds 35 tokens to every session and 815 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-31.