caching

caching is a skill for Claude Code from proyecto26/system-design-skills. It costs 111 tokens per session (2,376 once invoked), scanned A, original, MIT.

A guide for designing caching strategies, where frequently used data is kept in a faster temporary store so requests can avoid slower work.

In plain words
What is it for?
Use it to choose what to cache, compare read-through, write-through, and write-back approaches, select Redis or Memcached, and plan TTL, LRU, or LFU eviction.
Why use it?
It helps decide when caching is worthwhile and how to handle stale data, cache misses, eviction, cache stampedes, and overloaded popular keys.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the system-design-skills plugin — 22 skills, 1 command, 1 agent shipped together

Good fit Use it to choose what to cache, compare read-through, write-through, and write-back approaches, select Redis or Memcached, and plan TTL, LRU, or LFU eviction.

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

Made for: Claude Code.

Or install system-design-skills, the plugin that ships this one along with the rest of its 22 skills, 1 command, 1 agent.

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/proyecto26/system-design-skills/caching.svg)](https://agentmods.dev/skills/proyecto26/system-design-skills/caching)
Your own site
<a href="https://agentmods.dev/skills/proyecto26/system-design-skills/caching"><img src="https://agentmods.dev/badge/skills/proyecto26/system-design-skills/caching.svg" alt="Measured on agentmods" height="20"></a>
Per session 111 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,376 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.
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.00111 $0.02376
Opus 5 $0.00056 $0.01188
Sonnet 5 $0.00022 $0.00475
Haiku 4.5 $0.00011 $0.00238

Measured 8d ago against content hash 8a61154831c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, 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 8d 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/caching/SKILL.md · 157 lines

How it starts

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

Caching

Put a copy of hot data closer to the reader so most requests skip the slow path. Caching is the highest-leverage move for read-heavy systems — and the easiest to get subtly wrong, because a cache adds a second source of truth that can serve stale or wrong data, and can amplify an outage when it misbehaves.

When to reach for this

Reads dominate (a high read:write ratio from back-of-the-envelope); the same data is read repeatedly; the datastore is the read bottleneck; or recomputation is expensive. A cache buys read latency and offloads the origin.

When NOT to

Write-heavy or read-once data (low hit rate — pure overhead). Data that must be exactly current with zero staleness (a cache is a stale copy by nature; when strict freshness is required, go to the source or use consistency-coordination). Don't add a cache before a number shows reads are the problem (YAGNI) — it's a new failure mode and a second thing to operate.

Clarify first

  • Read:write ratio and hit rate — is the working set cacheable? (→ back-of-the-envelope, 80/20.)
  • Staleness tolerance — seconds? minutes? must reads see their own writes?
  • Working-set size — does the hot set fit in RAM across cache nodes?
  • Consistency on write — can the cache briefly disagree with the store?
  • Eviction trigger — what's the access pattern (recency? frequency? time-bound?).

The options

Where to cache (often layered): client/browser → CDN edge (→ content-delivery) → application/in-process → distributed cache (Redis/Memcached) → database buffer pool. This skill focuses on the application and distributed layers.

Read strategy

  • Cache-aside (lazy): app checks cache, on miss reads the store and populates. Use when reads are unpredictable; the default for most systems.
  • Read-through: the cache library fetches from the store on miss. Use to keep app code simple and caching policy centralized.

Write strategy

  • Write-through: write cache and store synchronously. Use when reads right after writes must be fresh and slower writes are acceptable.
  • Write-back (write-behind): write cache now, flush to store async. Use for write-heavy/bursty paths that tolerate a small loss window.
  • Write-around: write only the store; let the cache fill on read. Use when written data is rarely re-read soon (avoids cache churn).

Read the full file on GitHub · 157 lines

Files

What ships with it

5 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. 8d ago First seen · 157 lines · 111 tokens per session scan A 8a61154831c9

Subscribe to this mod's changes

caching is a skill published in the GitHub repository proyecto26/system-design-skills (69 stars, last pushed 3mo ago), licensed MIT. It adds 111 tokens to every session and 2,376 once invoked, about $0.0006 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

data-migration

Moves data from one system to another without losing it or corrupting it — profiling the source before mapping, deciding between big-bang and parallel-run cutover, reconciling counts and values rather than assuming, handling the records that will not map cleanly, and planning a rollback that is actually executable.…

cbrock84/headcount · 102 tokens

data-modeling

Designs the warehouse and semantic layer — source-to-mart structure, dimensional modeling, grain, slowly changing dimensions, and the metric layer analytics reads through. Use this to design or restructure a warehouse, model a new source, decide on grain or table structure, build a semantic or metric layer, or…

cbrock84/headcount · 77 tokens

ts-db-perf

Optimize TypeScript code that interacts with databases. Use this skill when the user wants to fix N+1 queries, add caching, improve transaction safety, prevent race conditions, simplify async flows, or generally speed up a TypeScript backend. Triggers on phrases like "optimize", "slow query", "N+1", "race condition"…

widnyana/eyay-toolkits · 107 tokens

swiftdata-workflow

Design, implement, migrate, test, and integrate SwiftData persistence in Apple apps using current Apple documentation. Use for @Model schemas, ModelContainer and ModelContext ownership, @Query integration, relationships, uniqueness, deletion, concurrency, migrations, preview or test stores, and boundaries between…

gaelic-ghost/socket · 74 tokens

schema-designer

Database schema design agent that creates complete data models with tables, relationships, indexes, and seed data. Triggers on: database design, schema, data model, tables, ERD, entity relationship, database schema.

batterfried-philosophy172/Agent-Startup-Skills · 47 tokens

postgres

Use this skill for any PostgreSQL database work — table design, indexing, data types, constraints, extensions (pgvector, PostGIS, TimescaleDB), search, and migrations. Trigger when user asks to: Design or modify PostgreSQL tables, schemas, or data models Choose data types, constraints, indexes, or partitioning…

timescale/pg-aiguide · 197 tokens