api-deprecation-tracker

api-deprecation-tracker is an agent for Claude Code from ReviewToolkits/cpython-review-toolkit. It costs 141 tokens per session (3,559 once invoked), scanned A, original, MIT.

A code-review agent for finding deprecated CPython C API calls, meaning older interfaces that have newer replacements or may be removed.

In plain words
What is it for?
Use it to scan CPython code for deprecated APIs, understand their urgency, and plan migrations to newer interfaces.
Why use it?
It distinguishes real uses in code from definitions, comments, and similar names, then reports replacement options and removal timelines.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the cpython-review-toolkit plugin — 7 commands, 23 agents shipped together

Good fit Use it to scan CPython code for deprecated APIs, understand their urgency, and plan migrations to newer interfaces.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/reviewtoolkits/cpython-review-toolkit/api-deprecation-tracker
Install

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.

Clone the repo
git clone --depth 1 https://github.com/ReviewToolkits/cpython-review-toolkit

Made for: Claude Code.

Or install cpython-review-toolkit, the plugin that ships this one along with the rest of its 7 commands, 23 agents.

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

agentmods badge for api-deprecation-tracker

README.md
[![agentmods](https://agentmods.dev/badge/agents/reviewtoolkits/cpython-review-toolkit/api-deprecation-tracker/github.svg)](https://agentmods.dev/agents/reviewtoolkits/cpython-review-toolkit/api-deprecation-tracker)
Your own site
<a href="https://agentmods.dev/agents/reviewtoolkits/cpython-review-toolkit/api-deprecation-tracker"><img src="https://agentmods.dev/badge/agents/reviewtoolkits/cpython-review-toolkit/api-deprecation-tracker/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.

agentmods 80×15 button for api-deprecation-tracker

Your own site · 80×15
<a href="https://agentmods.dev/agents/reviewtoolkits/cpython-review-toolkit/api-deprecation-tracker"><img src="https://agentmods.dev/badge/agents/reviewtoolkits/cpython-review-toolkit/api-deprecation-tracker.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 141 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,559 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00141 $0.03559
Opus 5.5 $0.00056 $0.01424
Sonnet 5.5 $0.00028 $0.00712
Haiku 4.5 $0.00014 $0.00356

Measured 1mo ago against content hash 46c5a4ae86c8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-deprecation-tracker 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 1mo 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.

plugins/cpython-review-toolkit/agents/api-deprecation-tracker.md · 248 lines

How it starts

The opening of the file, as written. The whole thing — 248 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert in CPython C API evolution, specializing in API deprecation and migration. Your mission is to find usage of deprecated APIs within CPython's own codebase.

Scope

Analyze the scope provided. Default: the entire project.

Script-Assisted Analysis

python <plugin_root>/scripts/scan_deprecated_apis.py [scope]

The vocabulary lives in data/deprecated_c_apis.json, verified entry-by-entry against a CPython checkout (Py_DEPRECATED markers in Include/, .. deprecated:: / .. soft-deprecated:: directives in Doc/c-api/, and Doc/deprecations/c-api-pending-removal-in-*.rst). Do not hand-grep for a list from memory — the previous version of this agent did exactly that and scored 0 real hits out of 13 on Objects/: every match was the API's own definition site, comment prose, or a substring false positive (PyUnicode_AsUnicode matching the live PyUnicode_AsUnicodeEscapeString).

Key fields per finding: api, tier, deprecated_in, removed_in, replacement, drop_in, caveat, severity, code (the source line), detail.

Order the report by removed_in, soonest first

Use the summary.by_removal map, which is sorted by deadline. Do not hard-code a priority family: which family matters depends on the scope. On Objects/ the _PyUnicodeWriter_* family (removal 3.18) dominates; on anything touching Python/, the 21 Py_*Flag global configuration variables outrank it, because they are removed in 3.16 — the release under development, and the nearest deadline in the vocabulary. Let the data pick the family.

drop_in / caveat — read these before recommending anything

replacement alone is not enough, and trusting it caused the one FIX of the Modules/ run to point at a regression. When drop_in is false, the named replacement is not a mechanical substitution and caveat says what breaks and what the verified drop-in actually is. Three shapes recur:

  • Different type check. _PyUnicodeWriter_WriteStr names PyUnicodeWriter_WriteStr, which tests type == &PyUnicode_Type exactly (Objects/unicode_writer.c:364), so a str subclass falls through to PyObject_Str and runs user code. That was gh-148241, and Modules/_json.c:407 carries a comment saying so. The verified drop-in is PyUnicodeWriter_WriteSubstring(w, s, 0, PyUnicode_GET_LENGTH(s)).
  • Inverted polarity. Six of the Py_*Flag globals map to a PyConfig member with the opposite sense — CPython's own bridge table marks them GLOBAL(&Py_NoSiteFlag, 1) where the second field is literally named not. A rename inverts the behaviour.
  • Different refcount semantics. PyModule_AddObject steals only on success.

Read the full file on GitHub · 248 lines

Changes

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.

  1. 1mo ago First seen · 248 lines · 0 tokens per session scan A 46c5a4ae86c8

Subscribe to this mod's changes

api-deprecation-tracker is an agent published in the GitHub repository ReviewToolkits/cpython-review-toolkit (10 stars, last pushed 2mo ago), licensed MIT. It adds 141 tokens to every session and 3,559 once invoked, about $0.0006 per session on Opus 5.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.

Related

Other agents, from other repositories

cpp-reviewer

Expert C++ code reviewer specializing in memory safety, modern C++ idioms, concurrency, and performance. Use for all C++ code changes. MUST BE USED for C++ projects.

affaan-m/ECC · 41 tokens

cpp-memory-review

Agent "cpp-memory-review" from Jorgejie/ai_scaffold, covering 1. {{t "cppmemoryreview.jnireftitle"}}, 2. {{t "cppmemoryreview.heaptitle"}}, 3. {{t "cppmemoryreview.buffertitle"}}, 4. {{t "cppmemoryreview.sensitivetitle"}} and 5. {{t "cppmemoryreview.rationalitytitle"}}.

Jorgejie/ai_scaffold · 8 tokens

type-slot-checker

Use this agent to audit Python type definitions (PyTypeObject, PyTypeSpec) in C extension code for correctness of slots, dealloc, traverse, and GC integration.\n\n \nUser: Check the type definitions in my C extension.\nAgent: I will run the type slot scanner, verify dealloc/traverse/GC flag consistency, check…

ReviewToolkits/cext-review-toolkit · 98 tokens

version-compat-scanner

Use this agent to audit Python version compatibility in C extension code, including deprecated API usage, version-guarded code, and pythoncapi-compat opportunities.\n\n \nUser: Check Python version compatibility in my C extension.\nAgent: I will determine the target Python versions, check for unguarded…

ReviewToolkits/cext-review-toolkit · 100 tokens

c-complexity-analyzer

Use this agent to measure and analyze C code complexity in extension modules, identifying hotspots and suggesting simplifications.\n\n \nUser: What are the most complex functions in this extension?\nAgent: I will run the complexity measurement script, identify hotspots with score >= 5.0, assess inherent vs reducible…

ReviewToolkits/cext-review-toolkit · 89 tokens

generated-code-mapper

Use this agent FIRST in every cext-review-toolkit explore pipeline on a C extension that uses a code generator (Cython, pybind11, nanobind, custom codegen). It produces a project-orientation guide that downstream agents (refcount, error-path, GIL, etc.) consume to triage findings accurately. The orientation captures…

ReviewToolkits/cext-review-toolkit · 268 tokens