cache-money
This skill should be used when the user asks to "keep cache warm", "warm the cache", "save tokens", "reduce token usage", "cache-money", "start cache ping", "optimize peak hours", "prevent cache expiry", or mentions Anthropic prompt caching, cache TTL, peak hour throttling, token cost optimization, or keeping the context cache alive in Claude Code sessions.
What this skill does
# Cache Money Keep the Anthropic prompt cache warm during Claude Code sessions — especially during peak hours when usage limits are tighter — by scheduling lightweight pings tuned to your cache TTL. ## Why This Matters Claude Code sends the full conversation context with every API call. Anthropic caches this prefix server-side and serves subsequent calls from cache at ~10% of the base input price. But the cache expires after a TTL period of inactivity: | TTL Tier | Duration | Cache Write Cost | Who Gets It | |----------|----------|-----------------|-------------| | **Default** | 5 minutes | 1.25x base input | All plans (no `ttl` field specified) | | **Extended** | 1 hour | 2x base input | Max-tier plans (server-side in Claude Code), or explicit `ttl: "1h"` via API | Cache reads cost **0.1x base input** regardless of TTL tier — that's the 90% saving. If a session sits idle past its TTL, the next call pays full cache-write price for the entire context — up to 1M tokens. During **peak hours** (weekdays 5:00 AM – 11:00 AM PT), Anthropic's rolling session limits are consumed faster, making every cache miss doubly expensive: higher rebuild cost plus faster quota burn. For detailed technical background, consult **`references/cache-mechanics.md`**. ## Workflow ### Step 1: Assess Timing Determine the current time and day of week in Pacific Time (PT) using: ```bash TZ=America/Los_Angeles date "+%A %H:%M PT" ``` Classify the current window: | Condition | Status | |-----------|--------| | Weekday, 5:00 AM – 11:00 AM PT | **Peak hours active** — cache warming strongly recommended | | Weekday, 4:47 AM – 4:59 AM PT | **Peak approaching** — pre-warming recommended | | Weekend or outside peak | **Off-peak** — cache warming optional, still saves on idle sessions longer than the TTL | Report the status to the user in one line before proceeding. ### Step 2: Detect Cache TTL Determine which TTL tier is active. Ask the user: > Are you on a **Max-tier plan** (which enables 1-hour cache TTL in Claude Code), or the **default** (5-minute cache TTL)? Use the answer to set the ping interval: | TTL Tier | Cache Duration | Ping Interval | Safety Margin | |----------|---------------|---------------|---------------| | **Extended (1h)** | 60 minutes | **55 minutes** | 5 minutes | | **Default (5min)** | 5 minutes | **4 minutes** | 1 minute | If the user is unsure, default to the **5-minute TTL** (4-minute ping interval) — it's safe for all plans and the overhead is minimal. ### Step 3: Start the Cache Ping Loop Invoke the `/loop` skill to schedule the recurring ping at the determined interval: **For 1-hour TTL (Max-tier):** ``` Skill tool: skill="loop", args="55m Cache ping. Reply with only: ok" ``` **For 5-minute TTL (default):** ``` Skill tool: skill="loop", args="4m Cache ping. Reply with only: ok" ``` Each ping triggers one lightweight API call that renews the cached prompt prefix. The response is minimal — just "ok" — so token consumption per ping is negligible. ### Step 4: Confirm to User After starting the loop, report: 1. **TTL tier**: Which cache duration was detected (5-min or 1-hour) 2. **Interval**: The chosen ping interval and why 3. **Peak window**: Whether currently in peak hours 4. **How to stop**: End the session or cancel the loop 5. **Savings**: Cached tokens cost ~90% less than uncached — on a large context this adds up fast ## Timing Reference | Timezone | Peak Start | Peak End | |----------|-----------|----------| | PT (Pacific) | 5:00 AM | 11:00 AM | | MT (Mountain) | 6:00 AM | 12:00 PM | | CT (Central) | 7:00 AM | 1:00 PM | | ET (Eastern) | 8:00 AM | 2:00 PM | | GMT / UTC | 1:00 PM | 7:00 PM | | CET (Central Europe) | 2:00 PM | 8:00 PM | | IST (India) | 6:30 PM | 12:30 AM | | JST (Japan) | 10:00 PM | 4:00 AM (+1) | | AEST (Sydney) | 11:00 PM | 5:00 AM (+1) | ## Important Notes - The cache is per-session. Each active Claude Code conversation has its own cached prefix. The ping must happen within the same session to renew it. - The ping only works while the session is open. Closing the terminal or ending the session invalidates the cache regardless of the loop. - Off-peak sessions still benefit if idle periods exceed the TTL — the cache expires based on inactivity, not time of day. - The first API call after cache expiry is always a full-price write. Every subsequent call within the TTL is a cache read at ~10% cost.
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.