Skip to content
redis avatar

Redis Clustering

Guidance for designing Redis Cluster keys and routing reads to replicas, avoiding CROSSSLOT errors and primary overload.

CCM score
76 of 100
skills.sh installs
2.1K
GitHub stars
176
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers hash tags for multi-key operations, so keys that must share a slot land on the same shard
  • Includes Python examples for MGET-style pipelines, transactions, and read_from_replicas=True client setup
  • Enforces the rule of tagging only entities that need multi-key operations, since blanket tagging creates hotspots
  • Designed for cache layers, analytics, and dashboards where eventually consistent replica reads are acceptable

Install

$ npx -y skills add redis/agent-skills --skill redis-clustering -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Redis Clustering

Guidance for designing keys and routing reads in a sharded Redis Cluster (and in standalone primary/replica replication). Covers the two failure modes that bite most new cluster users: CROSSSLOT errors on multi-key operations, and overloading primaries with read traffic.

When to apply

  • Designing keys for a Redis Cluster deployment.
  • Debugging a CROSSSLOT error on MGET, SDIFF, transactions, or pipelines.
  • Implementing transactions / Lua scripts that touch multiple keys.
  • Scaling out read traffic without adding shards.

1. Hash tags for multi-key operations

Redis Cluster distributes keys across 16,384 slots by hashing the key name. Any command that touches multiple keys (MGET, SDIFF, SUNIONSTORE, transactions, pipelines, Lua scripts with multiple KEYS[]) requires all keys to live on the same slot — otherwise the server returns a CROSSSLOT error.

Hash tags force this: the part between { and } is the only thing hashed for slot assignment, so two keys sharing a hash tag always land together.

Details

Repository
github.com/redis/agent-skills
Categories
Databases, Backend & APIs
First seen
Jul 14, 2026

Questions

What does the redis-clustering skill help with?

It guides key design for a sharded Redis Cluster, including hash tags so multi-key operations like MGET, SDIFF and pipelines avoid CROSSSLOT errors. It also covers routing read traffic to replicas for caches, analytics and dashboards.

How do I install the redis-clustering skill?

Run npx -y skills add redis/agent-skills --skill redis-clustering -y in your project. Once installed, the agent can use the skill when designing keys or debugging cluster errors.

When should I use hash tags in Redis Cluster?

Use hash tags like {user:1001} on keys that must be grouped for multi-key commands, transactions or Lua scripts on the same slot. Tag only entities that need multi-key operations, because tagging everything creates hotspots.

Can I read from Redis replicas safely?

Replicas are eventually consistent, so this skill suggests reading from them only for cache layers, analytics, dashboards and recommendation feeds. Avoid replica reads for data that needs strict freshness, such as financial balances.

Which skills are in the same category as redis-clustering?

It sits in the Databases category on Claude Marketplaces, alongside supabase-postgres-best-practices and several Prisma skills. This skill focuses on Redis key layout and replica routing for sharded clusters.

More from redis/agent-skills

All 6

Similar to Redis Clustering

More Databases