Prompt Caching And Cost
# Prompt Caching and Cost Control
## Purpose
Prompt caching reduces repeated prefill work when multiple model calls share the same prefix. In long-running agents, this can materially reduce input-token cost and time-to-first-token latency.
Treat prompt caching as part of harness architecture, not as a provider afterthought. The context builder, tool registry, instruction manager, compactor, and telemetry layer all affect cache hit rate.
## Core rule: stable prefix, dynamic suffix
Most prompt-cache systems reward exact or near-exact prefix reuse. Design requests so stable content appears first and volatile content appears late.
Recommended ordering:when to use it
Community prompt sourced from the open-source GitHub repo DenisSergeevitch/agents-best-practices (MIT). A "Prompt Caching And Cost" 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
DenisSergeevitch/agents-best-practices · 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