python-asyncio-concurrency

python-asyncio-concurrency is a skill for Claude Code, Codex from vikasudasi/skill-vault. It costs 30 tokens per session (412 once invoked), scanned A, original, Apache-2.0.

A guide to writing concurrent asynchronous Python with asyncio. Asynchronous code lets one program handle multiple waiting tasks, such as network requests, without stopping the whole program.

In plain words
What is it for?
Use it to run tasks in parallel, add time limits, coordinate shared work, handle cancellation, and move blocking or CPU-heavy work out of the event loop.
Why use it?
It helps prevent blocked event loops, forgotten tasks, missing awaits, incorrect locking, and background work that never finishes or cannot be cancelled.

Skill for Claude CodeCodex

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

Good fit Use it to run tasks in parallel, add time limits, coordinate shared work, handle cancellation, and move blocking or CPU-heavy work out of the event loop.

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/vikasudasi/skill-vault/python-asyncio-concurrency"><img src="https://agentmods.dev/badge/skills/vikasudasi/skill-vault/python-asyncio-concurrency.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 412 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.00030 $0.00412
Opus 5.5 $0.00012 $0.00165
Sonnet 5.5 $0.00006 $0.00082
Haiku 4.5 $0.00003 $0.00041

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

Security

Grade A, and why

python-asyncio-concurrency 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 1 executable file (scripts/async_patterns.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.

async def fetch(url: str) -> str: ...
skill_vault/data/skills/python-asyncio-concurrency/SKILL.md · 59 lines

What it actually says

Correct Python asyncio

Use when writing concurrent async code — background tasks, parallel I/O, or orchestrating many awaitables without blocking the loop.

Run and await

import asyncio


async def fetch(url: str) -> str: ...


async def main() -> None:
    results = await asyncio.gather(fetch("a"), fetch("b"))

Never block the loop

One event loop runs all coroutines — a blocking time.sleep() or sync I/O inside a coroutine stalls everything. Use asyncio.sleep(), re-encode sync work with await asyncio.to_thread(...), or push CPU-bound work to a process.

Tasks and cancellation

  • asyncio.create_task() schedules background work; keep a reference or it may be garbage-collected mid-flight.
  • Use asyncio.timeout(...) (3.11+) for bounds; handle TimeoutError.

Locking across coroutines

lock = asyncio.Lock()
async with lock:
    ...  # critical section

An asyncio.Lock is per-loop — a plain threading.RLock is for threads and won't serialize coroutines correctly. Match the lock to your concurrency model.

Pitfalls

  • Forgetting to await returns a coroutine that never runs → "coroutine was never awaited" warning. Intentional fire-and-forget still needs a task.
  • Don't share mutable state across tasks without a lock.
Files

What ships with it

2 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 · 59 lines · 30 tokens per session scan A 7e5920a19ec0

Subscribe to this mod's changes

python-asyncio-concurrency is a skill published in the GitHub repository vikasudasi/skill-vault (0 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 30 tokens to every session and 412 once invoked, about $0.0001 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-31.