/redis:redisfrom redis
Designs and reviews Redis and Valkey usage: data structures, cache-aside and write-through caching, TTL and key design, eviction policy, SCAN over KEYS, stampede control, rate limits, token-checked locks, Streams vs Pub/Sub, and connections. Use when adding or reviewing caching, rate limiting, a lock, a queue, or sessions on Redis.
Ships in redis. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Not for relational stores (postgres, mysql, if installed) or an auth library's secondary-storage settings.
Choose and review Redis usage from what the data is, how long it may be stale, and what loss it can survive. Redis is fast and simple, so its failure modes are quiet: unbounded memory, stale data, and locks or queues that fail under failover.
Check the facts of the target before designing. Redis and Valkey are compatible for the commands below, but versions differ. Confirm with INFO server, and check the command's "since" version in the docs (for example EXPIRE ... NX needs 7.0). Also confirm whether it is managed, clustered, replicated, and persisted (RDB, AOF, or neither). Ask what happens to the application when the instance is empty.
INFO, TTL, TYPE, MEMORY USAGE, SCAN with COUNT, SLOWLOG GET, CONFIG GET.FLUSHALL, FLUSHDB, CONFIG SET, CONFIG REWRITE, DEBUG, SHUTDOWN, MONITOR, KEYS * (or any KEYS pattern), and pattern deletes (SCAN piped into DEL). They destroy data, change the running server, or block it. MONITOR also streams every command with its keys and values, so never paste its output.| Use | Structure |
|---|---|
| Cached value | String (serialized value) |
| Session or object with fields | Hash |
| Counter or rate limit | String with INCR |
| Leaderboard, sliding window | Sorted set |
| Unique members | Set |
| Approximate distinct count | HyperLogLog |
| Durable work or event log | Stream |
namespace:resource:id, and put the app or environment first on shared instances.KEYS in application code. It is O(N) and blocks the server, and the docs say to reserve it for debugging. Iterate with SCAN, which can return a key more than once, so make the work idempotent.{user:42}:profile) deliberately.Set maxmemory and a maxmemory-policy that match the data.
| Policy | Behavior | Fits |
|---|---|---|
noeviction | Writes fail when memory is full | Queues, locks, anything that must not vanish. Alert before it fills |
allkeys-lru | Evicts least recently used keys | A pure cache |
volatile-lru | Evicts only keys that have a TTL | A mix where keys without TTL must stay |
allkeys-lfu | Evicts least frequently used keys | Skewed access patterns |
volatile-ttl | Evicts keys closest to expiry | Preferring to keep long-lived keys |
A volatile-* policy with few TTL'd keys behaves like noeviction, so confirm that the keys you expect to evict carry a TTL. Redis 8.6 adds least-recently-modified policies (allkeys-lrm, volatile-lrm) that Valkey's config doesn't list, so check the eviction docs for the installed version.
SCAN and delete on a hot path.Read references/patterns.md for command-level recipes before writing any of these:
INCR breaks a limiter)Choose between the messaging options by delivery need. Pub/Sub is at-most-once. A message goes to current subscribers or is lost, and nothing is stored for late or crashed consumers. Use Streams when you need acknowledgement, consumer groups, or replay. Neither survives a total data loss unless persistence is configured.
maxclients across all application instances. Opening one per request wastes round trips.SMEMBERS, HGETALL, SORT, unbounded Lua) on a shared instance. One slow command blocks every other client. Use the slow log (SLOWLOG GET) to find them.Exercise the expiry, eviction, and failure paths, not only the hit path. Check that each key class has a TTL (TTL, or MEMORY USAGE on samples), that the eviction policy matches the data, and that behavior holds with Redis empty and unreachable.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub adminhead/claude-plugins --plugin redis