using-asyncio-python

using-asyncio-python is a skill for Claude Code, Codex from booklib-ai/booklib. It costs 190 tokens per session (3,863 once invoked), scanned A, original, MIT.

A set of practices for writing and reviewing Python programs that perform many input and output tasks concurrently, such as network or database work.

In plain words
What is it for?
It is for building or reviewing Python code that uses event loops, coroutines, tasks, futures, and related async features.
Why use it?
It helps developers choose between asynchronous code, threads, and other approaches while avoiding common concurrency problems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for building or reviewing Python code that uses event loops, coroutines, tasks, futures, and related async features.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/booklib-ai/booklib/using-asyncio-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 booklib-ai/booklib --skill using-asyncio-python
Clone the repo
git clone --depth 1 https://github.com/booklib-ai/booklib

Made for: Claude Code, Codex.

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 using-asyncio-python

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/booklib-ai/booklib/using-asyncio-python"><img src="https://agentmods.dev/badge/skills/booklib-ai/booklib/using-asyncio-python.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 190 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,863 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.
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.00190 $0.03863
Opus 5.5 $0.00076 $0.01545
Sonnet 5.5 $0.00038 $0.00773
Haiku 4.5 $0.00019 $0.00386

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

Security

Grade A, and why

using-asyncio-python 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 (scripts/check_blocking.py, scripts/example.py), 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.

- **Blocking the event loop** → Ch 2-3: Use run_in_executor() for blocking calls; never call time.sleep(), requests.get(), or file open() directly
skills/using-asyncio-python/SKILL.md · 291 lines

How it starts

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

Using Asyncio in Python Skill

You are an expert Python async/concurrent programming engineer grounded in the chapters from Using Asyncio in Python (Understanding Asynchronous Programming) by Caleb Hattingh. You help developers in two modes:

  1. Async Building — Design and implement async Python code with idiomatic, production-ready patterns
  2. Async Review — Analyze existing async code against the book's practices and recommend improvements

How to Decide Which Mode

  • If the user asks to build, create, implement, write, or design async code → Async Building
  • If the user asks to review, audit, improve, debug, optimize, or fix async code → Async Review
  • If ambiguous, ask briefly which mode they'd prefer

Mode 1: Async Building

When designing or building async Python code, follow this decision flow:

Step 1 — Understand the Requirements

Ask (or infer from context):

  • What workload? — I/O-bound (network, disk, database) or CPU-bound? Mixed?
  • What pattern? — Single async function, producer-consumer, server, pipeline, background tasks?
  • What scale? — Single coroutine, handful of tasks, thousands of concurrent connections?
  • What challenges? — Graceful shutdown, cancellation, timeouts, blocking code integration?

Step 2 — Apply the Right Practices

Read references/api_reference.md for the full chapter-by-chapter catalog. Quick decision guide:

Concern Chapters to Apply
Understanding when to use asyncio Ch 1: I/O-bound concurrency, single-threaded event loop, when threads aren't ideal
Threading vs asyncio decisions Ch 2: Thread drawbacks, race conditions, GIL, when to use ThreadPoolExecutor
Core async patterns Ch 3: asyncio.run(), event loop, coroutines, async def/await, create_task()
Task management Ch 3: gather(), wait(), ensure_future(), Task cancellation, timeouts
Async iteration and context managers Ch 3: async with, async for, async generators, async comprehensions
Startup and shutdown Ch 3: Proper initialization, signal handling, executor shutdown, cleanup patterns
HTTP client/server Ch 4: aiohttp ClientSession, aiohttp web server, connection pooling
Async file I/O Ch 4: aiofiles for non-blocking file operations
Async web frameworks Ch 4: Sanic for high-performance async web apps
Async databases Ch 4: asyncpg for PostgreSQL, aioredis for Redis
Integrating blocking code Ch 2-3: run_in_executor(), ThreadPoolExecutor, ProcessPoolExecutor
Historical context App A: Evolution from generators → yield from → async/await

Read the full file on GitHub · 291 lines

Files

What ships with it

9 files 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. 1mo ago First seen · 291 lines · 190 tokens per session scan A 35d8c0814cef

Subscribe to this mod's changes

using-asyncio-python is a skill published in the GitHub repository booklib-ai/booklib (39 stars, last pushed 6mo ago), licensed MIT. It adds 190 tokens to every session and 3,863 once invoked, about $0.0008 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-08-30.

Related

Other skills, from other repositories

fastapi

Use when building, reviewing, testing, securing or shipping a FastAPI / async Python service — routers, Pydantic v2 schemas, dependency injection, async SQLAlchemy 2.0, OAuth2/JWT, ASGITransport tests, production wiring. NOT language-level Python or packaging (that is python), NOT engine-level SQL (that is…

ericrisco/rsc-harness · 94 tokens

python

Use when the task is Python itself, in any framework or none: PEP 695 generics, mypy --strict typing, dataclass/Protocol/TypedDict/Enum choices, asyncio.TaskGroup, stdlib idioms, src/ layout + pyproject.toml with uv, ruff+mypy+pytest gate. NOT a FastAPI/ASGI service (that is fastapi), NOT a deep pytest suite (that is…

ericrisco/rsc-harness · 94 tokens

asyncio

Python asyncio - Modern concurrent programming with async/await, event loops, tasks, coroutines, primitives, aiohttp, and FastAPI async patterns.

bobmatnyc/claude-mpm-skills · 32 tokens

python-asyncio-concurrency

Write correct asyncio Python — event loop, tasks, locking, timeouts, and avoiding blocked/leaked coroutines.

vikasudasi/skill-vault · 30 tokens

asyncio-concurrency-patterns

Complete guide for asyncio concurrency patterns including event loops, coroutines, tasks, futures, async context managers, and performance optimization.

manutej/luxor-claude-marketplace · 31 tokens

fastapi-pro

FastAPI development expertise. Async APIs, dependency injection, Pydantic v2, middleware, and production patterns. Use when building high-performance Python APIs.

hoangatg/ai-agent-toolkit · 35 tokens