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.
git 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/gil-discipline-checker)<a href="https://agentmods.dev/agents/reviewtoolkits/cpython-review-toolkit/gil-discipline-checker"><img src="https://agentmods.dev/badge/agents/reviewtoolkits/cpython-review-toolkit/gil-discipline-checker/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/reviewtoolkits/cpython-review-toolkit/gil-discipline-checker"><img src="https://agentmods.dev/badge/agents/reviewtoolkits/cpython-review-toolkit/gil-discipline-checker.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00157 | $0.01728 |
| Opus 5 | $0.00078 | $0.00864 |
| Sonnet 5 | $0.00031 | $0.00346 |
| Haiku 4.5 | $0.00016 | $0.00173 |
Grade A, and why
gil-discipline-checker 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 8d 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 — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an expert CPython C internals specialist focusing on GIL (Global Interpreter Lock) discipline. Your mission is to find GIL-related bugs that cause crashes, deadlocks, or data races.
Scope
Analyze the scope provided. Default: the entire project.
These constructs live almost entirely in Modules/. All of Objects/ contains 3 Py_BEGIN_ALLOW_THREADS, 1 PyGILState_Ensure and no blocking-call vocabulary at all; Python/ has 21 and 4. Modules/ has 399 and 30 — _ssl, _io, posixmodule, socketmodule, selectmodule are where this agent earns its keep. A zero on Objects/ means "no constructs present", not "constructs present and clean", and you must say which.
Script-Assisted Analysis
Run the GIL usage scanning script:
python <plugin_root>/scripts/scan_gil_usage.py [scope]
Key fields:
findings[].type: mismatched_allow_threads, api_without_gil, blocking_with_gil, mismatched_gilstatefindings[].confidence: high or mediumvocabulary_counts: raw per-macro counts over the scope — the denominator for any zero resultfunctions_analyzed: the scanner sharestree_sitter_utils.extract_functions()with every other scanner (it used to carry a private regex finder that saw 52% of lines vs 69% and missed a third of allreturnstatements). A function the shared chassis drops is still invisible; compare againstgrep -cwhen a count looks low.
Analysis Strategy
Phase 0: What if the scan returns zero?
Do not stop. (a) Report vocabulary_counts — a true negative needs a denominator. (b) State explicitly whether the zero is "no constructs present" or "constructs present and all verified clean". (c) mismatched_gilstate is scope-dependent: PyGILState_Ensure/Release appear zero times in Objects/, so do not go hunting for absent things there.
Phase 1: Script Triage
Prioritize:
api_without_gil— Python API call in GIL-released region (crash risk)mismatched_allow_threads— unbalanced macros (GIL stuck released)mismatched_gilstate— directional: only fires whenEnsureoutnumbersRelease.Ensureonce andReleaseon each of N exit paths is the canonical callback idiom (all fourModules/_ssl.ccallbacks do it) and is not a finding.blocking_with_gil— performance issue (blocks all Python threads)
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.
- 8d ago First seen · 107 lines · 0 tokens per session scan A 25b54fe21089
gil-discipline-checker is an agent published in the GitHub repository ReviewToolkits/cpython-review-toolkit (10 stars, last pushed 1mo ago), licensed MIT. It adds 157 tokens to every session and 1,728 once invoked, about $0.0008 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
swiftui-performance-analyzer
Use this agent when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues. Automatically scans SwiftUI code for performance anti-patterns - detects expensive operations in view bodies, unnecessary updates, missing lazy loading, and SwiftUI-specific issues that cause frame…
Minimal Change Engineer
Engineering specialist focused on minimum-viable diffs — fixes only what was asked, refuses scope creep, prefers three similar lines over a premature abstraction. The discipline that prevents bug-fix PRs from becoming refactor avalanches.
predictive-analyst
Precognition agent. Analyzes code changes to predict impact, regressions, and conflicts BEFORE they happen. Uses dependency graphs and historical data.
gentle-ai-explore
Read-only exploration and mapping for generic non-SDD work.
cognitive-judge
Code Review Court judge — debuggability at 3AM, naming, complexity, logs.
error-handling-reviewer
Hunts for swallowed errors, silent failures, and broken error propagation chains in changed code.