cache

cache is a skill for Claude Code, Codex from arbazkhan971/godmode. It costs 33 tokens per session (1,975 once invoked), scanned A, original, MIT.

Guidance for storing frequently requested data temporarily with systems such as Redis, Memcached, Varnish, and content-delivery networks.

In plain words
What is it for?
Use it to choose a cache layer, design cache reads and writes, set expiration times, plan invalidation, and investigate hot keys or cache stampedes.
Why use it?
It helps reduce repeated database work and improve response times while addressing stale data, cache misses, and traffic spikes.

Skill for Claude CodeCodex

Part of the godmode plugin — 43 skills, 1 command, 9 agents, 3 MCP servers shipped together

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.

agentmods
npx agentmods add skills/arbazkhan971/godmode/cache
Any agent
npx skills add arbazkhan971/godmode --skill cache
Clone the repo
git clone --depth 1 https://github.com/arbazkhan971/godmode

Made for: Claude Code, Codex.

Or install godmode, the plugin that ships this one along with the rest of its 43 skills, 1 command, 9 agents, 3 MCP servers.

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 cache

README.md
[![agentmods](https://agentmods.dev/badge/skills/arbazkhan971/godmode/cache.svg)](https://agentmods.dev/skills/arbazkhan971/godmode/cache)
Your own site
<a href="https://agentmods.dev/skills/arbazkhan971/godmode/cache"><img src="https://agentmods.dev/badge/skills/arbazkhan971/godmode/cache.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,975 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00033 $0.01975
Opus 5 $0.00016 $0.00988
Sonnet 5 $0.00007 $0.00395
Haiku 4.5 $0.00003 $0.00198

Measured 3d ago against content hash 2427691aba6c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cache 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 3d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s http://localhost:8080/cache/stats
skills/cache/SKILL.md · 205 lines

How it starts

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

Cache -- Caching Strategy

Activate When

  • User invokes /godmode:cache
  • User says "add caching", "cache invalidation", "stale data", "cache consistency"
  • User says "Redis setup", "Memcached config", "CDN configuration"
  • User says "cache stampede", "thundering herd", "hot key"
  • When /godmode:perf identifies slow queries or high latency

Workflow

Step 1: Cache Opportunity Assessment

CACHE ASSESSMENT:
Project: <name>
Current Caching: None | CDN only | App-level | Multi-layer
Performance Baseline: P50/P95 latency, Database QPS, Cache hit rate
HOT PATH ANALYSIS: Endpoint, QPS, Latency, Cacheable (Y/N), TTL
IMPACT ESTIMATE: Hit rate, latency reduction, DB load reduction

Step 2: Cache Layer Design

Multi-layer architecture: CDN/Edge -> Application (Redis/Memcached) -> DB Query Cache -> Source of Truth (Database).

Cache-Aside Pattern (Default):

  • Read: check cache -> HIT: return | MISS: query DB, store in cache with TTL, return
  • Write: write to DB, then delete cache key (not update). Next read repopulates.
  • Use when: read-heavy (10:1+), brief staleness OK. Start here.

Step 3: Cache Invalidation Strategies

TTL-Based: TTL = max acceptable staleness. Static config: 24h. Product catalog: 10m. Search results: 1m. Real-time pricing: 10s. Always set a TTL.

Event-Based: On data change, publish event -> consumer deletes cache keys + purges CDN. Near-real-time, precise.

Write-Through: Write to cache AND DB synchronously. Always consistent. Higher write latency.

Write-Behind: Write to cache immediately, async flush to DB. Fast writes. Risk of data loss.

Default recommendation: Cache-aside + TTL + event-based invalidation.

Step 4: Redis Configuration

  • Deployment: Standalone (dev), Sentinel (simple HA), Cluster (large/high throughput)
  • Memory policy: allkeys-lru (recommended). Set maxmemory.
  • Connection pooling: pool_size 20, min_idle 5, connect_timeout 3s, command_timeout 1s
  • Key naming: {entity}:{id}, {entity}:{id}:{field}, {entity}:list:{filter}
  • All keys MUST have a TTL — use SETEX or SET with EX option

Read the full file on GitHub · 205 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. 3d ago First seen · 205 lines · 33 tokens per session scan A 2427691aba6c

Subscribe to this mod's changes

cache is a skill published in the GitHub repository arbazkhan971/godmode (26 stars, last pushed 5d ago), licensed MIT. It adds 33 tokens to every session and 1,975 once invoked, about $0.0002 per session on Opus 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

ena-database

Access European Nucleotide Archive via API/FTP. Retrieve DNA/RNA sequences, raw reads (FASTQ), genome assemblies by accession, for genomics and bioinformatics pipelines. Supports multiple formats.

foryourhealth111-pixel/Vibe-Skills · 43 tokens

ddia-systems

Design data systems by understanding storage engines, replication, partitioning, transactions, and consistency models. Use when the user mentions "database choice", "which database should I use", "SQL or NoSQL", "replication lag", "partitioning strategy", "consistency vs availability", "stream processing", "ACID…

wondelai/skills · 138 tokens

055-design-parallel-change

Use when a database schema or data-meaning change needs Parallel Change, including expand, migrate, and contract sequencing for column renames, type or data reinterpretation, large-table backfills, relationship-table changes, enum/status transitions, timezone/default changes, and index or uniqueness changes. This…

jabrena/plinth · 94 tokens

managed-db-services

Configure DigitalOcean Managed MySQL, MongoDB, Valkey, Kafka, and OpenSearch for App Platform. Use when setting up non-PostgreSQL databases, configuring trusted sources, or troubleshooting database connectivity.

digitalocean-labs/do-app-platform-skills · 46 tokens

postgres

Configure DigitalOcean Managed Postgres with bindable variables or schema isolation. Use when setting up databases, creating users, managing permissions, configuring multi-tenant schemas, or troubleshooting database connectivity on App Platform.

digitalocean-labs/do-app-platform-skills · 42 tokens

mongo-migration

MongoDB schema migration safety reviewer and migration script generator. ALWAYS use when writing, reviewing, or planning MongoDB schema changes — field additions/removals, index builds, schema validator changes, document type migrations, shard key modifications, or any bulk update touching production collections.…

johnqtcg/awesome-skills · 140 tokens