<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Claude-Opus-4-7 on RockB</title><link>https://baeseokjae.github.io/tags/claude-opus-4-7/</link><description>Recent content in Claude-Opus-4-7 on RockB</description><image><title>RockB</title><url>https://baeseokjae.github.io/images/og-default.png</url><link>https://baeseokjae.github.io/images/og-default.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 07 May 2026 06:00:00 +0000</lastBuildDate><atom:link href="https://baeseokjae.github.io/tags/claude-opus-4-7/index.xml" rel="self" type="application/rss+xml"/><item><title>Claude Code Task Budgets Guide 2026: Control Token Spend in Agentic Sessions</title><link>https://baeseokjae.github.io/posts/claude-code-task-budgets-guide-2026/</link><pubDate>Thu, 07 May 2026 06:00:00 +0000</pubDate><guid>https://baeseokjae.github.io/posts/claude-code-task-budgets-guide-2026/</guid><description>Claude Code task budgets 2026: how to set token spend limits for agentic sessions via API and CLI, avoid cost explosions, and tune budgets for real workloads.</description><content:encoded><![CDATA[<p>Average enterprise Claude Code cost is $13 per developer per active day — and a single agentic prompt can burn 50,000 to 300,000 tokens, with users reporting single prompts eating 30-90% of a 5-hour budget. Agent teams using plan mode consume 7x more tokens than standard sessions. Before task budgets existed, the only options for controlling this spend were max_tokens (which cuts off mid-task) or manual session management. Task budgets, introduced in public beta on Claude Opus 4.7 in 2026, give you a third option: a soft advisory limit that lets Claude finish gracefully when approaching the budget, reporting progress and pausing rather than cutting off silently. Here&rsquo;s how to use them.</p>
<h2 id="what-are-claude-code-task-budgets-and-why-they-matter-in-2026">What Are Claude Code Task Budgets? (And Why They Matter in 2026)</h2>
<p>Task budgets are an advisory token spending limit for agentic Claude sessions, available in public beta on Claude Opus 4.7 via the <code>task-budgets-2026-03-13</code> beta header. Unlike max_tokens — which is a hard ceiling on output tokens per request — task budgets operate at the session level, tracking cumulative token usage across an entire agentic loop including thinking tokens, tool call outputs, and generated text. When Claude approaches the budget limit, it shifts behavior: it finishes current work, summarizes what was completed, and pauses to report status rather than cutting off mid-execution. The key distinction matters practically: max_tokens prevents runaway single responses; task budgets prevent runaway multi-step agentic loops. Enterprise Claude Code costs run $150-250 per developer per month for active users, and 40-70% savings are achievable through context management and budget controls. The minimum accepted task_budget.total is 20,000 tokens — values below this return a 400 error. Task budgets work only on Claude Opus 4.7 at launch; older models ignore the parameter.</p>
<h2 id="how-the-budget-countdown-works-across-an-agentic-loop">How the Budget Countdown Works Across an Agentic Loop</h2>
<p>The budget countdown mechanism operates server-side. When you set a task budget, Claude receives a continuously updated internal signal tracking how many tokens have been consumed against the total budget across the entire agentic loop — including thinking tokens, tool call outputs, and generated text. As the budget depletes, Claude&rsquo;s behavior adapts progressively. At roughly 70% consumed, Claude may start scoping sub-tasks more aggressively. At 85-90%, it shifts toward wrapping up current work rather than starting new steps. When the budget is nearly exhausted, Claude pauses and reports: something like &ldquo;28 of 35 subtasks complete, estimated 8,000 tokens to finish remaining work.&rdquo; This countdown is advisory, not a hard stop — Claude may slightly exceed the budget to finish a thought or tool call in progress. The &ldquo;graceful finish&rdquo; model is deliberately different from max_tokens truncation, which can leave partially modified files or incomplete state that requires manual cleanup. Budget awareness is also lossy at the per-step level: Claude knows the cumulative budget state but may not perfectly predict how many tokens an upcoming tool call will consume.</p>
<h2 id="setting-up-task-budgets-via-the-anthropic-api">Setting Up Task Budgets via the Anthropic API</h2>
<p>Task budgets require the <code>task-budgets-2026-03-13</code> beta header and are configured in the <code>output_config</code> object:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">import</span> anthropic
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>client <span style="color:#f92672">=</span> anthropic<span style="color:#f92672">.</span>Anthropic()
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>response <span style="color:#f92672">=</span> client<span style="color:#f92672">.</span>beta<span style="color:#f92672">.</span>messages<span style="color:#f92672">.</span>create(
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;claude-opus-4-7-20261101&#34;</span>,
</span></span><span style="display:flex;"><span>    max_tokens<span style="color:#f92672">=</span><span style="color:#ae81ff">16000</span>,
</span></span><span style="display:flex;"><span>    betas<span style="color:#f92672">=</span>[<span style="color:#e6db74">&#34;task-budgets-2026-03-13&#34;</span>],
</span></span><span style="display:flex;"><span>    output_config<span style="color:#f92672">=</span>{
</span></span><span style="display:flex;"><span>        <span style="color:#e6db74">&#34;task_budget&#34;</span>: {
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">&#34;type&#34;</span>: <span style="color:#e6db74">&#34;tokens&#34;</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">&#34;total&#34;</span>: <span style="color:#ae81ff">100000</span>   <span style="color:#75715e"># advisory limit across the full agentic session</span>
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>    },
</span></span><span style="display:flex;"><span>    messages<span style="color:#f92672">=</span>[{
</span></span><span style="display:flex;"><span>        <span style="color:#e6db74">&#34;role&#34;</span>: <span style="color:#e6db74">&#34;user&#34;</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#e6db74">&#34;content&#34;</span>: <span style="color:#e6db74">&#34;Review all Python files in the repo and fix type annotation issues&#34;</span>
</span></span><span style="display:flex;"><span>    }]
</span></span><span style="display:flex;"><span>)
</span></span></code></pre></div><p>The <code>total</code> field is the advisory budget in tokens. The <code>type</code> field currently only supports <code>&quot;tokens&quot;</code>. For multi-turn sessions where you want to carry the budget across context compaction events, add the <code>remaining</code> field (covered in its own section). The task budget is separate from — and layered under — max_tokens. max_tokens controls the ceiling for a single response generation; task_budget controls cumulative spend across the full loop. Both parameters should be set: max_tokens as the per-request safety net, task_budget as the session-level spending envelope.</p>
<p>A 400 error returns if <code>total</code> is below 20,000. Budget values that are clearly too small for the requested task cause Claude to aggressively reduce scope or decline to start — plan for at least 2x your p50 observed spend for similar tasks.</p>
<h2 id="using-task-budgets-in-the-claude-code-cli">Using Task Budgets in the Claude Code CLI</h2>
<p>In the Claude Code CLI, the <code>/config</code> command sets task budgets for the session:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># Set a 50,000 token task budget for this session</span>
</span></span><span style="display:flex;"><span>/config task_budget <span style="color:#ae81ff">50000</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Check current budget status</span>
</span></span><span style="display:flex;"><span>/config
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Clear the budget limit for this session</span>
</span></span><span style="display:flex;"><span>/config task_budget <span style="color:#ae81ff">0</span>
</span></span></code></pre></div><p>When the session approaches the budget limit, Claude Code reports progress inline: current subtask status, percentage complete, estimated tokens to finish. This transforms agentic sessions from &ldquo;fire and forget, then check the bill&rdquo; to active session management. The CLI budget setting persists for the session but resets when you start a new Claude Code session. For team deployments, budget defaults can be set in the organization settings or via environment configuration rather than requiring each developer to set them manually.</p>
<p>The interaction between the CLI budget and API parameters: when Claude Code calls the Anthropic API internally, it passes your session budget as the task_budget parameter. You don&rsquo;t need to configure the API directly when using the CLI — the <code>/config task_budget</code> command handles it.</p>
<h2 id="task-budgets-vs-max_tokens-understanding-the-difference">Task Budgets vs. max_tokens: Understanding the Difference</h2>
<p>These two parameters control different dimensions of token usage and are frequently confused:</p>
<table>
  <thead>
      <tr>
          <th></th>
          <th>max_tokens</th>
          <th>task_budget</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><strong>Scope</strong></td>
          <td>Single API response</td>
          <td>Entire agentic session</td>
      </tr>
      <tr>
          <td><strong>Type</strong></td>
          <td>Hard ceiling</td>
          <td>Advisory hint</td>
      </tr>
      <tr>
          <td><strong>What it counts</strong></td>
          <td>Output tokens only</td>
          <td>All tokens (thinking + output + tool calls)</td>
      </tr>
      <tr>
          <td><strong>When exceeded</strong></td>
          <td>Response cuts off mid-generation</td>
          <td>Claude wraps up gracefully</td>
      </tr>
      <tr>
          <td><strong>Use case</strong></td>
          <td>Prevent runaway single outputs</td>
          <td>Control session-level spend</td>
      </tr>
      <tr>
          <td><strong>Required?</strong></td>
          <td>Yes (always required)</td>
          <td>No (optional beta feature)</td>
      </tr>
  </tbody>
</table>
<p>The practical implication: always set both. max_tokens as a per-request safety net (16,000-64,000 tokens depending on task complexity), task_budget as the session envelope. A task budget without max_tokens could still produce a single runaway 100,000-token response; max_tokens without task_budget won&rsquo;t prevent an agentic loop from consuming budget across 50 individual tool calls each under the max_tokens ceiling.</p>
<p>The &ldquo;advisory&rdquo; nature of task_budget is intentional. Anthropic&rsquo;s design preference is for Claude to finish work coherently rather than stopping mid-operation. A hard cutoff at the budget boundary would create worse outcomes (partial file modifications, incomplete database migrations) than a slight overrun on the budget. In practice, task budget overruns are small — typically under 10% of the budget total.</p>
<h2 id="choosing-the-right-budget-size-for-your-tasks">Choosing the Right Budget Size for Your Tasks</h2>
<p>Setting budgets without measurement leads to two failure modes: budgets too small that cause aggressive scope reduction or refusal-like behavior, and budgets too large that don&rsquo;t actually constrain anything. The right approach:</p>
<p><strong>1. Measure first.</strong> Run your target tasks without task_budget enabled. Collect the token counts from several representative runs. Calculate p50 (median), p90 (90th percentile), and p99 (99th percentile) spend.</p>
<p><strong>2. Set budget based on percentile.</strong> For tasks where you want Claude to complete most runs fully: set budget at p90. For tasks where you&rsquo;re willing to accept some scope reduction to bound cost: set at p75. For strict cost control with acceptable quality reduction: set at p50.</p>
<p><strong>3. Budget by task type:</strong></p>
<table>
  <thead>
      <tr>
          <th>Task Type</th>
          <th>Typical Range</th>
          <th>Recommended Budget</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Simple bug fix</td>
          <td>10k-40k tokens</td>
          <td>50k (above minimum)</td>
      </tr>
      <tr>
          <td>Feature implementation</td>
          <td>50k-200k</td>
          <td>150k-250k</td>
      </tr>
      <tr>
          <td>Codebase-wide refactor</td>
          <td>200k-500k+</td>
          <td>300k-600k</td>
      </tr>
      <tr>
          <td>Documentation generation</td>
          <td>30k-100k</td>
          <td>100k-150k</td>
      </tr>
      <tr>
          <td>Full test suite creation</td>
          <td>100k-400k</td>
          <td>300k-500k</td>
      </tr>
  </tbody>
</table>
<p><strong>4. Account for Opus 4.7 cost multiplier.</strong> Opus 4.7 costs approximately 1.7x more than Sonnet 4.6. The April 2026 tokenizer update can inflate effective costs up to 35% for code-heavy content. Budget headroom matters more than it did on previous models.</p>
<h2 id="carrying-budget-across-context-compaction-with-remaining">Carrying Budget Across Context Compaction with &lsquo;remaining&rsquo;</h2>
<p>Context compaction — Claude&rsquo;s mechanism for summarizing long conversation history to stay within context limits — creates a budget tracking problem: after compaction, the session looks &ldquo;fresh&rdquo; to a naive implementation, resetting accumulated spend. The <code>remaining</code> field solves this:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#75715e"># First turn: set total budget</span>
</span></span><span style="display:flex;"><span>response <span style="color:#f92672">=</span> client<span style="color:#f92672">.</span>beta<span style="color:#f92672">.</span>messages<span style="color:#f92672">.</span>create(
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;claude-opus-4-7-20261101&#34;</span>,
</span></span><span style="display:flex;"><span>    max_tokens<span style="color:#f92672">=</span><span style="color:#ae81ff">16000</span>,
</span></span><span style="display:flex;"><span>    betas<span style="color:#f92672">=</span>[<span style="color:#e6db74">&#34;task-budgets-2026-03-13&#34;</span>],
</span></span><span style="display:flex;"><span>    output_config<span style="color:#f92672">=</span>{
</span></span><span style="display:flex;"><span>        <span style="color:#e6db74">&#34;task_budget&#34;</span>: {
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">&#34;type&#34;</span>: <span style="color:#e6db74">&#34;tokens&#34;</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">&#34;total&#34;</span>: <span style="color:#ae81ff">200000</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">&#34;remaining&#34;</span>: <span style="color:#ae81ff">200000</span>  <span style="color:#75715e"># same as total on first call</span>
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>    },
</span></span><span style="display:flex;"><span>    messages<span style="color:#f92672">=</span>[<span style="color:#f92672">...</span>]
</span></span><span style="display:flex;"><span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Track spend</span>
</span></span><span style="display:flex;"><span>tokens_used <span style="color:#f92672">=</span> response<span style="color:#f92672">.</span>usage<span style="color:#f92672">.</span>input_tokens <span style="color:#f92672">+</span> response<span style="color:#f92672">.</span>usage<span style="color:#f92672">.</span>output_tokens
</span></span><span style="display:flex;"><span>remaining <span style="color:#f92672">=</span> <span style="color:#ae81ff">200000</span> <span style="color:#f92672">-</span> tokens_used
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># On compaction event (when context is summarized), carry remaining budget</span>
</span></span><span style="display:flex;"><span>response <span style="color:#f92672">=</span> client<span style="color:#f92672">.</span>beta<span style="color:#f92672">.</span>messages<span style="color:#f92672">.</span>create(
</span></span><span style="display:flex;"><span>    model<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;claude-opus-4-7-20261101&#34;</span>,
</span></span><span style="display:flex;"><span>    max_tokens<span style="color:#f92672">=</span><span style="color:#ae81ff">16000</span>,
</span></span><span style="display:flex;"><span>    betas<span style="color:#f92672">=</span>[<span style="color:#e6db74">&#34;task-budgets-2026-03-13&#34;</span>],
</span></span><span style="display:flex;"><span>    output_config<span style="color:#f92672">=</span>{
</span></span><span style="display:flex;"><span>        <span style="color:#e6db74">&#34;task_budget&#34;</span>: {
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">&#34;type&#34;</span>: <span style="color:#e6db74">&#34;tokens&#34;</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">&#34;total&#34;</span>: <span style="color:#ae81ff">200000</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#e6db74">&#34;remaining&#34;</span>: remaining  <span style="color:#75715e"># carry through compaction</span>
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>    },
</span></span><span style="display:flex;"><span>    messages<span style="color:#f92672">=</span>[compacted_context]
</span></span><span style="display:flex;"><span>)
</span></span></code></pre></div><p>Claude Code&rsquo;s built-in auto-compaction (which achieves 60-80% context size reduction) handles the <code>remaining</code> field automatically when task budgets are enabled via CLI. For custom API integrations, you must track and pass <code>remaining</code> manually. Failing to carry <code>remaining</code> through compaction effectively resets the budget counter — Claude sees a fresh context with full budget, defeating the purpose of the budget limit.</p>
<h2 id="task-budgets--effort-parameter-combining-depth-and-breadth-control">Task Budgets + Effort Parameter: Combining Depth and Breadth Control</h2>
<p>The effort parameter and task budgets control orthogonal dimensions of agentic behavior:</p>
<ul>
<li><strong>Effort</strong> (<code>high</code>, <code>xhigh</code>, <code>max</code>) controls reasoning depth per step — how thoroughly Claude thinks through each decision before acting</li>
<li><strong>Task budget</strong> controls total breadth — how much total work Claude does across the full session</li>
</ul>
<p>In Claude Code, xhigh effort is now the default and increases token spend 1-1.35x compared to Opus 4.6 behavior. The interaction: high effort with a small task budget means Claude thinks deeply about each step but stops earlier. xhigh effort with a large budget means deep reasoning across many steps.</p>
<p>Practical recommendations:</p>
<ul>
<li><strong>Deterministic, well-specified tasks</strong> (add type annotations to these files): <code>effort: high</code> + budget at p75 of typical spend</li>
<li><strong>Judgment-heavy tasks</strong> (refactor this module for better testability): <code>effort: xhigh</code> + budget at p90 with larger headroom</li>
<li><strong>Open-ended exploration</strong> (find security issues in this codebase): <code>effort: max</code> + generous budget, monitor actively</li>
</ul>
<p>Setting task budgets without considering effort means you may be paying for deep thinking that generates too few steps, or getting shallow thinking across many steps. Tune both parameters together.</p>
<h2 id="task-budgets-for-agent-teams-controlling-the-7x-token-multiplier">Task Budgets for Agent Teams: Controlling the 7x Token Multiplier</h2>
<p>Multi-agent Claude Code deployments amplify costs dramatically. When agents run in plan mode, token consumption is approximately 7x higher than standard sessions. A 3-agent pipeline can balloon the orchestrator&rsquo;s context by 60,000+ tokens across just 10 cycles — even before accounting for the sub-agents&rsquo; own consumption.</p>
<p>Task budgets at each layer of a multi-agent system:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#75715e"># Orchestrator budget: total session envelope</span>
</span></span><span style="display:flex;"><span>orchestrator_config <span style="color:#f92672">=</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;task_budget&#34;</span>: {<span style="color:#e6db74">&#34;type&#34;</span>: <span style="color:#e6db74">&#34;tokens&#34;</span>, <span style="color:#e6db74">&#34;total&#34;</span>: <span style="color:#ae81ff">500000</span>}
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Sub-agent budget: per-task limit for spawned agents  </span>
</span></span><span style="display:flex;"><span>sub_agent_config <span style="color:#f92672">=</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;task_budget&#34;</span>: {<span style="color:#e6db74">&#34;type&#34;</span>: <span style="color:#e6db74">&#34;tokens&#34;</span>, <span style="color:#e6db74">&#34;total&#34;</span>: <span style="color:#ae81ff">100000</span>}
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>Setting budgets at the sub-agent level prevents any single agent from consuming the entire available compute. Setting a budget at the orchestrator level bounds total pipeline cost. The combination creates a cost envelope that&rsquo;s predictable enough to budget against — critical for teams deploying multiple developer agents running simultaneously.</p>
<p>Rate limit configuration for team deployments: 200k-300k TPM per user for teams of 1-5, with budget settings calibrated to stay within these limits during peak usage (weekday 5-11am Pacific runs 1.3-1.5x the baseline burn rate).</p>
<h2 id="common-pitfalls-the-too-small-budget-trap-and-how-to-avoid-it">Common Pitfalls: The Too-Small Budget Trap and How to Avoid It</h2>
<p><strong>The too-small budget trap.</strong> Setting budgets below what a task actually requires causes one of two failure modes: Claude aggressively scopes down the task (omitting files, skipping edge cases, generating partial solutions), or Claude produces refusal-like behavior where it declines to start work it &ldquo;knows&rdquo; it can&rsquo;t complete within the budget. The minimum accepted value is 20,000 tokens, but a 20,000-token budget for a large refactor task will still produce the scope-reduction failure mode.</p>
<p><strong>The measurement gap.</strong> Testing sessions typically cost less than production sessions because production accumulates history. A task that runs cleanly in 50,000 tokens in a fresh test session may consume 80,000-120,000 tokens in a production session with accumulated context. Add a 50% headroom buffer when translating test measurements to production budgets.</p>
<p><strong>Ignoring the tokenizer update.</strong> The April 2026 tokenizer update inflates effective costs up to 35% for code-heavy content compared to previous estimates. If your budget baselines were established before April 2026, recalibrate.</p>
<p><strong>Not monitoring the right metrics.</strong> Budget-per-task is a leading indicator; monthly API spend is a lagging indicator. Track both. A task that consistently uses 95%+ of its budget is a signal to investigate — either the budget is too tight or the task is expanding in scope.</p>
<p>The correct workflow: measure without budgets → calculate p50/p75/p90 → set budget at appropriate percentile for your tolerance → add 30-50% headroom for production vs test variance → monitor and adjust monthly.</p>
<hr>
<h2 id="faq">FAQ</h2>
<p><strong>What is the minimum task budget I can set?</strong></p>
<p>The minimum accepted <code>task_budget.total</code> is 20,000 tokens. Requests with a total below 20,000 return a 400 error. In practice, tasks requiring less than 20,000 tokens don&rsquo;t benefit much from budget controls — the main value of task budgets is controlling longer agentic sessions that might otherwise consume 50,000-300,000+ tokens.</p>
<p><strong>Does setting a task budget reduce the quality of Claude&rsquo;s output?</strong></p>
<p>Not directly, but indirectly when the budget is approached. When Claude has ample budget remaining, behavior is unchanged. As the budget depletes, Claude begins prioritizing completion of in-flight work over starting new steps, which can mean fewer total tasks completed — but the quality of completed tasks isn&rsquo;t degraded. Setting budgets significantly below p50 spend will cause visible scope reduction.</p>
<p><strong>Are task budgets available on all Claude models?</strong></p>
<p>As of the 2026 launch, task budgets are only supported on Claude Opus 4.7. Requests to other models with the task_budget parameter are silently ignored — the budget has no effect, and no error is returned. Check the beta documentation for updated model support.</p>
<p><strong>How do task budgets interact with Claude Code&rsquo;s auto-compaction?</strong></p>
<p>Claude Code&rsquo;s built-in auto-compaction handles budget carryover automatically when task budgets are set via the CLI (<code>/config task_budget</code>). For custom API integrations, you must manually track tokens consumed and pass the <code>remaining</code> field on each post-compaction API call. Failing to carry <code>remaining</code> through compaction effectively resets the budget counter.</p>
<p><strong>Can I see real-time budget consumption during a session?</strong></p>
<p>In the Claude Code CLI, Claude reports budget status when approaching limits: percentage consumed, tasks completed, estimated tokens to finish. The Anthropic API returns usage data in each response (<code>response.usage.input_tokens</code> + <code>response.usage.output_tokens</code>) which you can use to track cumulative spend in custom integrations. There&rsquo;s no real-time streaming budget dashboard — you track it by summing response usage data.</p>
]]></content:encoded></item></channel></rss>