{
 "paper": "budget-prompting",
 "a": "1.7",
 "b": "1.8",
 "summary": "From v1.7 (14 Jun) to v1.8 (19 Jun): 14,276 words to 14,540 words, 268 words in new or rewritten paragraphs and 4 taken out, 6 paragraphs changed.",
 "note": {
  "title": "Explains the three cache breakpoints, with a new figure",
  "kind": "revision",
  "body": "## Summary\n\nThe caching section gains a passage and a figure on how the provider builds the cached prompt in a fixed order (tools, then system, then messages) and where the authors' system places its cache breakpoints. The other figures are renumbered.",
  "source": "change note"
 },
 "paragraphs_changed": 6,
 "changes": [
  {
   "section": "B1. System Prompt Caching",
   "old": null,
   "new": "**Three slabs, three breakpoints.** Anthropic assembles the cached prefix in a fixed order — **tools → system → messages** — and allows up to four `cache_control: { type: \"ephemeral\" }` breakpoints. Each breakpoint marks the end of a stable span; everything before it is reused on a hit. The seam is load-bearing: slow-changing context (tool definitions, persona, skills, memory) belongs *above* a breakpoint and per-turn context (live turn, heartbeat, dynamic state) *below* it, because a single volatile token below the last breakpoint that is placed too high would invalidate everything after it. The tool-definitions array is the front slab — large, stable, and re-sent every turn — yet it is the one most often left uncached. TinkerClaw places a breakpoint on the last tool definition so the entire tool catalog is cached as one prefix: `applyAnthropicCacheControlToTools` attaches `cache_control` to `tools[tools.length - 1]` (`src/agents/anthropic-payload-policy.ts`), alongside the system-prefix breakpoint at the boundary marker and a breakpoint on the last user message. Three of the four available breakpoints are spent, each closing one stable slab.",
   "marked": "{+**Three slabs, three breakpoints.** Anthropic assembles the cached prefix in a fixed order — **tools → system → messages** — and allows up to four `cache_control: { type: \"ephemeral\" }` breakpoints. Each breakpoint marks the end of a stable span; everything before it is reused on a hit. The seam is load-bearing: slow-changing context (tool definitions, persona, skills, memory) belongs *above* a breakpoint and per-turn context (live turn, heartbeat, dynamic state) *below* it, because a single volatile token below the last breakpoint that is placed too high would invalidate everything after it. The tool-definitions array is the front slab — large, stable, and re-sent every turn — yet it is the one most often left uncached. TinkerClaw places a breakpoint on the last tool definition so the entire tool catalog is cached as one prefix: `applyAnthropicCacheControlToTools` attaches `cache_control` to `tools[tools.length - 1]` (`src/agents/anthropic-payload-policy.ts`), alongside the system-prefix breakpoint at the boundary marker and a breakpoint on the last user message. Three of the four available breakpoints are spent, each closing one stable slab.+}"
  },
  {
   "section": "B1. System Prompt Caching",
   "old": null,
   "new": "![Figure 1. The tools-to-system-to-messages cached prefix. Anthropic assembles the prefix in a fixed order and allows up to four ephemeral cache breakpoints; TinkerClaw spends three of them — one closing the tool-definitions array, one at the system-prompt boundary, one on the last user message. Everything above a breakpoint is reused on a cache hit; the volatile per-turn content lives below the final breakpoint. A single dynamic token placed above a breakpoint invalidates every span after it, which is why slow-changing context is hoisted above the seam and live turn state is pushed below it.](images/fig-cache-prefix.png)",
   "marked": "{+![Figure 1. The tools-to-system-to-messages cached prefix. Anthropic assembles the prefix in a fixed order and allows up to four ephemeral cache breakpoints; TinkerClaw spends three of them — one closing the tool-definitions array, one at the system-prompt boundary, one on the last user message. Everything above a breakpoint is reused on a cache hit; the volatile per-turn content lives below the final breakpoint. A single dynamic token placed above a breakpoint invalidates every span after it, which is why slow-changing context is hoisted above the seam and live turn state is pushed below it.](images/fig-cache-prefix.png)+}"
  },
  {
   "section": "4.1 The Request Lifecycle",
   "old": "![Figure 1. The Budget Prompting request lifecycle. An incoming request is classified for model and thinking budget (A1, A2), assembled with a frozen memory snapshot and search-based injection (B5, B3), pruned and compacted if oversized (B6, B4, B7, B2), checked against the prompt cache (B1) and the token-bucket pacer (D4, D3), run through inference with output controls (C1), and finally writes memory to a staging area with a security scan (B5, F1) before updating pacing accounting.](images/fig-pipeline.png)",
   "new": "![Figure 2. The Budget Prompting request lifecycle. An incoming request is classified for model and thinking budget (A1, A2), assembled with a frozen memory snapshot and search-based injection (B5, B3), pruned and compacted if oversized (B6, B4, B7, B2), checked against the prompt cache (B1) and the token-bucket pacer (D4, D3), run through inference with output controls (C1), and finally writes memory to a staging area with a security scan (B5, F1) before updating pacing accounting.](images/fig-pipeline.png)",
   "marked": "![Figure [-1.-] {+2.+} The Budget Prompting request lifecycle. An incoming request is classified for model and thinking budget (A1, A2), assembled with a frozen memory snapshot and search-based injection (B5, B3), pruned and compacted if oversized (B6, B4, B7, B2), checked against the prompt cache (B1) and the token-bucket pacer (D4, D3), run through inference with output controls (C1), and finally writes memory to a staging area with a security scan (B5, F1) before updating pacing accounting.](images/fig-pipeline.png)"
  },
  {
   "section": "4.2 Budget Pressure Cascade",
   "old": "![Figure 2. The five-level budget pressure cascade. As 7-day rolling utilization climbs from GREEN (<50%) to CRITICAL (>95%), the system progressively downshifts model tier, disables extended thinking, and skips lower-priority work. Each level inherits every restriction below it; critical cron jobs run at all levels, background jobs are the first to be dropped.](images/fig-cascade.png)",
   "new": "![Figure 3. The five-level budget pressure cascade. As 7-day rolling utilization climbs from GREEN (<50%) to CRITICAL (>95%), the system progressively downshifts model tier, disables extended thinking, and skips lower-priority work. Each level inherits every restriction below it; critical cron jobs run at all levels, background jobs are the first to be dropped.](images/fig-cascade.png)",
   "marked": "![Figure [-2.-] {+3.+} The five-level budget pressure cascade. As 7-day rolling utilization climbs from GREEN (<50%) to CRITICAL (>95%), the system progressively downshifts model tier, disables extended thinking, and skips lower-priority work. Each level inherits every restriction below it; critical cron jobs run at all levels, background jobs are the first to be dropped.](images/fig-cascade.png)"
  },
  {
   "section": "4.3 The Caching Stability Core",
   "old": "![Figure 3. Techniques arranged as concentric rings around the caching stability core. Ring 0 (B1 + B5) establishes the stable prefix; each outer ring — context management, request routing, output control, temporal smoothing, protection — operates without disturbing the prefix beneath it. Distance from the centre tracks how directly a technique touches the cached prompt.](images/fig-rings.png)",
   "new": "![Figure 4. Techniques arranged as concentric rings around the caching stability core. Ring 0 (B1 + B5) establishes the stable prefix; each outer ring — context management, request routing, output control, temporal smoothing, protection — operates without disturbing the prefix beneath it. Distance from the centre tracks how directly a technique touches the cached prompt.](images/fig-rings.png)",
   "marked": "![Figure [-3.-] {+4.+} Techniques arranged as concentric rings around the caching stability core. Ring 0 (B1 + B5) establishes the stable prefix; each outer ring — context management, request routing, output control, temporal smoothing, protection — operates without disturbing the prefix beneath it. Distance from the centre tracks how directly a technique touches the cached prompt.](images/fig-rings.png)"
  },
  {
   "section": "4.4 Interaction Matrix",
   "old": "![Figure 4. The technique interaction map. Solid edges mark synergies (combined effect exceeds the sum of parts), dashed edges mark tensions (one technique undermines another). The densest synergy cluster is the caching core (B1–B5–B6); the principal tensions all trace back to prefix stability versus freshness, responsiveness, or quality.](images/fig-composition.png)",
   "new": "![Figure 5. The technique interaction map. Solid edges mark synergies (combined effect exceeds the sum of parts), dashed edges mark tensions (one technique undermines another). The densest synergy cluster is the caching core (B1–B5–B6); the principal tensions all trace back to prefix stability versus freshness, responsiveness, or quality.](images/fig-composition.png)",
   "marked": "![Figure [-4.-] {+5.+} The technique interaction map. Solid edges mark synergies (combined effect exceeds the sum of parts), dashed edges mark tensions (one technique undermines another). The densest synergy cluster is the caching core (B1–B5–B6); the principal tensions all trace back to prefix stability versus freshness, responsiveness, or quality.](images/fig-composition.png)"
  }
 ]
}
