prompt-caching
Cache the parts of the prompt that don't change so a long-running loop stops paying full price on every turn.
Skill by Archive228
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/archive228-prompt-caching
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/prompt-caching
What's inside
- Skill name
prompt-caching- Description
- Cache the parts of the prompt that don't change so a long-running loop stops paying full price on every turn. Use when the system prompt, tool defs, or reference docs are stable across many turns.
- License
- MIT
- Instructions
- 51 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Prompt Caching Every turn of a Plan→Act→Verify loop resends the same system prompt, the same tool definitions, and (usually) the same reference docs. Without cache breakpoints you pay full input price on all of it, every turn. With them, cached reads cost ~10% of the write. ## Where to put breakpoints Cache from the top of the prompt down. The cache is prefix-matched — a break in the middle invalidates everything after it. 1. **System prompt** — mark the end of it as a breakpoint if it's >1024 tokens (Sonnet/Opus) or >2048 (Haiku). 2. **Tool definitions** — cache immediately after, if the tool set is stable across the loop. 3. **Large stable docs** — repo map, style guide, spec — before any turn-specific user text. 4. **User message stem** — only if the same preamble repeats every turn. Everything past the last breakpoint is billed fresh every turn. That's fine — that's where the changing content goes. ## TTL choice - **5-minute cache** (default) — for tight loops where turns are seconds apart. Free to write. - **1-hour cache** — for slow loops (human in the loop, background jobs). Write cost is higher; break-even is ~2 hits. Pick 5m unless you know turns are minutes apart. ## Staleness rules — cache invalidation is silent - **Any byte change** above the breakpoint invalidates the cache from that point. - **Reordering** tools or messages counts as change. - **Trailing whitespace** counts as change. - **A different model version** counts as change. If cost isn't dropping, log the cache-hit metric. Do not assume. ## When NOT to cache - Prompt <1024 tokens — below the minimum block size, no savings. - One-shot calls — no reuse, cache write is wasted. - Highly dynamic system prompt (per-user templating) — cache misses will exceed hits. ## Red flags - **Cost graph flat after adding breakpoints** — you're invalidating on every turn. Diff two consecutive requests byte-for-byte above the breakpoint. - **Breakpoint after user message** — pointless; the user message changes every turn. - **Four+ breakpoints** — max is four; extras are ignored silently. - **Caching a prompt that gets edited mid-session** — one edit above the cut wipes all downstream savings. ## The math Cache write ≈ 1.25× normal input. Cache read ≈ 0.1× normal input. So a stable 20K-token prefix hit N times: N=1 costs more than no-cache; N=2 breaks even; N=10 costs ~15% of no-cache. Long loops win big; short chats lose. Cache is the single biggest cost lever on a long-running agent. Set it once at the start of the loop, verify hits, forget it.
From Archive228/loopkit, MIT.
More from Archive228/loopkit
- 0.701score
structured-output
Archive228
Get JSON out of the model reliably.
SkillCFreshness: C★ 755Claude Code +9 - 0.701score
using-loopkit
Archive228
Use when starting any conversation in a loopkit-enabled project - establishes how to find and use loopkit's 49 skills, requiring skill invocation before ANY…
SkillCFreshness: C★ 755Claude Code +9 - 0.701score
hitl-escalate
Archive228
Escalate blocked runs to a human via configured channel or fallback to BLOCKED.md and exit the loop.
SkillCFreshness: C★ 755Claude Code +9 - 0.698score
model-routing
Archive228
Split the Plan/Act/Verify loop across three model tiers — frontier planner, cheap executor, frontier judge — via env vars read by run.sh.
SkillCFreshness: C★ 755Claude Code +9 - 0.698score
active-memory-reminder
Archive228
Before compaction Loopkit extracts decisions into claude-decisions.json (machine-readable).
SkillCFreshness: C★ 755Claude Code +9 - 0.698score
broken-window-check
Archive228
Before picking new work, smoke-test the last "completed" feature.
SkillCFreshness: C★ 755Claude Code +9 - 0.698score
adversarial-verify
Archive228
Review a diff against the goal spec assuming the code is BROKEN.
SkillCFreshness: C★ 755Claude Code +9 - 0.698score
feature-list-json
Archive228
Enumerate every end-to-end feature as strict JSON entries with passes:false, editable-passes-only discipline, and priority order.
SkillCFreshness: C★ 755Claude Code +9 - 0.698score
eval-harness
Archive228
Build a repeatable eval loop that grades agent output with an LLM judge, so prompt/skill changes get scored against a baseline instead of eyeballed.
SkillCFreshness: C★ 755Claude Code +9 - 0.698score
evaluator-calibration
Archive228
Calibrate a reviewer persona with few-shot rubric examples so skepticism stays consistent and doesn't drift lenient over long runs.
SkillCFreshness: C★ 755Claude Code +9 - 0.698score
harness-stripping
Archive228
Systematically remove one harness component at a time and measure impact, killing scaffolding that no longer earns its complexity.
SkillCFreshness: C★ 755Claude Code +9 - 0.698score
init-script-contract
Archive228
Author idempotent init.sh under 120s plus sibling test.sh, stop.sh, reset.sh, serve.sh with fixed names the harness relies on.
SkillCFreshness: C★ 755Claude Code +9
Signals
- Stars
- 755
- Forks
- 124
- Open issues
- 0
- Last commit (this folder)
- Jul 7, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Archive228/loopkit
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Archive228
- 0.701score
using-loopkit
Archive228
Use when starting any conversation in a loopkit-enabled project - establishes how to find and use loopkit's 49 skills, requiring skill invocation before ANY…
SkillCFreshness: C★ 755Claude Code +9 - 0.701score
structured-output
Archive228
Get JSON out of the model reliably.
SkillCFreshness: C★ 755Claude Code +9 - 0.701score
hitl-escalate
Archive228
Escalate blocked runs to a human via configured channel or fallback to BLOCKED.md and exit the loop.
SkillCFreshness: C★ 755Claude Code +9 - 0.698score
broken-window-check
Archive228
Before picking new work, smoke-test the last "completed" feature.
SkillCFreshness: C★ 755Claude Code +9 - 0.698score
harness-stripping
Archive228
Systematically remove one harness component at a time and measure impact, killing scaffolding that no longer earns its complexity.
SkillCFreshness: C★ 755Claude Code +9 - 0.698score
adversarial-verify
Archive228
Review a diff against the goal spec assuming the code is BROKEN.
SkillCFreshness: C★ 755Claude Code +9
Cite this page
prompt-caching skill. Agent Mart. https://agentmart.dev/skills/archive228-prompt-caching (last updated 2026-10-24)