PROMPT CACHING
# Prompt Caching Protocol (R13-004 / F-304) **Purpose.** Mark each agent's stable prompt prefix with Anthropic `cache_control: {"type": "ephemeral", "ttl": "..."}` so subsequent calls within the TTL pay ~10% of the prefix token cost and ~15% of the latency (R2-C092). APEX makes 5-7 agent calls per task; without caching, the stable prefix repeats every call and millions of tokens are wasted across a project. **Spec anchors.** - "Cost-aware execution." — apex-spec.md principle-line - Design-note: "Prompt caching: stable prefix first, volatile last → 90% input cost reduction (R7)" - `framework/commands/apex/next.md` comment anchor: "Stable prefix FIRST (for cache hits), volatile LAST" - `framework/CONTEXT_BUDGET.default.json` zone anchor: `stable_prefix.policy = "Always loaded. Never evicted."` ## Mechanics Anthropic's prompt caching is opt-in via a `cache_control` directive attached to a specific prompt segment. The harness reads each agent's frontmatter `cache_breakpoints:` directive at invocation time and splits the prompt at the matching XML tag. Everything BEFORE the tag is the stable prefix; everything AFTER is volatile per-call input.
fill the variables
This prompt has 1 variable. Pro fills them into a ready-to-paste prompt for you — no manual find-and-replace.
{"type": "ephemeral", "ttl": "..."}
Unlock with Pro →when to use it
Community prompt sourced from the open-source GitHub repo davidel8698-stack/apex (MIT). A "PROMPT CACHING" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
productivitycommunitydeveloper
source
davidel8698-stack/apex · MIT
more in Productivity
Productivity✓ tested
Summarize a doc into decisions & actions
chief of staff who extracts what to DO, not just what was said
Productivity✓ tested
Draft a reply to a hard email
calm, direct communicator who de-escalates without caving
Productivity✓ tested
Turn a brain-dump into a weekly plan
planning coach who protects your focus, not just your calendar