
Redis Cache Inspector
FreeEffortlessly inspect Redis cache states for debugging.
Free · Opens the source repo
What Redis Cache Inspector does
Redis Cache Inspector is a command-line tool designed for developers and system administrators to inspect the state of Redis caches. It allows users to query both the main and system caches, facilitating the debugging of cache-related issues. By utilizing a series of commands, users can retrieve key-value pairs, check the time-to-live (TTL) of keys, and monitor the overall state of the cache. This tool is particularly useful for applications that rely heavily on caching mechanisms, where understanding the cache state is crucial for performance and reliability.
The skill operates in a read-only mode by default, ensuring that users can safely inspect cache contents without the risk of accidental modifications. However, it also provides an option for write operations, such as deleting keys, which requires explicit permission from the user. This flexibility makes it a powerful tool for both casual inspections and more in-depth debugging sessions. The commands available include getting values, checking key types, and retrieving server information, making it comprehensive for cache management.
Redis Cache Inspector is ideal for developers working with applications that utilize Redis for caching. It is particularly beneficial in scenarios where cache issues arise, such as stale data or unexpected cache misses. By providing a straightforward interface to interact with Redis, users can quickly diagnose problems and optimize their caching strategies. Whether you are managing user sessions or system configurations, this tool aids in maintaining a healthy cache state.
In summary, Redis Cache Inspector is an essential utility for anyone working with Redis. Its ability to inspect and monitor cache states helps ensure that applications run smoothly and efficiently, making it a valuable addition to any developer's toolkit.
When to use it
Use this tool when you need to inspect or debug Redis cache states and values.
When not to use it
This skill is not suitable for scenarios where you need to perform extensive write operations without user approval.
What you can build with it
Debugging Cache Issues
Use the skill to check the TTL of keys and identify stale data that may be causing issues.
Monitoring Cache State
Regularly inspect the cache state to ensure that critical data is being cached correctly.
Verifying Key Existence
Quickly check if specific keys exist in the cache, aiding in the debugging process.
How to install Redis Cache Inspector
View source1. Install with the skills CLI
npx skills add civitai/civitai/redis-inspect --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by civitaiRedis Cache Inspector
Use this skill to inspect Redis cache state for debugging purposes.
Running Commands
node .claude/skills/redis-inspect/query.mjs <command> [options]
Commands
| Command | Description |
|---|---|
get <key> | Get a string value |
keys <pattern> | Find keys matching pattern (use * as wildcard) |
ttl <key> | Get TTL (-1 = no expiry, -2 = not found) |
type <key> | Get the type of a key |
exists <key> | Check if key exists |
hgetall <key> | Get all fields from a hash |
hget <key> <field> | Get a specific hash field |
scard <key> | Get set cardinality (count) |
smembers <key> | Get all set members |
llen <key> | Get list length |
lrange <key> | Get list elements |
del <key> | Delete a key (requires --writable) |
info | Get Redis server info |
Options
| Flag | Description |
|---|---|
--sys | Use system cache instead of main cache |
--writable | Allow write operations (required for del) |
--json | Output raw JSON |
--limit <n> | Limit results (default: 100) |
Cache Types
The project has two Redis instances:
| Cache | Flag | Env Variable | Purpose |
|---|---|---|---|
| Main Cache | (default) | REDIS_URL | Regular cache, cluster mode, can be lost |
| System Cache | --sys | REDIS_SYS_URL | Persistent system values, single node |
Main Cache (default)
Regular application cache. Data here can be regenerated if lost.
- User sessions
- Cached queries
- Temporary data
- Rate limiting counters
System Cache (--sys)
Persistent system configuration and state. More critical data.
- Feature flags
- Generation limits/status
- System permissions
- Job state
- Event configurations
Examples
# Find keys matching a pattern
node .claude/skills/redis-inspect/query.mjs keys "user:*" --limit 20
node .claude/skills/redis-inspect/query.mjs keys "packed:caches:*"
# Get a value
node .claude/skills/redis-inspect/query.mjs get "session:data2:123456"
# Check system cache values
node .claude/skills/redis-inspect/query.mjs --sys get "system:features"
node .claude/skills/redis-inspect/query.mjs --sys hgetall "system:entity-moderation"
# Check TTL
node .claude/skills/redis-inspect/query.mjs ttl "generation:count:123"
# Inspect a hash
node .claude/skills/redis-inspect/query.mjs hgetall "packed:caches:cosmetics"
node .claude/skills/redis-inspect/query.mjs hget "system:entity-moderation" "entities"
# Check set size
node .claude/skills/redis-inspect/query.mjs scard "queues:seen-images"
# Get server info
node .claude/skills/redis-inspect/query.mjs info
node .claude/skills/redis-inspect/query.mjs --sys info
Common Key Patterns
Main Cache
| Pattern | Description |
|---|---|
user:* | User data |
session:* | Session data |
packed:caches:* | Packed/compressed cached data |
packed:user:* | Packed user cache |
generation:* | Generation-related cache |
tag:* | Tag cache |
System Cache
| Pattern | Description |
|---|---|
system:* | System configuration |
generation:* | Generation limits/status |
download:limits | Download limits |
job:* | Job state |
event:* | Event configurations |
new-order:* | New Order game state |
daily-challenge:* | Daily challenge config |
Debugging Tips
# Check if a user's session exists
node .claude/skills/redis-inspect/query.mjs keys "session:data2:*" --limit 10
# Check generation status
node .claude/skills/redis-inspect/query.mjs --sys get "generation:status"
# Check feature flags
node .claude/skills/redis-inspect/query.mjs --sys hgetall "system:features"
# Check cache memory usage
node .claude/skills/redis-inspect/query.mjs info
Write Operations
Write operations require --writable flag and user approval:
# Delete a specific key (requires approval)
node .claude/skills/redis-inspect/query.mjs del "some:key" --writable
IMPORTANT: Always ask the user for permission before using --writable.
Frequently asked questions about Redis Cache Inspector
Similar skills
ClickHouse Logs Queries
Efficiently manage Supabase logs with ClickHouse SQL.
EF Core D2 Database Diagram Generator
Visualize your EF Core models as D2 diagrams effortlessly.
Safe SQL Execution
Ensure secure SQL execution in Supabase applications.
Oracle to PostgreSQL Migration
Identify migration risks between Oracle and PostgreSQL.
SSMA Console
Streamline Oracle to SQL Server migrations with ease.
SQL Performance Optimization
Enhance SQL query efficiency across all databases.
