caching

caching is a skill for Claude Code, Codex from nimadorostkar/Claude-Skills-collection. It costs 34 tokens per session (1,074 once invoked), scanned A, original, MIT.

Guidance for adding or debugging a cache, which stores frequently used data so it can be read faster or with fewer requests to an upstream system. It covers placement, expiration, invalidation, consistency, and protection against traffic spikes.

In plain words
What is it for?
Use it to choose a cache location and strategy, set expiration times, define invalidation rules, protect expensive keys, and monitor cache hit rates.
Why use it?
It helps avoid stale data, cache stampedes where many requests rebuild the same entry, unexplained memory growth, and unclear trade-offs between speed and freshness.

Skill for Claude CodeCodex

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

Good fit Use it to choose a cache location and strategy, set expiration times, define invalidation rules, protect expensive keys, and monitor cache hit rates.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nimadorostkar/claude-skills-collection/caching
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 nimadorostkar/Claude-Skills-collection --skill caching
Clone the repo
git clone --depth 1 https://github.com/nimadorostkar/Claude-Skills-collection

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 caching

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/nimadorostkar/claude-skills-collection/caching"><img src="https://agentmods.dev/badge/skills/nimadorostkar/claude-skills-collection/caching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,074 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.00034 $0.01074
Opus 5 $0.00017 $0.00537
Sonnet 5 $0.00007 $0.00215
Haiku 4.5 $0.00003 $0.00107

Measured 12d ago against content hash c9d0b1485682, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

caching 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 12d 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.

skills/backend/caching/SKILL.md · 95 lines

How it starts

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

Caching

Purpose

Add a cache with a clear invalidation story, or find out why the existing one is serving stale data. A cache is a second source of truth; introducing one is a consistency decision, not just a performance one.

When to Use

  • A read path is slow and the data is read far more often than it is written.
  • An upstream dependency is expensive, rate-limited, or unreliable.
  • Debugging stale reads, cache stampedes, or unexplained memory growth.

Capabilities

  • Cache placement: client, CDN, application, database.
  • Strategies: cache-aside, read-through, write-through, write-behind.
  • Invalidation: TTL, explicit, event-driven, versioned keys.
  • Stampede protection: locking, early recomputation, request coalescing.
  • Negative caching and hot-key mitigation.

Inputs

  • The read/write ratio and the cost of the uncached path.
  • How stale the data is allowed to be — in seconds, agreed with the product owner.
  • Cardinality of the key space and expected memory footprint.

Outputs

  • A key schema, a TTL, and an invalidation trigger for each cached entity.
  • Stampede protection on any key expensive enough to matter.
  • A hit-rate metric, because a cache you do not measure is a cache you do not understand.

Workflow

  1. Prove the need — Measure the uncached path first. A cache in front of a missing index is a permanent workaround for a five-minute fix.
  2. Decide the staleness budget — Ask what breaks if a user sees data five seconds old. The answer determines the TTL and whether you need explicit invalidation.
  3. Design the key — Include everything that varies the result: tenant, locale, permission scope. A key that omits a dimension leaks data between users.
  4. Choose invalidation — TTL alone for tolerant data. TTL plus explicit deletion on write for data that must be fresh. Versioned keys when deletion is unreliable.
  5. Protect against stampedes — When a hot key expires, every concurrent request misses simultaneously and hits the origin at once. Use a lock or single-flight.
  6. Measure — Hit rate, latency at each layer, and eviction rate. Falling hit rate with rising memory means the key space is too large.

Read the full file on GitHub · 95 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. 12d ago First seen · 95 lines · 34 tokens per session scan A c9d0b1485682

Subscribe to this mod's changes

caching is a skill published in the GitHub repository nimadorostkar/Claude-Skills-collection (26 stars, last pushed 25d ago), licensed MIT. It adds 34 tokens to every session and 1,074 once invoked, about $0.0002 per session on Opus 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

google-cloud-storage-fuse

Mounts Cloud Storage buckets as a POSIX file system with Cloud Storage FUSE (gcsfuse). Use when interacting with gcsfuse: decide whether FUSE, native gs:// reads, or Filestore/Managed Lustre fits a workload, deploy tuned mounts on GKE, Compute Engine, or Cloud Run, enable and size file, stat, and list caches, tune…

google/skills · 214 tokens

offensive-sqli

SQL injection testing skill for offensive security assessments and bug bounty hunting. Covers error-based, UNION-based, boolean/time-based blind, out-of-band, second-order, NoSQL, GraphQL, WebSocket, and JSON-operator SQLi. Includes WAF bypass techniques, database-specific exploitation (MySQL, MSSQL, PostgreSQL…

SnailSploit/Claude-Red · 117 tokens

aws-cloudformation-elasticache

Provides AWS CloudFormation patterns for ElastiCache Redis or Memcached infrastructure, including subnet groups, parameter groups, security controls, and cross-stack outputs. Use when designing cache tiers, high-availability replication groups, encryption settings, or reusable CloudFormation templates for application…

giuseppe-trisciuoglio/developer-kit · 61 tokens

spring-boot-cache

Provides patterns for implementing Spring Boot caching: configures Redis/Caffeine/EhCache providers with TTL and eviction policies, applies @Cacheable/@CacheEvict/@CachePut annotations, validates cache hit/miss behavior, and exposes metrics via Actuator. Use when adding caching to Spring Boot services, configuring…

giuseppe-trisciuoglio/developer-kit · 79 tokens

caching-strategies

CDN, Redis, in-memory cache, cache invalidation, and distributed caching patterns.

cosmicstack-labs/mercury-agent-skills · 23 tokens

hermes-mnemosyne

Mnemosyne is Hermes' primary local-first memory engine — SQLite with vector + FTS5 hybrid search, 19+ tools, auto-consolidation, and a standalone CLI. It's a pip-installed plugin (not a built-in toolset) discovered via $HERMESHOME/plugins/mnemosyne/.

AtlasOmnia/donna-starter · 30 tokens