ReviewToolkits

104 mods across 4 repositories, 45 stars between them.

ReviewToolkits/cpython-review-toolkit

Plugin Claude Code

CPython C code exploration and analysis agents: refcount auditing, error path analysis, GIL discipline, C complexity, include-graph mapping, PEP 7 style, NULL safety, deprecation, macros, and memory patterns — plus tree-sitter-based crash-class detectors (recursion-guard, destructor exception-clobber…

10 1mo ago A tokens not measured original MIT

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to track deprecated C API usage within CPython's own code. Finds usage of deprecated APIs like PyModuleAddObject, PyUnicodeREADY, PyUNICODE, old buffer protocol, and other APIs that have newer replacements.\n\n \nContext: The user wants to find deprecated API usage.\nuser: "What deprecated C APIs are…

10 1mo ago A 141 tokens original MIT

ReviewToolkits/cpython-review-toolkit

Agent

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 measureccomplexity.py for metrics.\n\n \nContext: The user wants to find the most complex functions in…

10 1mo ago A 145 tokens original MIT

error-path-analyzer

28

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to find error-handling bugs in CPython C source code — an unguarded PyErrClear() that swallows a user exception, a raw allocator whose failure branch forgets PyErrNoMemory(), a fallible API result dereferenced before it is tested. Uses scanerrorpaths.py.\n\n \nContext: The user wants to check error…

10 1mo ago A 249 tokens original MIT

ft-race-scanner

29

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to find free-threading data races in CPython's own C code — iterator-exhaustion double-DECREF, lazy-init caches without a critical section, and atomic/plain access asymmetry. Grounded in the fusil cpython-tsan-findings catalog. Uses scanftraces.py.\n\n \nContext: The user wants to find data races in…

10 1mo ago A 188 tokens original MIT

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to find GIL (Global Interpreter Lock) usage errors in CPython C source code — mismatched BEGIN/ENDALLOWTHREADS, Python API calls without the GIL, blocking I/O with the GIL held, and PyGILState balance issues. Uses scangilusage.py for detection.\n\n \nContext: The user wants to check GIL safety in a…

10 1mo ago A 157 tokens original MIT

ReviewToolkits/cpython-review-toolkit

Agent

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…

10 1mo ago A 361 tokens original MIT

git-history-context

32

ReviewToolkits/cpython-review-toolkit

Agent

Preflight temporal-orientation agent — runs EARLY (right after include-graph-mapper, before the safety-critical agents) to give them a per-file priority signal. Produces a bug-fix-density watchlist over Modules/ Objects/ Python/, recurring fix-keyword clusters, and a shallow-clone warning. Distinct from…

10 1mo ago A 199 tokens original MIT

init-bypass-checker

34

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to find C methods/slots that read self->field and INCREF / call / dereference it with no NULL guard, where the field can legitimately be NULL because construction bypassed tpinit (a new/subclass bypass, or a deletable member/getset). Uses scaninitbypass.py.\n\n \nContext: The user wants to find crashes…

10 1mo ago A 247 tokens original MIT

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to audit critical-section discipline in CPython's own C source — PyBEGINCRITICALSECTION / PyENDCRITICALSECTION pairs that leak the per-object lock on an early return or goto, and two-object locking that should use the deadlock-safe PyBEGINCRITICALSECTION2. Uses scanlockdiscipline.py.\n\n \nContext: The…

10 1mo ago A 194 tokens original MIT

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to review C macro definitions for common pitfalls — missing parentheses, multiple evaluation, statement macros without do-while, naming conventions, header guards, and macro scope issues.\n\n \nContext: The user wants to audit macro safety.\nuser: "Check macros in Include/ for hygiene…

10 1mo ago A 124 tokens original MIT

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to find memory management bugs beyond reference counting — integer overflow in allocation sizes, GC-track invariant violations, mismatched alloc/free families, buffer overflows, use-after-free, and double-free. Script-backed by scanmemorypatterns.py for the three syntactic checks, with a qualitative…

10 1mo ago A 174 tokens original MIT

null-safety-scanner

38

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to find NULL pointer dereference risks in CPython C source code — unchecked allocations that are then dereferenced, dereference-before-check, and PyDECREF of a pointer a callee already NULLed. Uses scannullchecks.py.\n\n \nContext: The user wants to audit NULL safety.\nuser: "Scan Modules/ for NULL…

10 1mo ago A 138 tokens original MIT

oom-reproducer

39

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to turn a static allocation-failure candidate into a REPRODUCED crash, using dense testcapi.setnomemory OOM injection on a locally-built CPython. This is the dynamic-verification step that upgrades a finding from "static match" to "confirmed crash with evidence". Uses runoomsweep.py.\n\n \nContext: The…

10 1mo ago A 182 tokens original MIT

parity-checker

40

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to differentially test CPython's dual-implementation stdlib modules — the C accelerator against its shipped pure-Python twin (pydecimal/decimal, pyio/io, pydatetime/datetime, and the from X import accelerator families). The twin is a free oracle: the same adversarial input through both backends…

10 1mo ago A 355 tokens original MIT

pep7-style-checker

41

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to check adherence to PEP 7 (C style guide for CPython). Checks indentation, line length, brace style, keyword spacing, operator spacing, trailing whitespace, missing braces, and header guards. Uses checkpep7.py.\n\n \nContext: The user wants to check style compliance.\nuser: "Check if Objects/ follows…

10 1mo ago A 142 tokens original MIT

pyerr-clear-auditor

42

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to find PyErrClear() calls in CPython that swallow a live exception — unguarded clears in the destructor family (tpdealloc / tpclear / tpfinalize / tptraverse), clears on a provable success path (the gh-146102 class), and unfiltered clears of whatever a user hash / buffer / index / import hook raised.…

10 1mo ago A 234 tokens original MIT

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to find recursion-prone descents in CPython C source that lack a recursion guard — a deeply-nested or cyclic object overflows the native C stack (SIGSEGV) instead of raising RecursionError. Covers tphash / tprichcompare / tprepr / tpstr and the generic-alias parameter walk. Uses…

10 1mo ago A 198 tokens original MIT

stw-safety-checker

45

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to verify that CPython's own code running during PyEvalStopTheWorld does not invoke Python code, run the exception format machinery, or take a lock a stopped thread holds. Builds an intra-file call graph to catch transitive violations. Reviews Python/ / Objects/ / Modules/ on the free-threaded build.…

10 1mo ago A 317 tokens original MIT

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to triage ThreadSanitizer (TSan) reports produced by a free-threaded (--disable-gil) CPython build — deduplicates races by source-location pair, separates races in CPython's own runtime source (the target) from thread-scaffolding / test-harness / third-party noise, classifies severity, and prescribes…

10 1mo ago A 289 tokens original MIT

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to generate concurrent stress-test scripts that trigger ThreadSanitizer data-race detection in a free-threaded (--disable-gil) CPython build. Given a CPython stdlib type or module under review, it identifies the shared, mutable, thread-interesting operations and produces a self-contained Python script…

10 1mo ago A 264 tokens original MIT

ReviewToolkits/cpython-review-toolkit

Agent

Use this agent to find constructors that free a half-built object on an error path — a non-zeroing allocator (PyObjectNew / PyObjectGCNew) whose object is PyDECREF'd before its members are NULL-initialized, so tpdealloc/tpclear reads uninitialized member pointers (a crash, dominant under OOM). Uses…

10 1mo ago A 196 tokens original MIT