language-python

language-python is a skill for Claude Code from lugassawan/swe-workbench. It costs 60 tokens per session (1,273 once invoked), scanned A, original, MIT.

A Python coding guide covering type hints, dataclasses, exceptions, context managers, generators, asyncio, and testing. It loads when you work on Python files or projects.

In plain words
What is it for?
Use it when writing or reviewing Python functions, data containers, file or database resource handling, async code, or tests.
Why use it?
It helps make Python code clearer and safer, especially around resource cleanup, error handling, and asynchronous work.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the swe-workbench plugin — 61 skills, 26 commands, 23 agents, 4 hooks shipped together

Good fit Use it when writing or reviewing Python functions, data containers, file or database resource handling, async code, or tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lugassawan/swe-workbench/language-python
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.

Any agent
npx skills add lugassawan/swe-workbench --skill language-python
Clone the repo
git clone --depth 1 https://github.com/lugassawan/swe-workbench

Made for: Claude Code.

Or install swe-workbench, the plugin that ships this one along with the rest of its 61 skills, 26 commands, 23 agents, 4 hooks.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/lugassawan/swe-workbench/language-python/github.svg)](https://agentmods.dev/skills/lugassawan/swe-workbench/language-python)
Your own site
<a href="https://agentmods.dev/skills/lugassawan/swe-workbench/language-python"><img src="https://agentmods.dev/badge/skills/lugassawan/swe-workbench/language-python/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 language-python

Your own site · 80×15
<a href="https://agentmods.dev/skills/lugassawan/swe-workbench/language-python"><img src="https://agentmods.dev/badge/skills/lugassawan/swe-workbench/language-python.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,273 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 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.00060 $0.01273
Opus 5.5 $0.00024 $0.00509
Sonnet 5.5 $0.00012 $0.00255
Haiku 4.5 $0.00006 $0.00127

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

Security

Grade A, and why

language-python scanned grade A with 2 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

tasks = [tg.create_task(fetch(u)) for u in urls]

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- `subprocess.run(shell=True)` with user-controlled input — use the list form.
skills/language-python/SKILL.md · 137 lines

How it starts

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

Python

Type hints

  • Annotate all function signatures; Any is a smell unless at a genuine boundary.
  • Use dataclass for data containers with behavior; TypedDict for dict-shaped data at boundaries.
  • Prefer Protocol over ABC when duck typing suffices — no inheritance required.
  • from __future__ import annotations for forward refs in 3.9 and earlier.
from dataclasses import dataclass, field

@dataclass
class Order:
    id: str
    items: list[str] = field(default_factory=list)
    total: float = 0.0

Errors and exceptions

  • Use exceptions for exceptional paths, not flow control.
  • Raise specific subclasses; catch the narrowest class you can handle.
  • except Exception: is almost always wrong — at minimum log and re-raise.
  • contextlib.suppress(SomeError) for intentional ignore; bare except: never.
try:
    result = load(path)
except FileNotFoundError:
    raise MissingConfigError(path) from None

Context managers

  • with for any resource with a cleanup obligation: files, locks, DB connections.
  • @contextlib.contextmanager for ad-hoc managers without a full class.
  • Never hold a resource longer than the with block.
@contextlib.contextmanager
def managed_resource():
    r = acquire()
    try:
        yield r
    finally:
        release(r)

Generators and iterators

  • Prefer generators over materializing full lists when you only iterate once.
  • yield from to delegate to sub-generators.
  • Reach for itertools before writing loops: chain, islice, groupby, product.
def read_chunks(path: Path, size: int = 4096):
    with open(path, "rb") as f:
        while chunk := f.read(size):  # walrus operator, 3.8+
            yield chunk

Concurrency

  • GIL caveat: threads don't parallelize CPU-bound work — use ProcessPoolExecutor or multiprocessing.
  • asyncio for IO-bound concurrency; asyncio.TaskGroup (3.11+) for structured fan-out.
  • ThreadPoolExecutor for legacy sync IO or blocking C extensions.
  • One event loop per process; never nest or mix loops.

Read the full file on GitHub · 137 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 137 lines · 60 tokens per session scan A 4501a9b42668

Subscribe to this mod's changes

language-python is a skill published in the GitHub repository lugassawan/swe-workbench (3 stars, last pushed 2d ago), licensed MIT. It adds 60 tokens to every session and 1,273 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

language-python compared with skills from other repositories

language-python next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
language-pythonlugassawan/swe-workbenchSkill32d agoMITA60Claude Code
functions-developmentCrowdStrike/foundry-skillsSkill38todayMITA195Claude Code
Python Clean ArchitectureMKToronto/python-clean-architectureSkill115mo agoMITA112Claude Code
shiny-py-optimizeposit-dev/skillsSkill57618d agoMITA105Claude Code
cloudflare-workers-multi-langsecondsky/claude-skillsSkill257yesterdayMITA45Claude Code
review-rustexistential-birds/beagleSkill91todayApache-2.0A47Claude Code, Codex
go-data-persistenceexistential-birds/beagleSkill91todayApache-2.0A56Claude Code, Codex