agent-cost-analyzer 0.0.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +72 -5
  3. package/THIRD-PARTY-NOTICES.md +3510 -0
  4. package/bin/agent-cost-analyzer.js +22 -0
  5. package/bin/node-gate.js +41 -0
  6. package/dist/cli.js +315313 -0
  7. package/dist/data/learn-scripts/cache-basics.json +163 -0
  8. package/dist/data/learn-scripts/cache-ttl-1-hour-breakpoint.json +176 -0
  9. package/dist/data/learn-scripts/cache-ttl-smoke-break.json +190 -0
  10. package/dist/data/learn-scripts/cascading-model-switch-then-ttl-lapse.json +121 -0
  11. package/dist/data/learn-scripts/clear.json +133 -0
  12. package/dist/data/learn-scripts/compaction.json +98 -0
  13. package/dist/data/learn-scripts/image-attachment-invalidation.json +108 -0
  14. package/dist/data/learn-scripts/inline-exploration-bloat.json +115 -0
  15. package/dist/data/learn-scripts/instructions-edit.json +99 -0
  16. package/dist/data/learn-scripts/mcp-tool-change.json +93 -0
  17. package/dist/data/learn-scripts/model-switch.json +88 -0
  18. package/dist/data/learn-scripts/reasoning-budget-toggle.json +98 -0
  19. package/dist/data/learn-scripts/rewind.json +139 -0
  20. package/dist/data/learn-scripts/session-forking-multi-branch.json +124 -0
  21. package/dist/data/learn-scripts/session-forking.json +99 -0
  22. package/dist/data/learn-scripts/silent-instructions-pullin.json +104 -0
  23. package/dist/data/learn-scripts/subagent-cheaper-model.json +70 -0
  24. package/dist/data/learn-scripts/subagent-session.json +70 -0
  25. package/dist/data/price-book/anthropic-api.json +662 -0
  26. package/dist/data/price-book/github-copilot.json +1402 -0
  27. package/dist/data/price-book/google-api.json +507 -0
  28. package/dist/data/price-book/openai-api.json +1184 -0
  29. package/dist/data/vendor-profiles/anthropic.json +568 -0
  30. package/dist/data/vendor-profiles/google.json +190 -0
  31. package/dist/data/vendor-profiles/microsoft.json +96 -0
  32. package/dist/data/vendor-profiles/moonshot.json +115 -0
  33. package/dist/data/vendor-profiles/openai.json +442 -0
  34. package/dist/data/vendor-profiles/xai.json +217 -0
  35. package/dist/mcp-apps/views.html +124 -0
  36. package/dist/web/assets/commit-mono-latin-400-normal-s0S3qwFW.woff +0 -0
  37. package/dist/web/assets/commit-mono-latin-400-normal-wzhe4RuD.woff2 +0 -0
  38. package/dist/web/assets/commit-mono-latin-700-normal-1-GU0IUE.woff +0 -0
  39. package/dist/web/assets/commit-mono-latin-700-normal-DU8mrtj2.woff2 +0 -0
  40. package/dist/web/assets/index-DeqVluBu.js +76 -0
  41. package/dist/web/assets/index-EJpifWDV.css +1 -0
  42. package/dist/web/assets/source-serif-4-latin-400-normal-C1O10bxN.woff +0 -0
  43. package/dist/web/assets/source-serif-4-latin-400-normal-DJ5YJwmz.woff2 +0 -0
  44. package/dist/web/assets/source-serif-4-latin-600-normal-DeJomR3S.woff +0 -0
  45. package/dist/web/assets/source-serif-4-latin-600-normal-DouSKlru.woff2 +0 -0
  46. package/dist/web/index.html +32 -0
  47. package/package.json +18 -4
@@ -0,0 +1,568 @@
1
+ {
2
+ "vendorId": "anthropic",
3
+ "displayName": "Anthropic",
4
+ "defaultModelId": "claude-sonnet-5.5",
5
+ "caching": {
6
+ "kind": "breakpoints",
7
+ "defaultTtlMinutes": 5,
8
+ "extendedTtlMinutes": 60,
9
+ "refreshOnHit": true,
10
+ "minCacheableTokens": 512,
11
+ "layers": ["tools", "system", "messages"]
12
+ },
13
+ "invalidation": [
14
+ {
15
+ "change": "tools-changed",
16
+ "invalidatesFrom": "tools",
17
+ "confidence": "documented",
18
+ "sourceIds": ["anthropic-pc-hierarchy", "anthropic-pc-tools"]
19
+ },
20
+ {
21
+ "change": "system-changed",
22
+ "invalidatesFrom": "system",
23
+ "confidence": "documented",
24
+ "sourceIds": ["anthropic-pc-hierarchy"]
25
+ },
26
+ {
27
+ "change": "image-added",
28
+ "invalidatesFrom": "messages",
29
+ "confidence": "documented",
30
+ "sourceIds": ["anthropic-pc-images"]
31
+ },
32
+ {
33
+ "change": "image-removed",
34
+ "invalidatesFrom": "messages",
35
+ "confidence": "documented",
36
+ "sourceIds": ["anthropic-pc-images"]
37
+ },
38
+ {
39
+ "change": "thinking-changed",
40
+ "invalidatesFrom": "messages",
41
+ "modelSpecific": true,
42
+ "confidence": "documented",
43
+ "sourceIds": [
44
+ "anthropic-pc-thinking",
45
+ "anthropic-pc-effort",
46
+ "anthropic-thinking-caching"
47
+ ]
48
+ },
49
+ {
50
+ "change": "model-switch",
51
+ "invalidatesFrom": "tools",
52
+ "confidence": "documented",
53
+ "sourceIds": [
54
+ "anthropic-cache-diagnostics",
55
+ "claude-code-switching-models"
56
+ ]
57
+ },
58
+ {
59
+ "change": "tool-choice-changed",
60
+ "invalidatesFrom": "messages",
61
+ "confidence": "documented",
62
+ "sourceIds": ["anthropic-pc-tool-choice"]
63
+ }
64
+ ],
65
+ "models": [
66
+ {
67
+ "modelId": "claude-haiku-4.5",
68
+ "displayName": "Claude Haiku 4.5",
69
+ "vendorId": "anthropic",
70
+ "releaseStatus": "GA",
71
+ "cachingKind": {
72
+ "kind": "breakpoints",
73
+ "defaultTtlMinutes": 5,
74
+ "extendedTtlMinutes": 60,
75
+ "refreshOnHit": true,
76
+ "minCacheableTokens": 4096,
77
+ "layers": ["tools", "system", "messages"]
78
+ },
79
+ "cheaperSiblingId": "claude-haiku-5.5",
80
+ "sourceIds": [
81
+ "gh-pricing-table",
82
+ "gh-models-pricing-anthropic",
83
+ "anthropic-pc-pricing-1h",
84
+ "anthropic-pc-limitations-4096"
85
+ ]
86
+ },
87
+ {
88
+ "modelId": "claude-haiku-5.5",
89
+ "displayName": "Claude Haiku 5.5",
90
+ "vendorId": "anthropic",
91
+ "releaseStatus": "GA",
92
+ "sourceIds": [
93
+ "gh-pricing-table",
94
+ "gh-models-pricing-anthropic",
95
+ "anthropic-pc-pricing-1h",
96
+ "anthropic-pc-tier-length",
97
+ "anthropic-pc-limitations-512"
98
+ ]
99
+ },
100
+ {
101
+ "modelId": "claude-sonnet-4",
102
+ "displayName": "Claude Sonnet 4",
103
+ "vendorId": "anthropic",
104
+ "releaseStatus": "GA",
105
+ "cachingKind": {
106
+ "kind": "breakpoints",
107
+ "defaultTtlMinutes": 5,
108
+ "extendedTtlMinutes": 60,
109
+ "refreshOnHit": true,
110
+ "minCacheableTokens": 1024,
111
+ "layers": ["tools", "system", "messages"]
112
+ },
113
+ "cheaperSiblingId": "claude-haiku-4.5",
114
+ "sourceIds": [
115
+ "gh-pricing-table",
116
+ "gh-models-pricing-anthropic",
117
+ "anthropic-pc-pricing-1h",
118
+ "anthropic-pc-limitations-1024"
119
+ ]
120
+ },
121
+ {
122
+ "modelId": "claude-sonnet-4.6",
123
+ "displayName": "Claude Sonnet 4.6",
124
+ "vendorId": "anthropic",
125
+ "releaseStatus": "GA",
126
+ "cachingKind": {
127
+ "kind": "breakpoints",
128
+ "defaultTtlMinutes": 5,
129
+ "extendedTtlMinutes": 60,
130
+ "refreshOnHit": true,
131
+ "minCacheableTokens": 1024,
132
+ "layers": ["tools", "system", "messages"]
133
+ },
134
+ "cheaperSiblingId": "claude-haiku-4.5",
135
+ "sourceIds": [
136
+ "gh-pricing-table",
137
+ "gh-models-pricing-anthropic",
138
+ "anthropic-pc-pricing-1h",
139
+ "anthropic-pc-limitations-1024"
140
+ ]
141
+ },
142
+ {
143
+ "modelId": "claude-opus-4.8",
144
+ "displayName": "Claude Opus 4.8",
145
+ "vendorId": "anthropic",
146
+ "releaseStatus": "GA",
147
+ "cachingKind": {
148
+ "kind": "breakpoints",
149
+ "defaultTtlMinutes": 5,
150
+ "extendedTtlMinutes": 60,
151
+ "refreshOnHit": true,
152
+ "minCacheableTokens": 1024,
153
+ "layers": ["tools", "system", "messages"]
154
+ },
155
+ "cheaperSiblingId": "claude-sonnet-4.6",
156
+ "sourceIds": [
157
+ "gh-pricing-table",
158
+ "gh-models-pricing-anthropic",
159
+ "anthropic-pc-pricing-1h",
160
+ "anthropic-pc-limitations-1024"
161
+ ]
162
+ },
163
+ {
164
+ "modelId": "claude-opus-5",
165
+ "displayName": "Claude Opus 5",
166
+ "vendorId": "anthropic",
167
+ "releaseStatus": "GA",
168
+ "cheaperSiblingId": "claude-sonnet-5",
169
+ "sourceIds": [
170
+ "gh-pricing-table",
171
+ "gh-models-pricing-anthropic",
172
+ "anthropic-pc-pricing-1h",
173
+ "anthropic-pc-limitations-512"
174
+ ]
175
+ },
176
+ {
177
+ "modelId": "claude-opus-5.5",
178
+ "displayName": "Claude Opus 5.5",
179
+ "vendorId": "anthropic",
180
+ "releaseStatus": "GA",
181
+ "cheaperSiblingId": "claude-sonnet-5.5",
182
+ "sourceIds": [
183
+ "gh-pricing-table",
184
+ "gh-models-pricing-anthropic",
185
+ "anthropic-pc-pricing-1h",
186
+ "anthropic-pc-limitations-512"
187
+ ]
188
+ },
189
+ {
190
+ "modelId": "claude-sonnet-5",
191
+ "displayName": "Claude Sonnet 5",
192
+ "vendorId": "anthropic",
193
+ "releaseStatus": "GA",
194
+ "cachingKind": {
195
+ "kind": "breakpoints",
196
+ "defaultTtlMinutes": 5,
197
+ "extendedTtlMinutes": 60,
198
+ "refreshOnHit": true,
199
+ "minCacheableTokens": 1024,
200
+ "layers": ["tools", "system", "messages"]
201
+ },
202
+ "cheaperSiblingId": "claude-haiku-5.5",
203
+ "sourceIds": [
204
+ "gh-pricing-table",
205
+ "gh-models-pricing-anthropic",
206
+ "anthropic-pc-pricing-1h",
207
+ "anthropic-pc-limitations-1024"
208
+ ]
209
+ },
210
+ {
211
+ "modelId": "claude-sonnet-5.5",
212
+ "displayName": "Claude Sonnet 5.5",
213
+ "vendorId": "anthropic",
214
+ "releaseStatus": "GA",
215
+ "cheaperSiblingId": "claude-haiku-5.5",
216
+ "sourceIds": [
217
+ "gh-pricing-table",
218
+ "gh-models-pricing-anthropic",
219
+ "anthropic-pc-pricing-1h",
220
+ "anthropic-pc-limitations-512"
221
+ ]
222
+ },
223
+ {
224
+ "modelId": "claude-opus-4.8-fast",
225
+ "displayName": "Claude Opus 4.8 (fast mode) (preview)",
226
+ "vendorId": "anthropic",
227
+ "releaseStatus": "GA",
228
+ "cachingKind": {
229
+ "kind": "breakpoints",
230
+ "defaultTtlMinutes": 5,
231
+ "refreshOnHit": true,
232
+ "minCacheableTokens": 1024,
233
+ "layers": ["tools", "system", "messages"]
234
+ },
235
+ "cheaperSiblingId": "claude-opus-4.8",
236
+ "sourceIds": [
237
+ "gh-pricing-table",
238
+ "gh-models-pricing-anthropic",
239
+ "anthropic-pc-limitations-1024"
240
+ ]
241
+ },
242
+ {
243
+ "modelId": "claude-fable-5",
244
+ "displayName": "Claude Fable 5",
245
+ "vendorId": "anthropic",
246
+ "releaseStatus": "GA",
247
+ "cheaperSiblingId": "claude-opus-5.5",
248
+ "sourceIds": [
249
+ "gh-pricing-table",
250
+ "gh-models-pricing-anthropic",
251
+ "anthropic-pc-pricing-1h",
252
+ "anthropic-pc-limitations-512"
253
+ ]
254
+ },
255
+ {
256
+ "modelId": "claude-fable-5.1",
257
+ "displayName": "Claude Fable 5.1",
258
+ "vendorId": "anthropic",
259
+ "releaseStatus": "GA",
260
+ "cheaperSiblingId": "claude-opus-5.5",
261
+ "sourceIds": [
262
+ "gh-pricing-table",
263
+ "gh-models-pricing-anthropic",
264
+ "anthropic-pc-pricing-1h",
265
+ "anthropic-pc-limitations-512"
266
+ ]
267
+ }
268
+ ],
269
+ "assumptions": [
270
+ {
271
+ "text": "Where Copilot places cache breakpoints isn't documented. The simulation assumes one after the tools, one after the system prompt and one after the last message.",
272
+ "confidence": "unknown"
273
+ },
274
+ {
275
+ "text": "Which cache TTL Copilot requests for Claude models isn't documented. The simulation assumes Anthropic's 5-minute default.",
276
+ "confidence": "unknown"
277
+ },
278
+ {
279
+ "text": "GitHub serves Copilot's Claude models from Amazon Web Services, Anthropic and Google Cloud, and doesn't say which one serves a request. GitHub links Anthropic's prompt-caching docs, so the simulation applies Anthropic's API rules.",
280
+ "confidence": "inferred",
281
+ "sourceIds": [
282
+ "gh-model-hosting-anthropic-hosts",
283
+ "gh-model-hosting-anthropic-caching"
284
+ ]
285
+ },
286
+ {
287
+ "text": "Thinking and effort changes also invalidate the tools and system caches on models that render the configuration ahead of them. Anthropic doesn't list those models, so the rule is marked model-specific and its per-model extent is unknown.",
288
+ "confidence": "unknown"
289
+ },
290
+ {
291
+ "text": "On Claude Fable 5.1, Fable 5, Opus 5.5, Opus 4.8, Opus 5, Sonnet 5.5 and Haiku 5.5, a system instruction added partway through a conversation keeps the system and message caches. This isn't available on Claude Sonnet 5.",
292
+ "confidence": "documented",
293
+ "sourceIds": ["anthropic-pc-mid-conversation-system"]
294
+ },
295
+ {
296
+ "text": "Whether Copilot adds instructions as mid-conversation system messages isn't documented. The simulation applies the top-level system rule.",
297
+ "confidence": "unknown"
298
+ },
299
+ {
300
+ "text": "Claude Code harness only: the main conversation requests the 1-hour TTL only on a Claude subscription within the plan's included usage; otherwise it gets 5 minutes, and subagents get 5 minutes even on a subscription.",
301
+ "confidence": "documented",
302
+ "sourceIds": ["claude-code-ttl", "claude-code-subagent-ttl"]
303
+ },
304
+ {
305
+ "text": "Claude Code harness only (rule register owner decision 7): changing effort keeps the cache on Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1 with an API key or a Claude subscription (Fable 5.1 from v2.1.260), but not on Amazon Bedrock, Google Cloud's Agent Platform, a Claude apps gateway, with CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS set or under an organization HIPAA configuration. The VS Code and Copilot harnesses follow the API rule.",
306
+ "confidence": "documented",
307
+ "sourceIds": [
308
+ "claude-code-effort",
309
+ "claude-code-effort-exceptions",
310
+ "claude-code-effort-fable"
311
+ ]
312
+ },
313
+ {
314
+ "text": "Claude Opus 4.8 (fast mode): Anthropic publishes no fast-mode minimum cacheable length. The profile uses Claude Opus 4.8's 1,024 tokens.",
315
+ "confidence": "inferred",
316
+ "sourceIds": ["anthropic-pc-limitations-1024", "anthropic-pc-speed"]
317
+ },
318
+ {
319
+ "text": "Claude Opus 4.8 (fast mode): Anthropic publishes no fast-mode 1-hour cache-write price or 1-hour TTL statement, so the profile lists neither.",
320
+ "confidence": "unknown"
321
+ },
322
+ {
323
+ "text": "On Claude Haiku 5.5 the long-context tier applies to prompts over 100,000 tokens, and cache reads and writes count toward the prompt length.",
324
+ "confidence": "documented",
325
+ "sourceIds": ["anthropic-pc-tier-length", "gh-pricing-table"]
326
+ },
327
+ {
328
+ "text": "Prompts below the model's minimum cacheable length are processed without caching, and no error is returned.",
329
+ "confidence": "documented",
330
+ "sourceIds": ["anthropic-pc-below-minimum"]
331
+ },
332
+ {
333
+ "text": "Thinking tokens are billed as output tokens.",
334
+ "confidence": "documented",
335
+ "sourceIds": ["anthropic-thinking-billing"]
336
+ },
337
+ {
338
+ "text": "On the Claude Code harness the simulation uses the 1-hour cache lifetime, as Claude Code's own logs show (186 of 188 past sessions wrote 1-hour caches). Copilot is simulated with the 5-minute default.",
339
+ "confidence": "inferred"
340
+ }
341
+ ],
342
+ "sources": [
343
+ {
344
+ "id": "gh-pricing-table",
345
+ "title": "GitHub Copilot price table (github/docs models-and-pricing.yml)",
346
+ "url": "https://github.com/github/docs/blob/cc0c29a040c251c48ed65198f108a484c33406fa/data/tables/copilot/models-and-pricing.yml",
347
+ "quote": "Applies to Anthropic models and to GPT-5.6 and later OpenAI model families. Use \"Not applicable\" for models that have no cache write cost.",
348
+ "checkedAt": "2026-11-05"
349
+ },
350
+ {
351
+ "id": "gh-models-pricing-anthropic",
352
+ "title": "GitHub Docs: Models and pricing for GitHub Copilot",
353
+ "url": "https://docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing",
354
+ "quote": "Anthropic models include a cache write cost in addition to cached input.",
355
+ "checkedAt": "2026-11-05"
356
+ },
357
+ {
358
+ "id": "gh-model-hosting-anthropic-hosts",
359
+ "title": "GitHub Docs: Hosting of models for GitHub Copilot (Anthropic models)",
360
+ "url": "https://docs.github.com/en/copilot/reference/ai-models/model-hosting",
361
+ "quote": "These models are hosted by Amazon Web Services, Anthropic PBC, and Google Cloud Platform.",
362
+ "checkedAt": "2026-11-05"
363
+ },
364
+ {
365
+ "id": "gh-model-hosting-anthropic-caching",
366
+ "title": "GitHub Docs: Hosting of models for GitHub Copilot (prompt caching)",
367
+ "url": "https://docs.github.com/en/copilot/reference/ai-models/model-hosting",
368
+ "quote": "To provide better service quality and reduce latency, GitHub uses prompt caching.",
369
+ "checkedAt": "2026-11-05"
370
+ },
371
+ {
372
+ "id": "anthropic-pc-breakpoints",
373
+ "title": "Anthropic: Prompt caching",
374
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching",
375
+ "quote": "You can define up to 4 cache breakpoints if you want to:",
376
+ "checkedAt": "2026-11-04"
377
+ },
378
+ {
379
+ "id": "anthropic-pc-default-ttl",
380
+ "title": "Anthropic: Prompt caching (cache lifetime)",
381
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching",
382
+ "quote": "By default, the cache has a 5-minute lifetime.",
383
+ "checkedAt": "2026-11-04"
384
+ },
385
+ {
386
+ "id": "anthropic-pc-refresh",
387
+ "title": "Anthropic: Prompt caching (refresh on hit)",
388
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching",
389
+ "quote": "The cache is refreshed for no additional cost each time the cached content is used.",
390
+ "checkedAt": "2026-11-04"
391
+ },
392
+ {
393
+ "id": "anthropic-pc-extended-ttl",
394
+ "title": "Anthropic: Prompt caching (1-hour cache duration)",
395
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching",
396
+ "quote": "Cache entries with longer TTL must appear before shorter TTLs (that is, a 1-hour cache entry must appear before any 5-minute cache entries).",
397
+ "checkedAt": "2026-11-04"
398
+ },
399
+ {
400
+ "id": "anthropic-pc-limitations-512",
401
+ "title": "Anthropic: Prompt caching, cache limitations (512 tokens)",
402
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#cache-limitations",
403
+ "quote": "512 tokens for Claude Fable 5.1, Claude Mythos 5.1, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Fable 5, Claude Mythos 5, and Claude Haiku 5.5",
404
+ "checkedAt": "2026-11-04"
405
+ },
406
+ {
407
+ "id": "anthropic-pc-limitations-1024",
408
+ "title": "Anthropic: Prompt caching, cache limitations (1,024 tokens)",
409
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#cache-limitations",
410
+ "quote": "1,024 tokens for Claude Opus 4.8, Claude Sonnet 5, Claude Sonnet 4.6, Claude Sonnet 4.5 (deprecated), Claude Opus 4.1 (retired, except on Claude Models on Google Cloud (Google managed) and Bedrock), Claude Opus 4 (retired, except on Claude Models on Google Cloud (Google managed)), and Claude Sonnet 4 (retired, except on Claude Models on Google Cloud (Google managed) and Bedrock)",
411
+ "checkedAt": "2026-11-04"
412
+ },
413
+ {
414
+ "id": "anthropic-pc-limitations-4096",
415
+ "title": "Anthropic: Prompt caching, cache limitations (4,096 tokens)",
416
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#cache-limitations",
417
+ "quote": "4,096 tokens for Claude Haiku 4.5",
418
+ "checkedAt": "2026-11-04"
419
+ },
420
+ {
421
+ "id": "anthropic-pc-below-minimum",
422
+ "title": "Anthropic: Prompt caching, cache limitations (below the minimum)",
423
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#cache-limitations",
424
+ "quote": "Shorter prompts cannot be cached, even if marked with `cache_control`. Any requests to cache fewer than this number of tokens are processed without caching, and no error is returned.",
425
+ "checkedAt": "2026-11-04"
426
+ },
427
+ {
428
+ "id": "anthropic-pc-pricing-1h",
429
+ "title": "Anthropic: Prompt caching, pricing (1-hour cache writes)",
430
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing",
431
+ "quote": "Cache write tokens with a 1-hour TTL are 2 times the base input tokens price.",
432
+ "checkedAt": "2026-11-04"
433
+ },
434
+ {
435
+ "id": "anthropic-pc-pricing-5m",
436
+ "title": "Anthropic: Prompt caching, pricing (5-minute cache writes)",
437
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing",
438
+ "quote": "Cache write tokens with a 5-minute TTL are 1.25 times the base input tokens price.",
439
+ "checkedAt": "2026-11-04"
440
+ },
441
+ {
442
+ "id": "anthropic-pc-tier-length",
443
+ "title": "Anthropic: Prompt caching, pricing (prompt-length tiers)",
444
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pricing",
445
+ "quote": "On a model priced by prompt length, cache reads and cache writes count toward a request's prompt length.",
446
+ "checkedAt": "2026-11-04"
447
+ },
448
+ {
449
+ "id": "anthropic-pc-hierarchy",
450
+ "title": "Anthropic: Prompt caching, what invalidates the cache",
451
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#what-invalidates-the-cache",
452
+ "quote": "As described in Structuring your prompt, the cache follows the hierarchy: `tools` → `system` → `messages`. Changes at each level invalidate that level and all subsequent levels.",
453
+ "checkedAt": "2026-11-04"
454
+ },
455
+ {
456
+ "id": "anthropic-pc-tools",
457
+ "title": "Anthropic: Prompt caching, what invalidates the cache (tool definitions)",
458
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#what-invalidates-the-cache",
459
+ "quote": "Modifying tool definitions (names, descriptions, parameters) invalidates the entire cache",
460
+ "checkedAt": "2026-11-04"
461
+ },
462
+ {
463
+ "id": "anthropic-pc-images",
464
+ "title": "Anthropic: Prompt caching, what invalidates the cache (images)",
465
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#what-invalidates-the-cache",
466
+ "quote": "Adding/removing images anywhere in the prompt affects message blocks",
467
+ "checkedAt": "2026-11-04"
468
+ },
469
+ {
470
+ "id": "anthropic-pc-tool-choice",
471
+ "title": "Anthropic: Prompt caching, what invalidates the cache (tool_choice)",
472
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#what-invalidates-the-cache",
473
+ "quote": "Changes to the `tool_choice` parameter only affect message blocks",
474
+ "checkedAt": "2026-11-04"
475
+ },
476
+ {
477
+ "id": "anthropic-pc-thinking",
478
+ "title": "Anthropic: Prompt caching, what invalidates the cache (thinking)",
479
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#what-invalidates-the-cache",
480
+ "quote": "The thinking configuration (mode, and `budget_tokens` in extended mode) is rendered into the prompt, so changing it always invalidates message blocks; tool and system caches are also invalidated on models that render the configuration ahead of them.",
481
+ "checkedAt": "2026-11-04"
482
+ },
483
+ {
484
+ "id": "anthropic-pc-effort",
485
+ "title": "Anthropic: Prompt caching, what invalidates the cache (effort)",
486
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#what-invalidates-the-cache",
487
+ "quote": "Changing the `output_config.effort` value always invalidates message blocks, with the same model-specific effect on tool and system caches as thinking parameters.",
488
+ "checkedAt": "2026-11-04"
489
+ },
490
+ {
491
+ "id": "anthropic-pc-speed",
492
+ "title": "Anthropic: Prompt caching, what invalidates the cache (speed)",
493
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching#what-invalidates-the-cache",
494
+ "quote": "Switching between `speed: \"fast\"` and standard speed invalidates system and message caches",
495
+ "checkedAt": "2026-11-04"
496
+ },
497
+ {
498
+ "id": "anthropic-pc-mid-conversation-system",
499
+ "title": "Anthropic: Prompt caching (mid-conversation system instructions)",
500
+ "url": "https://platform.claude.com/docs/en/build-with-claude/prompt-caching",
501
+ "quote": "On Claude Fable 5.1, Claude Mythos 5.1, Claude Fable 5, Claude Mythos 5, Claude Opus 5.5, Claude Opus 4.8, Claude Opus 5, Claude Sonnet 5.5, and Claude Haiku 5.5, you can add a new system instruction partway through a conversation without invalidating the system or message caches.",
502
+ "checkedAt": "2026-11-04"
503
+ },
504
+ {
505
+ "id": "anthropic-thinking-caching",
506
+ "title": "Anthropic: Building with extended thinking, thinking and prompt caching",
507
+ "url": "https://platform.claude.com/docs/en/build-with-claude/thinking#thinking-and-prompt-caching",
508
+ "quote": "Switching between `adaptive`, `enabled`, and `disabled`, changing `budget_tokens`, and changing the effort value all invalidate cache breakpoints: message-level breakpoints always miss, and tool and system-prompt breakpoints can miss too, depending on where the model renders the configuration.",
509
+ "checkedAt": "2026-11-04"
510
+ },
511
+ {
512
+ "id": "anthropic-thinking-billing",
513
+ "title": "Anthropic: Building with extended thinking (billing)",
514
+ "url": "https://platform.claude.com/docs/en/build-with-claude/thinking",
515
+ "quote": "Thinking has a cost: the tokens Claude spends reasoning are billed as output tokens, even when the thinking text isn't returned to you, and they count toward `max_tokens` alongside the response text.",
516
+ "checkedAt": "2026-11-04"
517
+ },
518
+ {
519
+ "id": "anthropic-cache-diagnostics",
520
+ "title": "Anthropic: Cache diagnostics",
521
+ "url": "https://platform.claude.com/docs/en/build-with-claude/cache-diagnostics",
522
+ "quote": "The `model` differs from the previous request (for example, a router, A/B test, or fallback selected a different model). The cache is per-model.",
523
+ "checkedAt": "2026-11-04"
524
+ },
525
+ {
526
+ "id": "claude-code-switching-models",
527
+ "title": "Claude Code: Prompt caching, switching models",
528
+ "url": "https://code.claude.com/docs/en/prompt-caching#switching-models",
529
+ "quote": "Each model has its own cache. Switching with `/model` means the next request reads the entire conversation history with no cache hits, even though the content is identical.",
530
+ "checkedAt": "2026-11-04"
531
+ },
532
+ {
533
+ "id": "claude-code-ttl",
534
+ "title": "Claude Code: Prompt caching, which TTL each request gets",
535
+ "url": "https://code.claude.com/docs/en/prompt-caching#which-ttl-each-request-gets",
536
+ "quote": "Unless you choose a TTL yourself, Claude Code requests the one-hour TTL only on a Claude subscription within your plan's included usage.",
537
+ "checkedAt": "2026-11-04"
538
+ },
539
+ {
540
+ "id": "claude-code-subagent-ttl",
541
+ "title": "Claude Code: Prompt caching, which TTL each request gets (subagents)",
542
+ "url": "https://code.claude.com/docs/en/prompt-caching#which-ttl-each-request-gets",
543
+ "quote": "Subagents fall outside the main-conversation TTL bucket, so they get five minutes even on a subscription until you choose a longer one.",
544
+ "checkedAt": "2026-11-04"
545
+ },
546
+ {
547
+ "id": "claude-code-effort",
548
+ "title": "Claude Code: Prompt caching, changing effort level",
549
+ "url": "https://code.claude.com/docs/en/prompt-caching#changing-effort-level",
550
+ "quote": "On Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.1 with an API key or a Claude subscription, you keep the cache when you change effort.",
551
+ "checkedAt": "2026-11-04"
552
+ },
553
+ {
554
+ "id": "claude-code-effort-exceptions",
555
+ "title": "Claude Code: Prompt caching, changing effort level (exceptions)",
556
+ "url": "https://code.claude.com/docs/en/prompt-caching#changing-effort-level",
557
+ "quote": "On Amazon Bedrock, Google Cloud's Agent Platform, or a Claude apps gateway, or when you set `CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS` or your organization has a HIPAA configuration, it works as on most models.",
558
+ "checkedAt": "2026-11-04"
559
+ },
560
+ {
561
+ "id": "claude-code-effort-fable",
562
+ "title": "Claude Code: Prompt caching, changing effort level (Fable 5.1 before v2.1.260)",
563
+ "url": "https://code.claude.com/docs/en/prompt-caching#changing-effort-level",
564
+ "quote": "Before v2.1.260, changing effort on Fable 5.1 with an API key or a Claude subscription also invalidated the cache.",
565
+ "checkedAt": "2026-11-04"
566
+ }
567
+ ]
568
+ }