python-async-ops

python-async-ops is a skill for Claude Code from 0xDarkMatter/claude-mods. It costs 40 tokens per session (1,157 once invoked), scanned A, original, MIT.

A set of Python asyncio patterns for running many input-and-output tasks concurrently. It explains coroutines, await, task groups, semaphores, and the event loop.

In plain words
What is it for?
Use it to choose between synchronous and asynchronous code and to implement concurrent work with asyncio, aiohttp, gather, or TaskGroup.
Why use it?
It helps applications handle many network, database, file, WebSocket, or streaming operations without waiting for each one to finish before starting the next.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the claude-mods plugin — 112 skills, 3 commands, 3 agents, 4 hooks shipped together

Good fit Use it to choose between synchronous and asynchronous code and to implement concurrent work with asyncio, aiohttp, gather, or TaskGroup.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/0xdarkmatter/claude-mods/python-async-ops
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 0xDarkMatter/claude-mods --skill python-async-ops
Clone the repo
git clone --depth 1 https://github.com/0xDarkMatter/claude-mods

Made for: Claude Code.

Or install claude-mods, the plugin that ships this one along with the rest of its 112 skills, 3 commands, 3 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 python-async-ops

README.md
[![agentmods](https://agentmods.dev/badge/skills/0xdarkmatter/claude-mods/python-async-ops/github.svg)](https://agentmods.dev/skills/0xdarkmatter/claude-mods/python-async-ops)
Your own site
<a href="https://agentmods.dev/skills/0xdarkmatter/claude-mods/python-async-ops"><img src="https://agentmods.dev/badge/skills/0xdarkmatter/claude-mods/python-async-ops/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-async-ops

Your own site · 80×15
<a href="https://agentmods.dev/skills/0xdarkmatter/claude-mods/python-async-ops"><img src="https://agentmods.dev/badge/skills/0xdarkmatter/claude-mods/python-async-ops.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,157 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00040 $0.01157
Opus 5.5 $0.00016 $0.00463
Sonnet 5.5 $0.00008 $0.00231
Haiku 4.5 $0.00004 $0.00116

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

Security

Grade A, and why

python-async-ops scanned grade A with 1 finding 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.

The scan reads SKILL.md. This mod also ships 2 executable files (assets/async-project-template.py, scripts/find-blocking-calls.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

async def fetch(url: str) -> str:
skills/python-async-ops/SKILL.md · 178 lines

How it starts

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

Python Async Patterns

Asyncio patterns for concurrent Python programming.

When to Use Async vs Sync

Use Async When Use Sync When
I/O-bound operations (HTTP, DB, files) CPU-bound computations
High concurrency (100s+ connections) Simple scripts, one-off tasks
WebSocket/streaming connections Small data processing
Microservices with network calls Single sequential operations

Decision tree:

  1. Is it CPU-bound? → Sync (or multiprocessing)
  2. Is it I/O-bound with high concurrency? → Async
  3. Is it simple I/O with few connections? → Sync is fine

Core Concepts

import asyncio

# Coroutine (must be awaited)
async def fetch(url: str) -> str:
    async with aiohttp.ClientSession() as session:
        async with session.get(url) as response:
            return await response.text()

# Entry point
async def main():
    result = await fetch("https://example.com")
    return result

asyncio.run(main())

Pattern 1: Concurrent with gather

async def fetch_all(urls: list[str]) -> list[str]:
    """Fetch multiple URLs concurrently."""
    async with aiohttp.ClientSession() as session:
        tasks = [fetch_one(session, url) for url in urls]
        return await asyncio.gather(*tasks, return_exceptions=True)

Pattern 2: Bounded Concurrency

async def fetch_with_limit(urls: list[str], limit: int = 10):
    """Limit concurrent requests."""
    semaphore = asyncio.Semaphore(limit)

    async def bounded_fetch(url):
        async with semaphore:
            return await fetch_one(url)

    return await asyncio.gather(*[bounded_fetch(url) for url in urls])

Pattern 3: TaskGroup (Python 3.11+)

async def process_items(items):
    """Structured concurrency with automatic cleanup."""
    async with asyncio.TaskGroup() as tg:
        for item in items:
            tg.create_task(process_one(item))
    # All tasks complete here, or exception raised

Read the full file on GitHub · 178 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 · 178 lines · 40 tokens per session scan A 5af1ff44e78e

Subscribe to this mod's changes

python-async-ops is a skill published in the GitHub repository 0xDarkMatter/claude-mods (71 stars, last pushed 7d ago), licensed MIT. It adds 40 tokens to every session and 1,157 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

agent-django-fastapi-expert

Specialist subagent: Django ORM, Django REST Framework, FastAPI async patterns, and Pydantic v2 specialist. Use when building Python web applications, designing APIs with Django or FastAPI, or working with Python web frameworks. Trigger phrases: Django, FastAPI, DRF, Django REST Framework, Pydantic, ORM, queryset…

travisjneuman/.claude · 92 tokens

ai-ml-development

AI and machine learning development with PyTorch, TensorFlow, and LLM integration. Use when building ML models, training pipelines, fine-tuning LLMs, or implementing AI features.

travisjneuman/.claude · 43 tokens

agent-python-expert

Specialist subagent: Python best practices, type hints, async patterns, and ecosystem expertise. Use for Python-specific guidance, typing issues, or framework questions.

travisjneuman/.claude · 37 tokens

claude-agent-sdk

Expert implementation guidance for the Claude Agent SDK (Python). Use when users are building with the Agent SDK — creating custom tools, managing sessions, controlling permissions, streaming responses, integrating MCP servers, adding hooks, defining subagents, or deploying SDK-based agents. Also use for SDK…

berekvolgyipeter/dotclaude · 107 tokens

py-debug

Python debugging expert. Use when the user needs to debug, profile, or trace Python code — e.g. "how do I debug this", "find the memory leak", "why is this slow", "add a breakpoint", "profile this function".

berekvolgyipeter/dotclaude · 54 tokens

python-logging-best-practices

Python logging with loguru, structlog, and orjson. TRIGGERS - loguru, structlog, structured logging.

terrylica/cc-skills · 34 tokens