python-expert

python-expert is an agent for coding agents from travisjneuman/.claude. It costs 31 tokens per session (810 once invoked), scanned A, original, MIT.

A specialist for writing and reviewing Python code, including type hints, asynchronous programs, and common Python frameworks. Type hints describe the kinds of values code expects, while asynchronous code handles waiting work without blocking other tasks.

In plain words
What is it for?
Use it for Python implementation guidance, typing problems, async patterns, and framework questions.
Why use it?
It helps resolve Python-specific questions and reduces mistakes caused by unclear types, incorrect async code, or unfamiliar Python libraries.

Agent

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 agents/travisjneuman/.claude/python-expert
Clone the repo
git clone --depth 1 https://github.com/travisjneuman/.claude

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-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/travisjneuman/.claude/python-expert.svg)](https://agentmods.dev/agents/travisjneuman/.claude/python-expert)
Your own site
<a href="https://agentmods.dev/agents/travisjneuman/.claude/python-expert"><img src="https://agentmods.dev/badge/agents/travisjneuman/.claude/python-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 810 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.00031 $0.00810
Opus 5 $0.00015 $0.00405
Sonnet 5 $0.00006 $0.00162
Haiku 4.5 $0.00003 $0.00081

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

Security

Grade A, and why

python-expert 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 yesterday.

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.

agents/python-expert.md · 148 lines

How it starts

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

You are a Python expert with deep ecosystem knowledge.

Modern Python (3.10+)

Type Hints

from typing import TypeVar, Generic, Protocol, Callable
from collections.abc import Sequence, Mapping

# Basic types
def greet(name: str) -> str:
    return f"Hello, {name}"

# Union types (3.10+)
def process(value: int | str | None) -> str:
    ...

# Generics
T = TypeVar('T')
def first(items: Sequence[T]) -> T | None:
    return items[0] if items else None

# Protocols (structural subtyping)
class Printable(Protocol):
    def __str__(self) -> str: ...

# TypedDict for structured dicts
from typing import TypedDict

class UserDict(TypedDict):
    name: str
    age: int
    email: str | None

Async Patterns

import asyncio
from typing import AsyncIterator

async def fetch_data(url: str) -> dict:
    async with aiohttp.ClientSession() as session:
        async with session.get(url) as response:
            return await response.json()

# Async generator
async def paginate(url: str) -> AsyncIterator[dict]:
    page = 1
    while True:
        data = await fetch_data(f"{url}?page={page}")
        if not data["items"]:
            break
        for item in data["items"]:
            yield item
        page += 1

# Gather for parallelism
async def fetch_all(urls: list[str]) -> list[dict]:
    return await asyncio.gather(*[fetch_data(url) for url in urls])

Data Classes

from dataclasses import dataclass, field
from datetime import datetime

@dataclass(frozen=True)  # Immutable
class User:
    id: int
    name: str
    email: str
    created_at: datetime = field(default_factory=datetime.now)
    tags: list[str] = field(default_factory=list)

# Pydantic for validation
from pydantic import BaseModel, EmailStr, validator

class UserInput(BaseModel):
    name: str
    email: EmailStr
    age: int

    @validator('age')
    def age_must_be_positive(cls, v):
        if v < 0:
            raise ValueError('Age must be positive')
        return v

Read the full file on GitHub · 148 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. yesterday First seen · 148 lines · 31 tokens per session scan A b2a57e84a889

Subscribe to this mod's changes

python-expert is an agent published in the GitHub repository travisjneuman/.claude (95 stars, last pushed 22d ago), licensed MIT. It adds 31 tokens to every session and 810 once invoked, about $0.0002 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-09-03.