Agent Prompt Caching Best Practices

Keep prompt cache hit rate high in long-running agents by following the patterns Claude Code's team uses — lay out static-then-dynamic, push updates into messages instead of editing the system prompt, never change models or tools mid-session, model state transitions as tools (Plan Mode), defer tool loading instead of removing tools, and implement compaction as cache-safe forking. Treat cache breaks as incidents.

uygnoey Updated 4 repo stars

File contents

uygnoey/skills-from-claude-blog commit 63e6422606

Frequently asked questions

npx get-skill add uygnoey/agent-prompt-caching-best-practices