aiocache

aiocache is a skill for Claude Code, Codex from tedivm/robs_awesome_python_template. It costs 47 tokens per session (1,933 once invoked), scanned A, original, MIT.

A guide for using aiocache, a Python library for asynchronous caching, in a project. It covers in-memory caching, optional Redis storage, expiration times, and a fallback that disables caching safely.

In plain words
What is it for?
Read, write, delete, and clear cached values; configure memory or Redis-backed caches; set expiration times; and understand the NoOpCache fallback.
Why use it?
It keeps cache behavior consistent and provides a fallback when caching is turned off or Redis is unavailable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Read, write, delete, and clear cached values; configure memory or Redis-backed caches; set expiration times; and understand the NoOpCache fallback.

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

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 aiocache

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/tedivm/robs_awesome_python_template/aiocache"><img src="https://agentmods.dev/badge/skills/tedivm/robs_awesome_python_template/aiocache.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,933 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00047 $0.01933
Opus 5.5 $0.00019 $0.00773
Sonnet 5.5 $0.00009 $0.00387
Haiku 4.5 $0.00005 $0.00193

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

Security

Grade A, and why

aiocache scanned grade A with 0 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 1mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

{{cookiecutter.__package_slug}}/.agents/skills/aiocache/SKILL.md · 225 lines

How it starts

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

aiocache Caching

context7: If the context7 tools are available, resolve and load the full aiocache documentation before making changes:

context7_resolve-library-id: "aiocache"
context7_query-docs: /aio-libs/aiocache

The caching layer is defined in {{cookiecutter.__package_slug}}/services/cache.py. It provides helper functions and a NoOpCache fallback for when caching is disabled.


Cache Aliases

Three cache backends are configured by configure_caches():

Alias Backend Default TTL
memory Always in-memory cache_default_ttl (300s)
persistent Redis if configured, else memory cache_persistent_ttl (3600s)
default Same as memory cache_persistent_ttl (3600s)*

* Note: set_cached() applies cache_default_ttl only when alias == "memory", so default falls through to cache_persistent_ttl.


Using the Helpers

from {{cookiecutter.__package_slug}}.services.cache import get_cached, set_cached, delete_cached, clear_cache

# Get (returns None on miss)
value = await get_cached("user:123")

# Set with default TTL
await set_cached("user:123", user_data)

# Set with custom TTL
await set_cached("user:123", user_data, ttl=600, alias="persistent")

# Delete
await delete_cached("user:123", alias="persistent")

# Clear entire cache
await clear_cache(alias="persistent")

Direct Cache Access

For operations not covered by the helpers:

from {{cookiecutter.__package_slug}}.services.cache import get_cache

cache = get_cache("memory")
exists = await cache.exists("key")

Cache Decorator

Use @cached to automatically cache function return values. The decorator takes a cache instance (not an alias string) as its first argument. Retrieve the instance with get_cache():

from aiocache import cached
from {{cookiecutter.__package_slug}}.services.cache import get_cache

@cached(get_cache("memory"), ttl=300, key_builder=lambda f, *args, **kwargs: f"user:{args[0]}")
async def get_user(user_id: int) -> dict[str, str] | None:
    # Expensive DB call — cached for 300s
    return await fetch_user_from_db(user_id)

Read the full file on GitHub · 225 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 · 225 lines · 47 tokens per session scan A e46507e20206

Subscribe to this mod's changes

aiocache is a skill published in the GitHub repository tedivm/robs_awesome_python_template (312 stars, last pushed 5mo ago), licensed MIT. It adds 47 tokens to every session and 1,933 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. 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

后端编码

A backend coding guide covering web APIs, databases, error handling, logging, and endpoint tests. Backend code runs on servers and handles data and application operations.

jianchen08/Agent-os-open · 49 tokens

background-task

Add or modify work that runs outside the request/response cycle — emails, document ingestion, webhooks, cleanups, scheduled jobs. Use when something is slow or fire-and-forget, or when adding a periodic/cron task. This project's queue is {{ cookiecutter.backgroundtasks }}.

vstorm-co/full-stack-ai-agent-template · 62 tokens

alembic-migration

Create, review, and apply database schema changes with Alembic. Use whenever a SQLAlchemy model is added or changed, a column/index/constraint needs to change, or a data backfill is required — anything that alters the PostgreSQL schema.

vstorm-co/full-stack-ai-agent-template · 56 tokens

channel-bot

Work with messaging-channel bots (Telegram / Slack) — register a bot, route inbound messages through the AI agent, handle webhooks vs polling, or add a new channel adapter. Use when wiring chat into a messaging platform or debugging bot delivery.

vstorm-co/full-stack-ai-agent-template · 53 tokens

fastcrud

Use when building or modifying CRUD endpoints with FastCRUD (the fastcrud PyPI package) in a FastAPI project — covers FastCRUD, crudrouter, EndpointCreator, FilterConfig, JoinConfig, auto-relationship detection, the filter operator syntax (gte, in, ilike, etc.), cursor pagination, soft delete, and how to avoid N+1…

benavlabs/fastcrud · 147 tokens

using-redis-token-buckets

Use when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit whose Retry-After must be a real wait rather than a window edge. posthog/tokenbucket.py provides an atomic Lua token bucket (consume, refund…

PostHog/posthog-foss · 148 tokens