[FEATURE] Reduce unexpected cache write costs on Bedrock
Resolved 💬 6 comments Opened Feb 1, 2026 by stempeck Closed Apr 23, 2026
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Real-world impact: Thousand dollar overnight bill from cache writes
Running Claude Code in an automated loop overnight on AWS Bedrock with Opus 4.5 resulted in a $1,000+ bill, primarily from repeated cache writes.
The problem:
- Prompt caching is ON by default for all backends
- For Max subscribers, this is harmless (Anthropic absorbs the cost or handles it differently maybe?)
- For Bedrock/API users, cache writes cost 1.25x standard input tokens
- In automated/headless loops, cache results in constant write penalties, few read benefits
DISABLE_PROMPT_CACHING=1is not prominently warned, until you see it in AWS cost breakdown surprisingly...
The current default assumes interactive use and flat-rate billing. Bedrock users have unlimited downside exposure and need safer defaults.
Proposed Solution
Proposed fixes:
- Default OFF for Bedrock/API backends (or at minimum, default OFF in
--headless/loop mode) - Startup warning when caching is enabled + Bedrock detected: "Caching enabled. For automated workloads, consider DISABLE_PROMPT_CACHING=1"
- Cost guardrails: Optional spend limit or warning threshold (e.g., "You've spent $X this session")
- Better documentation: Prominent warning in Bedrock setup docs about caching costs for automated use cases
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
_No response_
Additional Context
_No response_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗