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…
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…
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…
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…
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…
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…
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…
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…
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…
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…
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…
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…
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…
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…
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…
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.…
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…
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.…
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…
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…
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…