claude

cpython-review-toolkit

Specialized agents and commands for exploring, analyzing, and reviewing CPython's C source code. Regex scanners for include-graph mapping, complexity, refcounts, error paths, GIL, and NULL safety, plus tree-sitter-based crash-class detectors (recursion-guard, destructor exception-clobber, uninitialized-dealloc), an informed-explore loop, and a known-issues regression command.

10 on GitHubby Danzinv0.8.0MITupdated 3 months agocode-quality
/

Plugin cpython-review-toolkit from marketplace cpython-review-toolkit in ReviewToolkits/cpython-review-toolkit. Commands read from the repo's manifest — 1 month ago.

What it installs

Slash commands (7)

  • /cpython-review-toolkit:explore

    Comprehensive CPython C code exploration and analysis using specialized agents

  • /cpython-review-toolkit:health

    Quick health dashboard — all agents in summary mode

  • /cpython-review-toolkit:hotspots

    Find cleanup targets — complexity hotspots, refcount issues, and error handling bugs

  • /cpython-review-toolkit:informed-explore

    Like `explore`, but INFORMED: every agent first reads a briefing of recurring CPython C bug SHAPES (sibling-hunt templates with their guarded twins), the cross-cutting triage rules, and the false-positive taxonomy — so it confirms-without-relitigating, suppresses known FPs, and hunts un-found siblin

  • /cpython-review-toolkit:known-issues

    Cross-reference the seed catalog of previously-found CPython crashes against a fresh scan, so a fix (or a regression-after-revert) is detected. Static, drift-tolerant regression — no repros run.

  • /cpython-review-toolkit:map

    Quick include graph mapping — understand CPython C file structure and dependencies

  • /cpython-review-toolkit:reproduce

    Turn a static allocation-failure finding into a reproduced crash via dense OOM injection

Subagents (23)

  • api-deprecation-tracker

    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.\n\n<example>\nContext: The user wants to find deprecated API usage.\nuser:

  • c-complexity-analyzer

    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.\n\n<example>\nContext: The user wants to find the

  • error-path-analyzer

    Use this agent to find error-handling bugs in CPython C source code — an unguarded PyErr_Clear() that swallows a user exception, a raw allocator whose failure branch forgets PyErr_NoMemory(), a fallible API result dereferenced before it is tested. Uses scan_error_paths.py.\n\n<example>\nContext: The

  • ft-race-scanner

    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 scan_ft_races.py.\n\n<example>\nContext: The user wa

  • gil-discipline-checker

    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.\n\n<example>\nContext: The user want

  • git-history-analyzer

    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 sear

  • git-history-context

    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

  • include-graph-mapper

    Use this agent to map the #include dependency graph across CPython's C files. Equivalent to architecture-mapper for C codebases. Produces the resolved include graph, include and symbol fan-in, circular includes, and API tier classification. Uses analyze_includes.py.\n\n<example>\nContext: The user w

  • init-bypass-checker

    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 tp_init (a __new__/subclass bypass, or a deletable member/getset). Uses scan_init_bypass.py.\n\n<example>\nContex

  • lock-discipline-checker

    Use this agent to audit critical-section discipline in CPython's own C source — Py_BEGIN_CRITICAL_SECTION / Py_END_CRITICAL_SECTION pairs that leak the per-object lock on an early return or goto, and two-object locking that should use the deadlock-safe Py_BEGIN_CRITICAL_SECTION2. Uses scan_lock_disc

  • macro-hygiene-reviewer

    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<example>\nContext: The user wants to audit macro safety.\nuser: "Check macros in Include/ for

  • memory-pattern-analyzer

    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 scan_memory_patterns.py for the three syntactic checks, w

  • null-safety-scanner

    Use this agent to find NULL pointer dereference risks in CPython C source code — unchecked allocations that are then dereferenced, dereference-before-check, and Py_DECREF of a pointer a callee already NULLed. Uses scan_null_checks.py.\n\n<example>\nContext: The user wants to audit NULL safety.\nuser

  • oom-reproducer

    Use this agent to turn a static allocation-failure candidate into a REPRODUCED crash, using dense `_testcapi.set_nomemory` 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 run_oom_swee

  • parity-checker

    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 advers

  • pep7-style-checker

    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 check_pep7.py.\n\n<example>\nContext: The user wants to check style compliance.\nuser:

  • pyerr-clear-auditor

    Use this agent to find PyErr_Clear() calls in CPython that swallow a live exception — unguarded clears in the destructor family (tp_dealloc / tp_clear / tp_finalize / tp_traverse), clears on a provable success path (the gh-146102 class), and unfiltered clears of whatever a user __hash__ / __buffer__

  • recursion-guard-auditor

    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 tp_hash / tp_richcompare / tp_repr / tp_str and the generic-alias parameter walk. Uses s

  • refcount-auditor

    Use this agent to find reference counting errors in CPython C source code — the #1 source of bugs in CPython. Detects leaked references, stolen-reference misuse, borrowed-reference use-after-free, missing Py_XDECREF for nullable pointers, and missing Py_CLEAR usage. Uses scan_refcounts.py for candid

  • stw-safety-checker

    Use this agent to verify that CPython's own code running during _PyEval_StopTheWorld 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 fr

  • tsan-report-analyzer

    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

  • tsan-stress-generator

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

  • uninitialized-dealloc-auditor

    Use this agent to find constructors that free a half-built object on an error path — a non-zeroing allocator (PyObject_New / PyObject_GC_New) whose object is Py_DECREF'd before its members are NULL-initialized, so tp_dealloc/tp_clear reads uninitialized member pointers (a crash, dominant under OOM).

View source on GitHub

Similar plugins

Active coding discipline enforcer based on Karpathy's 4 principles: surface assumptions, simplify, make surgical changes, define verifiable goals. Ships 4 Python tools (complexity_checker, diff_surgeon, assumption_linter, goal_verifier), a review agent, /karpathy-check command, and pre-commit hook. All stdlib-only.

1 skill · 1 command · 1 agent

alirezarezvani/claude-skills 29,725

Comprehensive Rust security code review with specialized bug-finding agents covering the safe/unsafe boundary, memory safety in unsafe blocks, concurrency, panic-induced DoS, recursion-induced stack overflow, FFI, and async runtime hazards

1 skill · 3 agents

trailofbits/skills 8,166

slopmop

claude

Quality gates for AI-assisted codebases. Provides refit onboarding, the swab/scour/buff/sail remediation loop, and barnacle friction reporting as a Claude skill and slash commands.

1 skill · 6 commands

davepoon/buildwithclaude 3,741

sentrux

claude

MCP server for structural health analysis — 14 dimensions graded A-F, dependency cycles, coupling, dead code, test coverage, and quality gates

1 skill · 1 MCP server

sentrux/sentrux 3,342

wps

claude

Write code that passes wemake-python-styleguide

1 skill

wemake-services/wemake-python-styleguide 2,948

Multi-agent orchestration system with 51 specialized agents for development workflows, code quality, deployment, research, games, and more. Includes orchestrators for checkpoint, deploy, quality, fullstack, research, games, corpus, web, and python workflows.

51 agents

jeremylongshore/tons-of-skills-marketplace 2,917

Maintain cpython-review-toolkit?

This page updates itself from your repo. Add the badge to your README, or get it Featured to pin it above the organic results with a followed link to your site.

claude & codex pluginslisted