typecheck:explain

typecheck:explain is a command for coding agents from ruslan-korneev/claude-plugins. It costs 24 tokens per session (1,354 once invoked), scanned A, original, MIT.

A command that explains a Python type-checking error and shows a proper fix. It avoids silencing the checker with type-ignore comments.

In plain words
What is it for?
Use it when mypy reports incompatible types, missing annotations, missing returns, or unsafe handling of None.
Why use it?
It turns an often-cryptic typing error into an actionable explanation while keeping the type checks meaningful.

Command

Part of the python plugin — 4 skills, 10 commands, 1 agent, 1 hook shipped together

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.

agentmods
npx agentmods add commands/ruslan-korneev/claude-plugins/typecheck-explain
Clone the repo
git clone --depth 1 https://github.com/ruslan-korneev/claude-plugins

Or install python, the plugin that ships this one along with the rest of its 4 skills, 10 commands, 1 agent, 1 hook.

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 typecheck:explain

README.md
[![agentmods](https://agentmods.dev/badge/commands/ruslan-korneev/claude-plugins/typecheck-explain.svg)](https://agentmods.dev/commands/ruslan-korneev/claude-plugins/typecheck-explain)
Your own site
<a href="https://agentmods.dev/commands/ruslan-korneev/claude-plugins/typecheck-explain"><img src="https://agentmods.dev/badge/commands/ruslan-korneev/claude-plugins/typecheck-explain.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,354 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00024 $0.01354
Opus 5 $0.00012 $0.00677
Sonnet 5 $0.00005 $0.00271
Haiku 4.5 $0.00002 $0.00135

Measured 3d ago against content hash e3a68300f8f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

typecheck:explain 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 3d 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/python/commands/typecheck-explain.md · 267 lines

How it starts

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

Command /types:explain

Explain the type error and show the correct solution without type: ignore.

Principle

NEVER suggest type: ignore. Every type error has a correct solution.

Instructions

Step 1: Get context

If file:line is specified — read the code around the error.

# Get the error
mypy src/file.py:{{ line }} --show-error-codes

Step 2: Identify the error type

Common mypy errors:

  • error: Incompatible types in assignment
  • error: Argument X has incompatible type
  • error: Item "None" of "..." has no attribute
  • error: Missing return statement
  • error: Function is missing a return type annotation
  • error: Need type annotation for "..."

Step 3: Show the solution

Solutions for Common Errors

Incompatible types in assignment

# Error
x: str = 123  # Incompatible types in assignment (expression has type "int", variable has type "str")

# Solution 1: Change the variable type
x: int = 123

# Solution 2: Convert the value
x: str = str(123)

# Solution 3: Use Union
x: int | str = 123

Argument has incompatible type

# Error
def process(items: list[str]) -> None: ...
process(["a", "b", 1])  # Argument 1 has incompatible type "list[str | int]"

# Solution: Fix data or signature
process(["a", "b", str(1)])
# or
def process(items: list[str | int]) -> None: ...

Item "None" has no attribute

# Error
user = get_user(id)  # Returns User | None
print(user.name)  # Item "None" of "User | None" has no attribute "name"

# Solution 1: Check for None
user = get_user(id)
if user is not None:
    print(user.name)

# Solution 2: Early return
user = get_user(id)
if user is None:
    raise ValueError("User not found")
print(user.name)  # Now mypy knows user is not None

# Solution 3: assert (only for internal code)
user = get_user(id)
assert user is not None, "User must exist"
print(user.name)

Missing return statement

# Error
def process(x: int) -> str:
    if x > 0:
        return "positive"
    # Missing return statement

# Solution: Add return for all paths
def process(x: int) -> str:
    if x > 0:
        return "positive"
    return "non-positive"

Read the full file on GitHub · 267 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. 3d ago First seen · 267 lines · 0 tokens per session scan A e3a68300f8f6

Subscribe to this mod's changes

typecheck:explain is a command published in the GitHub repository ruslan-korneev/claude-plugins (4 stars, last pushed 6mo ago), licensed MIT. It adds 24 tokens to every session and 1,354 once invoked, about $0.0001 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.