redis-caching

redis-caching is a skill for Claude Code, Codex from hoangatg/ai-agent-toolkit. It costs 32 tokens per session (714 once invoked), scanned A, original, MIT.

A guide to using Redis, a fast in-memory data store, for caching, rate limiting, messaging, and user sessions.

In plain words
What is it for?
Use it when adding Redis to an application, choosing a caching pattern, designing keys and expiration times, or implementing rate limits and pub/sub features.
Why use it?
It helps applications retrieve frequently used data faster and handle shared counters, queues, and real-time messages in a consistent way.

Skill for Claude CodeCodex

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

Good fit Use it when adding Redis to an application, choosing a caching pattern, designing keys and expiration times, or implementing rate limits and pub/sub features.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/hoangatg/ai-agent-toolkit/redis-caching.svg)](https://agentmods.dev/skills/hoangatg/ai-agent-toolkit/redis-caching)
Your own site
<a href="https://agentmods.dev/skills/hoangatg/ai-agent-toolkit/redis-caching"><img src="https://agentmods.dev/badge/skills/hoangatg/ai-agent-toolkit/redis-caching.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 714 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.00032 $0.00714
Opus 5 $0.00016 $0.00357
Sonnet 5 $0.00006 $0.00143
Haiku 4.5 $0.00003 $0.00071

Measured 4d ago against content hash 8d05dd368acf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

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

.agent/skills/redis-caching/SKILL.md · 104 lines

How it starts

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

Redis Caching

The in-memory data structure store that makes everything faster.


1. Caching Strategies

Strategy How It Works Use Case
Cache-Aside App checks cache → miss → fetch DB → store cache General purpose
Write-Through Write to cache + DB simultaneously Consistency critical
Write-Behind Write to cache → async write to DB High write throughput
Read-Through Cache auto-fetches on miss Transparent caching

2. Data Structures

Structure Use Case
String Simple key-value, counters
Hash Object storage, user profiles
List Queues, timelines, logs
Set Unique collections, tags
Sorted Set Leaderboards, rate limiting
Stream Event sourcing, message queue
HyperLogLog Cardinality estimation

3. Key Design

Principle Example
Namespaced user:1234:profile
Hierarchical app:module:entity:id
Versioned v2:user:1234:cache
TTL always Every key should expire
Predictable Same input → same key

4. Common Patterns

Rate Limiting

Algorithm Method
Fixed window INCR + EXPIRE
Sliding window Sorted Set + timestamp
Token bucket Script-based atomic

Session Management

Principle Application
Store session data Hash per session ID
TTL Auto-expire inactive sessions
Secure ID Cryptographically random
Minimal data Only what's needed server-side

Pub/Sub & Streams

Feature Pub/Sub Streams
Persistence ❌ Fire-and-forget ✅ Persisted
Consumer groups
Replay
Best for Notifications Event processing

5. Performance

Technique Impact
Pipelining Batch multiple commands
Connection pooling Reuse connections
Lua scripts Atomic multi-step operations
Cluster Horizontal scaling
Memory policy allkeys-lru for cache nodes

Read the full file on GitHub · 104 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. 4d ago First seen · 104 lines · 32 tokens per session scan A 8d05dd368acf

Subscribe to this mod's changes

redis-caching is a skill published in the GitHub repository hoangatg/ai-agent-toolkit (1 stars, last pushed 5mo ago), licensed MIT. It adds 32 tokens to every session and 714 once invoked, about $0.0002 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-09-03.

Related

Other skills, from other repositories

clickhouse-io

ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.

deepelementlab/jupyter-studio · 26 tokens

database-migrations

Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and common ORMs (Prisma, Drizzle, Django, TypeORM, golang-migrate).

deepelementlab/jupyter-studio · 52 tokens

huawei-dds-dcs

Use when creating or managing Document Database Service (DDS/MongoDB-compatible) or Distributed Cache Service (DCS/Redis/Memcached) on Huawei Cloud. Triggers: DDS, DCS, MongoDB, Redis, Memcached, document DB, cache, replica set, sharding. NOT for: RDS (use huawei-rds), GaussDB (use huawei-gaussdb).

huaweicloud/huaweicloud-devkit · 89 tokens

azure-managed-redis

Expert knowledge for Azure Managed Redis development including troubleshooting, best practices, decision making, architecture & design patterns, security, configuration, integrations & coding patterns, and deployment. Use when using Redis SDKs, Entra ID auth, clustering/sharding, geo-replication, or ARM/Bicep…

MicrosoftDocs/Agent-Skills · 88 tokens

azure-cache-redis

Expert knowledge for Azure Cache for Redis development including troubleshooting, best practices, decision making, architecture & design patterns, security, configuration, and deployment. Use when configuring geo-replication, persistence, VNet/private endpoints, Entra/RBAC auth, or ARM/Bicep deployments, and other…

MicrosoftDocs/Agent-Skills · 103 tokens

data-architect

Use this agent for database schema design, data modeling, query optimization, normalization decisions, and database architecture.

samibs/skillfoundry · 25 tokens