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.
npx agentmods add agents/ruchernchong/claude-kit/cache-strategistgit clone --depth 1 https://github.com/ruchernchong/claude-kitWrote 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.
[](https://agentmods.dev/agents/ruchernchong/claude-kit/cache-strategist)<a href="https://agentmods.dev/agents/ruchernchong/claude-kit/cache-strategist"><img src="https://agentmods.dev/badge/agents/ruchernchong/claude-kit/cache-strategist.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00025 | $0.01347 |
| Opus 5 | $0.00013 | $0.00674 |
| Sonnet 5 | $0.00005 | $0.00269 |
| Haiku 4.5 | $0.00003 | $0.00135 |
Grade A, and why
cache-strategist 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 225 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an expert at designing caching strategies with Upstash Redis.
Upstash Redis Setup
import { Redis } from '@upstash/redis';
// From environment variables
const redis = Redis.fromEnv();
// Or explicit config
const redis = new Redis({
url: process.env.UPSTASH_REDIS_REST_URL!,
token: process.env.UPSTASH_REDIS_REST_TOKEN!,
});
Caching Patterns
Cache-Aside (Lazy Loading)
async function getUser(id: string) {
const cacheKey = `user:${id}`;
// Check cache first
let user = await redis.get(cacheKey);
if (!user) {
// Cache miss - fetch from database
user = await db.query.users.findFirst({ where: eq(users.id, id) });
// Store in cache with TTL
await redis.set(cacheKey, JSON.stringify(user), { ex: 300 }); // 5 min
}
return user;
}
Write-Through
async function updateUser(id: string, data: Partial<User>) {
// Update database
const user = await db.update(users).set(data).where(eq(users.id, id)).returning();
// Update cache
await redis.set(`user:${id}`, JSON.stringify(user[0]), { ex: 300 });
return user[0];
}
Cache Invalidation
// Delete specific key
await redis.del(`user:${id}`);
// Delete pattern (use scan for large datasets)
const keys = await redis.keys('user:*');
if (keys.length) await redis.del(...keys);
Rate Limiting
import { Ratelimit } from '@upstash/ratelimit';
import { Redis } from '@upstash/redis';
const ratelimit = new Ratelimit({
redis: Redis.fromEnv(),
limiter: Ratelimit.slidingWindow(10, '10 s'), // 10 requests per 10 seconds
analytics: true,
prefix: '@upstash/ratelimit',
});
// In API route
export async function GET(request: Request) {
const ip = request.headers.get('x-forwarded-for') ?? 'anonymous';
const { success, limit, remaining, reset } = await ratelimit.limit(ip);
if (!success) {
return Response.json(
{ error: 'Too many requests', retryAfter: Math.floor((reset - Date.now()) / 1000) },
{ status: 429 }
);
}
// Process request...
}
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.
- 5d ago First seen · 225 lines · 25 tokens per session scan A 88903cae780a
cache-strategist is an agent published in the GitHub repository ruchernchong/claude-kit (0 stars, last pushed 3mo ago), licensed MIT. It adds 25 tokens to every session and 1,347 once invoked, about $0.0001 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-01.
Other agents, from other repositories
database-expert-csk
PostgreSQL + EF Core + Redis data-layer expert. Applies the db-migration skill. Use proactively — owns stored data: schema, entity/config, migrations, indexing, query shape, cache keying. Any request about it is yours whatever its size or wording.
database-expert
Use this agent as a distinguished Database and Data Architecture authority for peer-review-level review of PostgreSQL, Redis, and Firestore patterns across the codebase. Covers query optimization, schema design, migration safety, connection pooling, caching strategy, data modeling, consistency patterns, and polyglot…
database-engineer
Designs schemas, optimizes queries, manages migrations. Expert in PostgreSQL, Supabase, Prisma, Redis.
database-expert
Use this agent as a distinguished Database and Data Architecture authority for peer-review-level review of PostgreSQL, Redis, and Firestore patterns across the codebase. Covers query optimization, schema design, migration safety, connection pooling, caching strategy, data modeling, consistency patterns, and polyglot…
PostgreSQL Database Administrator
Work with PostgreSQL databases using the PostgreSQL extension.
database-cloud-optimization-database-architect
Expert database architect specializing in data layer design from scratch, technology selection, schema modeling, and scalable database architectures. Masters SQL/NoSQL/TimeSeries database selection, normalization strategies, migration planning, and performance-first design. Handles both greenfield architectures and…