api-deprecation-trackerUse 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-analyzerUse 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-analyzerUse 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-scannerUse 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-checkerUse 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-analyzerUse 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-contextPreflight 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-mapperUse 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-checkerUse 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-checkerUse 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-reviewerUse 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-analyzerUse 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-scannerUse 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-reproducerUse 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-checkerUse 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-checkerUse 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-auditorUse 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-auditorUse 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-auditorUse 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-checkerUse 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-analyzerUse 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-generatorUse 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-auditorUse 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).