caching-redis

caching-redis is a cursor rule for Claude Code, Cursor from eliornl/rolemule. It costs 2,319 tokens per session, scanned A, original, MIT.

Redis caching patterns for storing temporary results and controlling how long they remain available. Redis is a fast data store often used for caches and request limits.

In plain words
What is it for?
Use them for caching job analysis, company research, user profiles, workflow state, language-model responses, interview preparation, outreach, and CV optimization. They also cover rate limiting with response headers.
Why use it?
They provide consistent cache keys, expiry times, and versioning so old cached data can be cleared safely. They also define a lock pattern to prevent duplicate work.

Cursor rule for Claude CodeCursor

Written for Claude Code and Cursor: installed under .claude/, but also a Cursor rule (.mdc).

Good fit Use them for caching job analysis, company research, user profiles, workflow state, language-model responses, interview preparation, outreach, and CV optimization. They also cover rate limiting with response headers.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/eliornl/rolemule/caching-redis
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.

Clone the repo
git clone --depth 1 https://github.com/eliornl/rolemule

Made for: Claude Code, Cursor.

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

README.md
[![agentmods](https://agentmods.dev/badge/rules/eliornl/rolemule/caching-redis/github.svg)](https://agentmods.dev/rules/eliornl/rolemule/caching-redis)
Your own site
<a href="https://agentmods.dev/rules/eliornl/rolemule/caching-redis"><img src="https://agentmods.dev/badge/rules/eliornl/rolemule/caching-redis/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 caching-redis

Your own site · 80×15
<a href="https://agentmods.dev/rules/eliornl/rolemule/caching-redis"><img src="https://agentmods.dev/badge/rules/eliornl/rolemule/caching-redis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,319 This file is loaded in full into every session.
When invoked 2,319 The same file — it is already loaded in full.
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.02319 $0.02319
Opus 5.5 $0.00928 $0.00928
Sonnet 5.5 $0.00464 $0.00464
Haiku 4.5 $0.00232 $0.00232

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

Security

Grade A, and why

caching-redis 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 3mo 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.

.claude/rules/caching-redis.mdc · 185 lines

How it starts

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

Caching & Rate Limiting Patterns

Cache Schema Version

All keys are prefixed with CACHE_VERSION (currently v1). Bump CACHE_VERSION in utils/cache.py to instantly flush all caches on deploy — old keys expire via TTL.

Cache TTLs and Key Patterns

Cache TTL Key pattern
Job analysis 24h v1:job_analysis:{hash} — hash includes URL + up to 50,000 chars of normalized job text (_MAX_JOB_CONTENT_FOR_CACHE_KEY in utils/cache.py) so different listings on the same long page do not share one cache entry
Company research 7d v1:company_research:{hash}:{name}
User profile 5min v1:user_profile:{uuid}
Workflow state 1min v1:workflow_state:{session_id}
LLM response 1h v1:llm_response:{user_id}:{hash} (user-scoped) or v1:llm_response:{hash} (shared)
Interview prep 7d v1:interview_prep:{session_id}
Hiring outreach 7d v1:hiring_outreach:{session_id}
Hiring outreach generating 10min v1:hiring_outreach_generating:{session_id} — atomic SET NX lock
CV optimization result 24h v1:cv_optimization:{session_id} — get_cached_cv_optimization() unwraps cache_set {"data": ...} wrapper
CV optimization running 30min v1:cv_optimization_running:{session_id} — atomic SET NX lock
Mock interview thinking 3min v1:mock_interview_thinking:{session_id} — atomic SET NX turn lock
Tool result 1h v1:tool_result:{tool_name}:{hash}

Auth-Specific Redis Keys (managed by api/auth.py and utils/auth.py)

These keys are not versioned with CACHE_VERSION — do not flush them as part of cache invalidation.

Purpose TTL Key pattern
JWT revocation blocklist Remaining token lifetime + 60 s jwt_blocklist:{jti}
OAuth CSRF state 10 min oauth_state:{state_token}
OAuth one-time exchange code 30 s oauth_code:{code}
Password reset token 1 h password_reset:{token}
Email verification code 15 min email_verification:{code}
Email verification current-code pointer 15 min email_verification_user:{email}

Read the full file on GitHub · 185 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. 3mo ago First seen · 185 lines · 2,319 tokens per session scan A fc9e71af6529

Subscribe to this mod's changes

caching-redis is a cursor rule published in the GitHub repository eliornl/rolemule (39 stars, last pushed today), licensed MIT. It adds 2,319 tokens to every session, about $0.0093 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-08-30.

Related

caching-redis compared with cursor rules from other repositories

caching-redis next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
caching-rediseliornl/rolemuleCursor rule39todayMITA2,319Claude Code, Cursor
redis-cache-onlyAlphaBitCore/nexus-gatewayCursor rule252mo agoApache-2.0A0Cursor
redis_rate_limitingjondoescoding/jondoescoding-coding-rulesCursor rule24mo agoMITA15Cursor
nosql-specialist-intelligentshahshrey/cursor-hubCursor rule1519d agononeA150Cursor
nestjs-6-database-performancetekdi/ai-skills-rulesCursor rule22mo agononeA0Cursor
supabase-safetyjustinz12xd/HACKATON-TAWSCursor rule24mo agononeA0Cursor
ponytailDietrichGebert/ponytailCursor rule201k8d agoMITA604Cursor