redis-patterns

redis-patterns is a skill for Claude Code from RaNDoM6913/claude-code-superkit. It costs 61 tokens per session (1,987 once invoked), scanned A, original, MIT.

A collection of Redis patterns for using Redis as a fast data store in Node.js or Python applications. Redis can handle caching, sessions, messaging, work queues, and coordination between processes.

In plain words
What is it for?
Use it to add caches, user sessions, publish-and-subscribe messaging, background work queues, rate limiting, or distributed locks.
Why use it?
It helps choose suitable Redis data structures and avoid common issues with key naming, expiration times, locking, errors, and shutdown handling.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: mentions Codex.

Good fit Use it to add caches, user sessions, publish-and-subscribe messaging, background work queues, rate limiting, or distributed locks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/random6913/claude-code-superkit/redis-patterns
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 RaNDoM6913/claude-code-superkit --skill redis-patterns
Clone the repo
git clone --depth 1 https://github.com/RaNDoM6913/claude-code-superkit

Made for: Claude Code.

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-patterns

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/random6913/claude-code-superkit/redis-patterns"><img src="https://agentmods.dev/badge/skills/random6913/claude-code-superkit/redis-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,987 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.00061 $0.01987
Opus 5.5 $0.00024 $0.00795
Sonnet 5.5 $0.00012 $0.00397
Haiku 4.5 $0.00006 $0.00199

Measured 1mo ago against content hash 65f060aa7f14, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

redis-patterns 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 1mo 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.

packages/codex/skills/redis-patterns/SKILL.md · 261 lines

How it starts

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

Redis Patterns

Production patterns for Redis as a cache, session store, pub/sub bus, work queue backbone, and distributed coordination primitive.

Use this skill when

  • Implementing caching (cache-aside, write-through, write-back)
  • Setting up pub/sub or BLPOP-based work queues
  • Using Redis data structures (Sorted Sets, Streams, Hash, Sets)
  • Configuring ioredis for Node.js production
  • Designing key naming and TTL strategies
  • Implementing distributed locks with atomic SET NX EX

Do not use this skill when

  • The task requires a message broker with guaranteed delivery — use BullMQ, RabbitMQ, or Kafka
  • The task is about Redis server-level configuration / cluster setup

Workflow

  1. Identify the use case: caching, pub/sub, queue, session, or rate limiting
  2. Choose the right data structure for the access pattern
  3. Design keys with namespace:entity:id convention
  4. Set TTL on every key (unless intentionally persistent: queues, locks-with-expiry)
  5. Validate error handling and graceful shutdown
import Redis from 'ioredis';

export const redis = new Redis({
  host: process.env.REDIS_HOST,
  port: 6379,
  lazyConnect: true,
  connectionName: 'api-server',
  retryStrategy(times) {
    return Math.min(times * 200, 2000);
  },
});

redis.on('error', (err) => logger.error({ err }, 'redis'));
redis.on('ready', () => logger.info('redis ready'));
  • Singleton client; lazyConnect defers connection until first command
  • retryStrategy for exponential backoff
  • Separate dedicated subscriber connection for pub/sub (can't mix with commands)
  • BullMQ: maxRetriesPerRequest: null is mandatory

Cache-Aside Pattern

async function getUser(id: string): Promise<User> {
  const key = `cache:user:${id}`;
  const cached = await redis.get(key);
  if (cached) return JSON.parse(cached);

  const user = await db.users.findUnique({ where: { id } });
  if (user) await redis.set(key, JSON.stringify(user), 'EX', 300);
  return user;
}

async function invalidateUser(id: string) {
  await redis.del(`cache:user:${id}`);
}

Read the full file on GitHub · 261 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. 1mo ago First seen · 261 lines · 61 tokens per session scan A 65f060aa7f14

Subscribe to this mod's changes

redis-patterns is a skill published in the GitHub repository RaNDoM6913/claude-code-superkit (3 stars, last pushed 8d ago), licensed MIT. It adds 61 tokens to every session and 1,987 once invoked, about $0.0002 per session on Opus 5.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-09-03.

Related

Other skills, from other repositories

spring-cache

Spring Cache abstraction for Spring Boot 3.x. Covers @Cacheable, @CacheEvict, @CachePut, cache managers (Caffeine, Redis, EhCache), TTL configuration, cache keys, conditional caching, and cache synchronization. USE WHEN: user mentions "spring cache", "@Cacheable", "@CacheEvict", "cache manager", "Caffeine cache"…

claude-dev-suite/claude-dev-suite · 114 tokens

caching-strategies

Application caching patterns. Redis caching, in-memory caches, HTTP caching, cache invalidation strategies, cache-aside, write-through, and CDN caching. USE WHEN: user mentions "caching", "cache invalidation", "Redis cache", "HTTP cache", "CDN caching", "cache-aside", "write-through", "TTL", "stale-while-revalidate"…

claude-dev-suite/claude-dev-suite · 111 tokens

bullmq-specialist

BullMQ expert for Redis-backed job queues, background processing, and reliable async execution in Node.js/TypeScript applications. Use when: bullmq, bull queue, redis queue, background job, job queue.

agent-skills-hub/agent-skills-hub · 47 tokens

redis-caching-and-pubsub

Architecting high-performance caching strategies, Cache-Aside/Write-Through/Write-Behind patterns, Redis Pub/Sub, Streams, eviction policies, distributed locking (Redlock), and memory optimization. Use when implementing Redis caching, real-time messaging, rate limiting, or session management.

hamzabellouch/agent-skills · 64 tokens

caching-strategy

Stratégie de cache adaptée à chaque cas d'usage (Redis, Memcached, in-memory, CDN) — quoi cacher, durée de vie, invalidation et cohérence. Se déclenche avec "cache", "Redis", "caching", "mise en cache", "cache invalidation", "CDN", "distributed cache", "réduire les appels à la base". Also triggers on "caching…

khalilbenaz/claude-skills-collection · 103 tokens

redis-patterns

Patterns d'utilisation Redis pour le cache, pub/sub, streams et sessions. Se déclenche avec "Redis", "cache distribué", "pub/sub Redis", "Redis streams", "session store. Also triggers on "Redis cache", "Redis pub/sub".

khalilbenaz/claude-skills-collection · 56 tokens