The Anthropic, Claude-subscription and Vertex AI paths build the /v1/messages body (and rawPredict body) with no cache_control field, anywhere in the extension.
Anthropic only caches when a mark is sent, so the whole Act system prompt (about 48,800 characters in SYSTEM_PROMPT_ACT, roughly 12,000 tokens) plus the tool list and the growing history is read at full input price on every step of the agent loop. A comment at agent.js:38667 says the prompt is ordered so Anthropic hits the cache, but no mark is sent. The Firefox build has the same code (src/firefox/src/providers/anthropic.js:433).
- What to change
- Send a cache mark on the request: one top-level cache_control {"type":"ephemeral"} for automatic caching on api.anthropic.com, or an explicit cache_control on the last system block and the last tool for the Vertex path. The prompt is already stable first and volatile last, and runtime context is kept out of the system prompt (agent/runtime-context.js:90).
- Why it matters
- An agent run makes many calls within seconds of each other, so each new call can read the prompt prefix at the cache-read price instead of the full input price; the mark costs a one-time write premium per run.
- Who reaches this
- only users on the Anthropic, Claude-subscription or Vertex Claude providers
- Overlaps
- Finding 2 loses some of the same tokens; the totals count the larger once.
- Estimate
- about 12M prompt tokens per 1,000 Anthropic-path calls read at full price instead of cache price (estimate)
What the estimate assumes
system prompt about 12,000 tokens from 48,835 characters at 4 chars per token (estimate, not tokenizer-counted); average call about 20,000 prompt tokens; about 15 steps per run so about 67 cache writes per 1,000 calls; reaches only users on Anthropic, Claude-subscription or Vertex Claude; minimum cacheable length is 512 tokens on current models per the Anthropic page, well below the prompt size.