wiswa-mcp: Agent for Claude Code

.claude/agents/python-moderniser.md

python-moderniser is an agent for Claude Code from Tatsh/wiswa-mcp. It costs 42 tokens per session (639 once invoked), scanned A, original, MIT.

A coding assistant that updates older Python code to newer syntax supported by the project's minimum Python version, including Python 3.12 features.

In plain words
What is it for?
Use it during refactoring passes to update conditionals, type annotations, generics, exception handling, and standard-library usage.
Why use it?
It reduces manual cleanup while checking that modern syntax remains clear and compatible with the project.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is Tatsh/wiswa-mcp's own configuration. It tells Claude Code how to work on wiswa-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything wiswa-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Tatsh/wiswa-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Tatsh/wiswa-mcp/master/.claude/agents/python-moderniser.md
Clone the repo
git clone --depth 1 https://github.com/Tatsh/wiswa-mcp

Made for: Claude Code.

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 python-moderniser

README.md
[![agentmods](https://agentmods.dev/badge/agents/tatsh/wiswa-mcp/python-moderniser/github.svg)](https://agentmods.dev/agents/tatsh/wiswa-mcp/python-moderniser)
Your own site
<a href="https://agentmods.dev/agents/tatsh/wiswa-mcp/python-moderniser"><img src="https://agentmods.dev/badge/agents/tatsh/wiswa-mcp/python-moderniser/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 python-moderniser

Your own site · 80×15
<a href="https://agentmods.dev/agents/tatsh/wiswa-mcp/python-moderniser"><img src="https://agentmods.dev/badge/agents/tatsh/wiswa-mcp/python-moderniser.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 639 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.00042 $0.00639
Opus 5.5 $0.00017 $0.00256
Sonnet 5.5 $0.00008 $0.00128
Haiku 4.5 $0.00004 $0.00064

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

Security

Grade A, and why

python-moderniser 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 2mo 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.

.claude/agents/python-moderniser.md · 70 lines

How it starts

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

Python Moderniser Agent

Upgrades Python code to use modern language features based on the project's minimum version.

Role

You modernise Python code by replacing older patterns with equivalent newer syntax. Only apply changes that preserve clarity - never make code harder to read. Follow all conventions in .claude/rules/python.md.

Determining the minimum version

Read requires-python from pyproject.toml to determine the minimum supported version.

Modernisation targets

3.10+

  • match/case instead of long if/elif/else chains on a single variable.
  • X | Y union syntax in type annotations instead of Union[X, Y] or Optional[X].
  • TypeAlias for explicit type alias declarations.

3.11+

  • ExceptionGroup and except* where multiple exceptions are handled in parallel.
  • Self type from typing for methods returning their own class.
  • StrEnum instead of (str, Enum) inheritance.
  • tomllib instead of third-party TOML parsers for reading.

3.12+

  • PEP 695 type parameter syntax: def func[T](x: T) -> T instead of TypeVar.
  • PEP 695 type statement for type aliases: type Vector = list[float].
  • PEP 695 generic classes: class Stack[T] instead of Generic[T].
  • @override decorator from typing for overridden methods.
  • itertools.batched instead of manual chunking.

3.13+

  • warnings.deprecated decorator (PEP 702).
  • Default TypeVar values (PEP 696): type T = int.

3.14+

  • type annotations in except clauses (PEP 649 deferred evaluation).

Workflow

  1. Read requires-python from pyproject.toml to confirm the minimum version.
  2. For each Python file in the project: a. Read the file. b. Identify patterns that can be modernised based on the minimum version. c. Skip any change that would reduce clarity. d. Apply changes.
  3. After all changes, launch the qa-fixer agent to format and fix any lint/spelling issues.
  4. Run uv run pytest to verify no regressions.

Rules

  • Never change semantics - the modernised code must behave identically.
  • Never reduce clarity. If a modern syntax is less readable in context, keep the old form.
  • Do not modernise code in comments or docstrings.
  • Do not modernise third-party code or vendored files.
  • Only modernise to features available in the minimum supported Python version.

Read the full file on GitHub · 70 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. 2mo ago First seen · 70 lines · 42 tokens per session scan A 9879860a8fbb

Subscribe to this mod's changes

python-moderniser is an agent published in the GitHub repository Tatsh/wiswa-mcp (0 stars, last pushed yesterday), licensed MIT. It adds 42 tokens to every session and 639 once invoked, about $0.0002 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

python-moderniser compared with agents from other repositories

python-moderniser next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
python-moderniserTatsh/wiswa-mcpAgent0yesterdayMITA42Claude Code
fastmcp-specialistgensecaihq/MCP-Developer-SubAgentAgent291y agoMITA24Claude Code
Geoprocessing SpecialistSHAdd0WTAka/Zen-Ai-PentestAgent5033d agoMITA45Claude Code, OpenCode
python-proechoVic/blade-codeAgent18124d agoMITA51Claude Code
temporal-test-buildercanonical/copilot-collectionsAgent323d agoApache-2.0A56Claude Code
script-operatorMadGraphTeam/MadAgentsAgent153mo agoMITA24Claude Code
python-reviewerGGGODLIN/claude-pr-reviewAgent1141mo agoMITA43Claude Code