redis

redis is a skill for Claude Code, Codex from ericrisco/rsc-harness. It costs 111 tokens per session (4,645 once invoked), scanned A, original, MIT.

A guide to using Redis and compatible data stores for caching, distributed locks, rate limiting, and job queues. Redis is a fast shared data service often used by multiple application processes.

In plain words
What is it for?
Use it when designing or reviewing cache expiry and invalidation, worker locks, concurrent request limits, or reliable background job queues.
Why use it?
It helps prevent common concurrency failures, such as many requests rebuilding the same cache, releasing another worker's lock, exceeding rate limits, or losing queued jobs when a worker stops.

Skill for Claude CodeCodex

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

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/ericrisco/rsc-harness/redis
Any agent
npx skills add ericrisco/rsc-harness --skill redis
Clone the repo
git clone --depth 1 https://github.com/ericrisco/rsc-harness

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 redis

README.md
[![agentmods](https://agentmods.dev/badge/skills/ericrisco/rsc-harness/redis.svg)](https://agentmods.dev/skills/ericrisco/rsc-harness/redis)
Your own site
<a href="https://agentmods.dev/skills/ericrisco/rsc-harness/redis"><img src="https://agentmods.dev/badge/skills/ericrisco/rsc-harness/redis.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 4,645 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.1 $0.00111 $0.04645
Opus 5 $0.00056 $0.02322
Sonnet 5 $0.00022 $0.00929
Haiku 4.5 $0.00011 $0.00464

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

Security

Grade A, and why

redis 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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/verify.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

if val == nil: val = db.fetch(42); SET product:42 val EX 300 # absent rows still hammer the DB
skills/redis/SKILL.md · 299 lines

How it starts

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

Redis — cache, lock, rate limiter, queue done correctly

Redis is four primitives wearing one server: a cache, a distributed lock, a rate limiter, and a job queue. Each has a correctness contract that has nothing to do with whether SET returns OK. You almost certainly already "have Redis working" — a value goes in, a value comes out. What you do not yet have is a cache that won't stampede your database, a lock that won't release someone else's hold, a rate limiter that survives concurrent requests, and a queue whose jobs aren't silently lost when a worker dies. This skill is engine- and pattern-level, client-SDK-agnostic: examples are redis-cli and Lua, so they hold across node-redis, ioredis, redis-py, go-redis, and Lettuce. Every pattern applies unchanged to Valkey and any Redis-protocol store, since Valkey is a BSD fork of Redis 7.2 and stays protocol-compatible.

When to use / When NOT

Use when you are:

  • Adding or reviewing a cache: TTL strategy, cache-aside vs write-through, key naming, stampede/thundering-herd prevention, negative caching, invalidation.
  • Building a distributed lock: "only one worker does X", cron de-duplication, leader-ish mutual exclusion — the SET NX PX + Lua-release + fencing-token contract, and the Redlock call.
  • Building a rate limiter: per-user/IP/API-key throttling (fixed window, sliding-window log, sliding-window counter, token bucket) and why naive INCR+EXPIRE is a race.
  • Running a queue / background jobs on Redis: Lists vs Streams vs a library (BullMQ, Sidekiq, RQ, Celery), at-least-once delivery, acks, stalled-job recovery, idempotency.
  • Deciding eviction & persistence: maxmemory-policy, RDB vs AOF, cache mode vs database mode.
  • Reviewing Redis code for foot-guns: KEYS *, unbounded keys, non-atomic read-modify-write, missing TTL, a lock released by the wrong owner.

NOT for (route instead):

  • Durable SQL queue (SELECT … FOR UPDATE SKIP LOCKED), engine-level SQL caching → ../postgresdb/SKILL.md. Boundary: if the durable store is the queue, that's postgresdb; if Redis is the queue, you're here.
  • Vector similarity / semantic search as the primary job → ../vector-db/SKILL.md. Redis 8 vector sets are only noted here.
  • Analytical / clickstream event store → ../clickhouse-analytics/SKILL.md.
  • System-level capacity / load strategy, and app/CDN/HTTP-layer caching (Cache-Control, ISR, edge) → ../scaling/SKILL.md. This skill owns the Redis-specific data contract underneath.
  • Provisioning a managed Redis (cluster sizing, dashboards) → ../fly-io/SKILL.md / ../aws-essentials/SKILL.md. This skill gives the client-side contract, not console clicks.
  • Language-runtime async/job concepts unrelated to Redis → ../nodejs/SKILL.md or your language skill.

Read the full file on GitHub · 299 lines

Files

What ships with it

6 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. 3d ago First seen · 299 lines · 111 tokens per session scan A 39f62ff40c24

Subscribe to this mod's changes

redis is a skill published in the GitHub repository ericrisco/rsc-harness (65 stars, last pushed yesterday), licensed MIT. It adds 111 tokens to every session and 4,645 once invoked, about $0.0006 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-09-03.

Related

Other skills, from other repositories

redis-docs

Use this skill whenever the user asks about Redis, in-memory databases, caching, pub/sub, streams, vector search, or NoSQL. Covers Redis 8.x including all data types (strings, hashes, lists, sets, sorted sets, streams, JSON, geospatial, probabilistic, time series, vector sets), clustering, replication, sentinel…

pledgeandgrow/pledge-skills · 103 tokens

elasticache-usage-audit

Audits ElastiCache usage across an AWS account — inventories clusters by engine (Redis vs Valkey), node type (Graviton vs non-Graviton), Extended Support exposure, and optionally groups by a user-specified tag with per-group cost attribution. Surfaces modernization opportunities (Graviton migration at 20% savings…

shawnaws/ai-agent-skills · 154 tokens

redis-expert

Expert-level Redis for caching, pub/sub, data structures, and high-performance applications. Use when the user mentions cache, pub/sub, in-memory stores, key-value stores, or NoSQL, or when the task involves Data Structures, Basic Operations, Advanced Patterns, or Redis Streams.

personamanagmentlayer/pcl · 61 tokens

tucache-caching

Use this skill when writing or modifying Spring Boot application code that should use TuCache for method-result caching or cache invalidation with @TuCache and @TuCacheClear.

tri5m/tutu-cache · 43 tokens

redis

Skill "redis" from chaterm/terminal-skills, covering redis 数据库管理, 概述, 连接管理, 本地连接 and 远程连接.

chaterm/terminal-skills · 6 tokens

redis-master

Leverage Redis for caching, sessions, pub/sub, queues, rate limiting, and real-time features. Design Redis data structures for optimal performance.

AtulPurohit/Antigravity-Awesome-Skills · 32 tokens