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 — 116 skills, 5 commands, 4 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 116 skills, 5 commands, 4 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 3mo 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 3mo 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. 3mo 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 (86 stars, last pushed 12d 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

python-async-ops compared with skills from other repositories

python-async-ops next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
python-async-ops0xDarkMatter/claude-modsSkill8612d agoMITA40Claude Code
ai-ml-developmenttravisjneuman/.claudeSkill116todayMITA43Claude Code
agent-python-experttravisjneuman/.claudeSkill116todayMITA37Claude Code
agent-django-fastapi-experttravisjneuman/.claudeSkill116todayMITA92Claude Code
python-logging-best-practicesterrylica/cc-skillsSkill5todayMITA34Claude Code
python-memory-safe-scriptsterrylica/cc-skillsSkill5todayMITA197Claude Code
pypi-dopplerterrylica/cc-skillsSkill5todayMITA42Claude Code