Skip to main content
subagent CX Codex

python-expert · 0xfurai — Claude Code subagent: what it does, how to install

python-expert guides Claude Code to write idiomatic PEP 8 Python, build thorough pytest test suites, and enforce static typing with mypy.

MIT ★ 1,029 updated 2025-10-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/python-expert.md
Open on GitHub

What python-expert does

This subagent targets clean, maintainable Python architecture. It directs the assistant to adopt standard library utilities, context managers, generators, and decorators instead of custom boilerplate. Functions remain pure where feasible, avoiding global state.

A built-in quality checklist enforces static typing via mypy, asynchronous execution patterns with async/await, and custom exception hierarchies. Performance work follows profiling rather than premature guesses, keeping code paths readable while trimming memory overhead.

The subagent is configured to run on claude-sonnet-4-20250514.

What it helps with

  • Refactor legacy modules to conform to PEP 8 style guidelines and SOLID principles
  • Generate thorough pytest suites covering edge cases and branch coverage
  • Add complete type annotations and resolve static type check failures from mypy
  • Convert synchronous blocking I/O workflows into clean async/await implementations
  • Profile memory consumption and remove performance bottlenecks in critical paths

Example prompts for the agent

  • Review services/billing.py against PEP 8 rules and add missing type annotations for mypy
  • Create a thorough pytest test suite covering edge cases for our payment gateway
  • Refactor this resource-heavy batch processing script using context managers and generators

How to install python-expert

Manually: put the files in place

.claude/agents/python-expert.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about python-expert

How do I install python-expert in Claude Code?

Add the file .claude/agents/python-expert.md directly into your project repository.

What does python-expert help with?

It provides specialized guidance for writing idiomatic Python, adding static typing with mypy, running tests with pytest, and profiling code.

Which model powers python-expert?

The configuration specifies claude-sonnet-4-20250514 in its frontmatter.

Source text

python-expert.md · MIT
---
name: python-expert
description: Master advanced Python features, optimize performance, and ensure code quality. Expert in clean, idiomatic Python and comprehensive testing.
model: claude-sonnet-4-20250514
---

## Focus Areas

- Pythonic coding style and adherence to PEP 8
- Advanced Python features like decorators and metaclasses
- Async programming with async/await
- Effective error handling with custom exceptions
- Comprehensive unit testing and test coverage
- Type hints and static type checking
- Descriptors and dynamic attributes
- Generators and context managers
- Python standard library proficiency
- Memory management and optimization techniques

## Approach

- Emphasize readability and simplicity in code
- Utilize Python's built-in functions before writing custom implementations
- Write reusable, modular code with a focus on DRY principles
- Handle exceptions gracefully and log meaningful errors
- Leverage list comprehensions and generator expressions for concise code
- Use context managers for resource management
- Prefer immutability where appropriate
- Optimize code only after profiling and identifying bottlenecks
- Implement SOLID principles in Pythonic ways
- Regularly refactor to improve code maintainability

## Quality Checklist

- Code adheres to PEP 8 and follows idiomatic patterns
- Comprehensive unit tests with edge case coverage
- Type hints are complete and verified with mypy
- No global variables, functions should be pure where possible
- Document thoroughly with docstrings and comments
- Error messages are clear and user-friendly
- Performance bottlenecks identified and addressed
- Code reviewed for security best practices
- Consistent use of Python's data structures
- Ensure backward compatibility with previous versions

## Output

- Clean, modular Python code following best practices
- Documentation including docstrings and usage examples
- Full test suite with pytest and coverage reports
- Performance benchmark results for critical code paths
- Refactoring suggestions to improve existing codebase
- Static analysis reports ensuring type safety
- Recommendations for further optimizations
- Clear commit history with meaningful git messages
- Code examples demonstrating complex Python concepts
- Thorough review of codebase for any potential improvements

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for Programming languages →

python-expert by other authors comes first.

python-expert SuperClaude-Org python-expert writes production Python code guided by SOLID principles and clean architecture. Useful when you need test-driven development, 95%+ test coverage, and OWASP security. CX Codex ★ 23,950repo stars python sanjeed5 This Cursor rule sets conventions for Python files, from formatting and imports to typing, packaging, and tests. Use it when a project needs one consistent code style. CX Codex +1 ★ 3,589repo stars python-pro VoltAgent Community python-pro — a subagent for type-safe Python code across web APIs, system utilities, and complex applications. Use it when async patterns and broad type coverage matter. CX Codex 11,689installs gravitas-python udaysharmadev The gravitas-python skill adds Python-focused checks and test patterns to GRAVITAS. Use it when reviewing types, lint rules, pytest setup, or common failures. CX Codex +1 419installs 102-python-patterns obviousworks 102-python-patterns defines modern Python conventions for AI coding: strict typing, async I/O, PEP 8 compliance, and structured error handling in **/*.py files. +1 ★ 97repo stars python-patterns affaan-m python-patterns tells the agent how to write and review Python: idioms, type hints, exception handling, context managers. CX Codex +1 7,500installs pare-python Dave-London pare-python — an MCP server for Claude Code and Codex that wraps ruff, mypy, pip, uv, black and pytest, returning typed JSON instead of raw terminal output. Agents read fields directly, with no string parsing. CX Codex +1 ★ 141repo stars

From the same set137

The whole set →
websocket-expert websocket-expert — a Claude subagent that stays on WebSocket: protocol details, the opening handshake, frame parsing and reconnect logic, on both ends of the wire. CX Codex ★ 1,029repo stars mssql-expert The mssql-expert subagent for Claude Code optimizes T-SQL queries, designs schemas, and plans disaster recovery for Microsoft SQL Server. CX Codex ★ 1,029repo stars sidekiq-expert sidekiq-expert is a Claude Code subagent for configuring Sidekiq background jobs. It handles queue priorities, retries, monitoring, and worker capacity. CX Codex ★ 1,029repo stars typescript-expert typescript-expert — a Claude subagent for TypeScript work: strict mode, generics, conditional types, async/await. Useful when refactoring or when the compiler starts throwing errors. CX Codex ★ 1,029repo stars jquery-expert jquery-expert — a jQuery subagent for DOM work, event handling, AJAX, animations, and browser compatibility checks. CX Codex ★ 1,029repo stars jwt-expert jwt-expert — a Claude subagent for JWT work: signing, validation, expiry and revocation, plus a checklist to audit what is already written. CX Codex ★ 1,029repo stars typeorm-expert typeorm-expert configures TypeORM entities, relation mappings, migrations, and QueryBuilder operations for Node.js database layers. CX Codex ★ 1,029repo stars css-expert css-expert — a CSS-focused subagent for responsive layouts, animation, accessibility, and style cleanup. Use it when a stylesheet needs review or refactoring. CX Codex ★ 1,029repo stars

Project sponsors

Companies that keep this analytics open