Przejdź do treści
Biblioteka skilli
AI i agenci · Automatyzacja

cache-money

/cache-money

Utrzymuje cache promptów Anthropic w sesjach Claude Code przez okresowe pingi, aby ograniczyć zużycie tokenów i uniknąć wygaśnięcia cache poza godzinami szczytu.

Repozytorium
claude-code ↗
Licencja
MIT
Ostatnia zmiana repozytorium
07.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 07.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Utrzymuje cache promptów Anthropic w sesjach Claude Code przez okresowe pingi, aby ograniczyć zużycie tokenów i uniknąć wygaśnięcia cache poza godzinami szczytu.

Wyzwalacze z opisu

keep cache warmwarm the cachesave tokensreduce token usagecache-moneystart cache pingoptimize peak hoursprevent cache expiry
Oryginalny opis (EN)

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.

Jak działa

  1. Why This Matters
  2. Workflow
  3. Timing Reference
  4. Important Notes
Sekcje z nagłówków SKILL.md, w oryginale · 102 linii, 772 słów
Podgląd SKILL.md
---
name: cache-money
description: 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.
disable-model-invocation: true
---

# 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.
Pliki w paczce (2)
  • SKILL.md 5 KB
  • references/cache-mechanics.md 6 KB

Wersje

W bazie nie ma innych skilli o nazwie cache-money.

Migawka bazy z 28.10.2026 · wersja paczki fb3f247a835f (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100cache-refund
    Analizuje ekonomię cache promptów w Claude Code na danym komputerze: ile zaoszczędził, ile wyciekło i czy włączenie godzinnego TTL zamiast 5-minutowego obniży koszty.
  • 100cache-strategy-picker
    Pokazuje aktywną strategię cache (none, auto, 1-ping, 2-ping, 1-hour-head) i przełącza między nimi, w tym włącza lub wyłącza pingi podtrzymujące cache w czasie bezczynności.
  • 100tokenmeter
    Otwiera lokalny panel Tokenmeter, który pokazuje zużycie tokenów, koszty, okna limitów i chybienia cache dla Claude Code i Codex.
  • 90context-optimization
    Optymalizuje zużycie tokenów, wydajność KV cache i zarządzanie oknem kontekstu agentów LLM: prompt caching, budżet tokenów, semantyczne przycinanie.
  • 100prompt-caching
    Pomaga poprawnie stosować prompt caching w Anthropic, OpenAI, Bedrock i Gemini, aby obniżyć koszt i opóźnienia: klucz cache, TTL, cache promptu systemowego i niski współczynnik trafień.
  • 100tokeneconomics
    Analizuje zużycie tokenów w sesjach Claude Code, wskazuje marnotrawstwo i możliwości oszczędności oraz rozrost rozmów.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.