By devdanzin
CPython C code exploration and analysis agents: refcount auditing, error path analysis, GIL discipline checking, C complexity measurement, include graph mapping, PEP 7 style checking, NULL safety scanning, API deprecation tracking, macro hygiene review, and memory pattern analysis
Comprehensive CPython C code exploration and analysis using specialized agents
Quick health dashboard — all agents in summary mode
Find cleanup targets — complexity hotspots, refcount issues, and error handling bugs
Quick include graph mapping — understand CPython C file structure and dependencies
Use this agent to track deprecated C API usage within CPython's own code. Finds usage of deprecated APIs like PyModule_AddObject, PyUnicode_READY, Py_UNICODE, old buffer protocol, and other APIs that have newer replacements. <example> Context: The user wants to find deprecated API usage. user: "What deprecated C APIs are still used in the codebase?" assistant: "I'll use the api-deprecation-tracker to scan for deprecated API usage." <commentary> CPython deprecates its own APIs over time. This agent finds internal usage of deprecated APIs. </commentary> </example>
Use this agent to find overly complex C functions in CPython source and suggest simplifications. Measures line count, nesting depth, cyclomatic complexity, parameter count, goto count, and switch-case count. Uses measure_c_complexity.py for metrics. <example> Context: The user wants to find the most complex functions in CPython. user: "What are the most complex functions in Python/?" assistant: "I'll use the c-complexity-analyzer to find complexity hotspots in Python/." <commentary> Complexity analysis identifies functions that are hardest to maintain and most likely to harbor bugs. </commentary> </example>
Use this agent to find error handling bugs in CPython C source code — missing NULL checks, return NULL without setting an exception, error path cleanup issues, and inconsistent error conventions. Uses scan_error_paths.py for candidate detection. <example> Context: The user wants to check error handling in a CPython module. user: "Check Modules/_io for error handling bugs" assistant: "I'll use the error-path-analyzer to scan for error handling issues in Modules/_io." <commentary> Error handling bugs cause SystemError exceptions and crashes. This agent finds them systematically. </commentary> </example> <example> Context: The user is reviewing a specific C file. user: "Does dictobject.c handle errors correctly?" assistant: "I'll use the error-path-analyzer to check dictobject.c for error handling issues." <commentary> Single-file error path analysis is useful for reviewing changes. </commentary> </example>
Use this agent to find GIL (Global Interpreter Lock) usage errors in CPython C source code — mismatched BEGIN/END_ALLOW_THREADS, Python API calls without the GIL, blocking I/O with the GIL held, and PyGILState balance issues. Uses scan_gil_usage.py for detection. <example> Context: The user wants to check GIL safety in a CPython module. user: "Check Modules/_ssl for GIL discipline" assistant: "I'll use the gil-discipline-checker to scan for GIL usage issues in Modules/_ssl." <commentary> I/O-heavy modules like _ssl commonly need careful GIL management. </commentary> </example>
Use this agent for temporal analysis of the CPython C codebase — finding similar bugs via git history, prioritizing review by churn patterns, and detecting incomplete migrations (Argument Clinic, API modernization). Its most valuable capability is similar bug detection — when a bug is fixed, it searches the entire codebase for unfixed instances of the same pattern. <example> Context: A user just fixed a NULL check bug and wants to know if similar bugs exist. user: "We just fixed a missing NULL check in _elementtree.c — did we miss any similar bugs elsewhere?" assistant: "I'll use the git-history-analyzer to find structurally similar code that might have the same vulnerability." <commentary> Similar bug detection (fix propagation) searches the codebase for analogous patterns. </commentary> </example> <example> Context: The user wants to understand recent change patterns before diving in. user: "Before I start working on this module, what's been happening recently?" assistant: "I'll use the git-history-analyzer to analyze recent commits, churn patterns, and change velocity." <commentary> The agent provides a quick temporal overview of the project's recent activity. </commentary> </example> <example> Context: The user wants to check if an API migration is complete. user: "Has the PyModule_AddObject to PyModule_AddObjectRef migration been completed?" assistant: "I'll use the git-history-analyzer to find migration commits and check for remaining unconverted call sites." <commentary> CPython-specific: tracking API modernization progress across the codebase. </commentary> </example>
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
A Claude Code plugin for exploring, analyzing, and reviewing CPython's C source code. It answers the question: where are the bugs, style violations, and maintenance risks in this C codebase?
Built for CPython's specific concerns — reference counting, GIL discipline, NULL safety, PEP 7 style — not general-purpose C analysis.
# Add the marketplace (one-time setup)
claude plugin marketplace add devdanzin/cpython-review-toolkit
# Install the plugin
claude plugin install cpython-review-toolkit@cpython-review-toolkit
claude plugin install cpython-review-toolkit --source github:devdanzin/cpython-review-toolkit --path plugins/cpython-review-toolkit
git clone https://github.com/devdanzin/cpython-review-toolkit.git
claude --plugin-dir cpython-review-toolkit/plugins/cpython-review-toolkit
Navigate to a CPython source checkout, then:
/cpython-review-toolkit:map # Understand include structure
/cpython-review-toolkit:health # Quick health dashboard
/cpython-review-toolkit:hotspots # Refcount leaks + error bugs + complexity
/cpython-review-toolkit:explore # Full exploration (all 10 agents)
Start with map to understand the include graph, then hotspots to find the highest-impact bugs.
explore, map, hotspots, health) for different analysis workflows.The scripts use regex-based scanning to find candidate issues in C source files. This is intentionally imprecise — scripts identify candidates with an expected 30-50% false positive rate, and the agents read the actual code to confirm or dismiss each finding. This approach works well for CPython because PEP 7 makes the code style very regular and predictable.
For detailed usage, agent descriptions, and recommended workflows, see the plugin README.
MIT — see LICENSE for details.
npx claudepluginhub devdanzin/cpython-review-toolkitCPython C/C++ extension analysis agents: refcount auditing (with borrowed-ref-across-callback detection), error path analysis, NULL safety scanning, GIL discipline checking, module state validation, type slot correctness, stable ABI compliance, version compatibility scanning, PyErr_Clear auditing, resource lifecycle tracking, C/Python parity checking, complexity measurement, and git history analysis. Tree-sitter-powered C/C++ parsing with optional clang-tidy/cppcheck integration.
Codebase exploration and analysis agents for existing code: architecture mapping, git history analysis, fix propagation detection, churn-based risk assessment, consistency auditing, complexity analysis, test coverage, error handling, documentation, project documentation accuracy, type design, dead code detection, tech debt inventory, pattern consistency, and API surface review
Free-threading migration toolkit for CPython C extensions. Finds thread-safety bugs (data races, unprotected shared state, unsafe API usage, lock discipline issues), plans migrations to free-threaded Python (PEP 703), triages ThreadSanitizer reports, generates concurrent stress tests for TSan, and produces readiness assessments. 9 agents, 6 scripts, 3 commands. Tree-sitter-powered C/C++ parsing.
CPython C/C++ extension analysis agents: refcount auditing (with borrowed-ref-across-callback detection), error path analysis, NULL safety scanning, GIL discipline checking, module state validation, type slot correctness, stable ABI compliance, version compatibility scanning, PyErr_Clear auditing, resource lifecycle tracking, C/Python parity checking, complexity measurement, and git history analysis. Tree-sitter-powered C/C++ parsing with optional clang-tidy/cppcheck integration.
Codebase structural index — scan Python projects once, query the import graph for blast-radius and coupling before touching code — Python projects only
Python code quality analysis MCP server
Live codebase visualization and structural quality gate — 14 health dimensions graded A-F, dependency analysis, and architecture governance via MCP
Analyze local repos for code health, complexity, test coverage gaps - multi-dimensional health analysis combining complexity + churn + coverage
Automated code review with severity levels and actionable feedback