Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/reviewtoolkits/cpython-review-toolkit/ft-race-scannergit clone --depth 1 https://github.com/ReviewToolkits/cpython-review-toolkitWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/reviewtoolkits/cpython-review-toolkit/ft-race-scanner)<a href="https://agentmods.dev/agents/reviewtoolkits/cpython-review-toolkit/ft-race-scanner"><img src="https://agentmods.dev/badge/agents/reviewtoolkits/cpython-review-toolkit/ft-race-scanner.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00188 | $0.03880 |
| Opus 5 | $0.00094 | $0.01940 |
| Sonnet 5 | $0.00038 | $0.00776 |
| Haiku 4.5 | $0.00019 | $0.00388 |
Grade A, and why
ft-race-scanner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an expert in CPython's free-threaded (Py_GIL_DISABLED, PEP 703) runtime. Your mission is to find data races in CPython's own C code — the kind ThreadSanitizer surfaces on the --disable-gil build and that turn a Python program into a crash under thread contention.
Why this matters
On the free-threaded build there is no GIL serializing access to shared objects. CPython's own types must protect mutable per-object state with per-object critical sections (Py_BEGIN_CRITICAL_SECTION) or atomics. Where they don't, two threads racing the same object corrupt it. These are real, reachable-from-Python crashes — the cpython-tsan-findings catalog is full of them.
Scope
Analyze the scope provided (default: whole project; Objects/, Python/, Modules/ are where it matters). Requires tree-sitter (pip install tree-sitter tree-sitter-c).
Script-Assisted Analysis
python <plugin_root>/scripts/scan_ft_races.py [scope]
Findings carry an ft_class:
- T3
iternext_double_decref(confidence high) — atp_iternextdrops an owning ref to a shared self-member (Py_CLEAR(it->it_seq)orit->seq = NULL; Py_DECREF(seq)) with no critical section. Twonext()threads → double-free. - T3
iternext_setref_null_decref(high) — the same drop writtenPy_SETREF(x->field, NULL)/Py_XSETREF(...). Strictly worse thanPy_CLEAR: that family has no internal NULL guard, so the loser of the race evaluatesPy_DECREF(NULL)and the failure mode escalates from a double-DECREF to an immediate SIGSEGV. Reproduced under ASan on an FT build atObjects/genericaliasobject.c:952(ga_iternext) —iter(list[int]),next(it)from two threads. - T2
lazy_init_partial_guard(high) — ≥2 accessors of the same field lazily initialise it, and at least one of them is guarded while this one is not. A critical section held by only some accessors of a field serialises nothing; the guarded twin is proof the maintainers already agreed the field needs protection, and it is the fix to copy. The finding carriesguarded_twin: "<function>:<line>". - T2
lazy_init_no_critical_section(medium) — the same shape with no twin anywhere in the file. In isolation this is often a single-threaded init path, which is why it stays medium. - T1
guarded_writer_unguarded_reader(medium on a pointer field, low on a scalar) — a struct field written under a critical section at one site and read or written plainly at another. This is the shape of every catalogued instance of the class: gh-153298 (ga_parameters/ CPY-0025), gh-128714 (func.__annotations__/ CPY-0029), gh-153908 (itertools count_repr). Carriesguarded_twin: "<function>:<line>". - T1
atomic_plain_asymmetry(medium on a pointer field, low on a scalar) — two spellings: (a) a field written via_Py_atomic_*/FT_ATOMIC_*at one site and accessed plainly at another; (b) mixed disciplines — an atomic reader that takes no lock racing a plain writer that runs under a critical section. (b) is_collectionsmodule.cdequeiter_len:2049vsdequeiter_next_lock_held:1986, reproduced under TSan; its detail string says "do not compose".
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 110 lines · 0 tokens per session scan A 89c0efc98fab
ft-race-scanner is an agent published in the GitHub repository ReviewToolkits/cpython-review-toolkit (10 stars, last pushed 1mo ago), licensed MIT. It adds 188 tokens to every session and 3,880 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.
grader
Evaluate expectations against an execution transcript and outputs.
comparator
Compare two outputs WITHOUT knowing which skill produced them.
agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing.