SPB Git

Repository Public

task-budgets.md 27.6 KB 673 lines markdown

1---2title: Task budgets3url: https://platform.claude.com/docs/en/build-with-claude/task-budgets4description: Give Claude an advisory token budget for the full agentic loop to help the model self-regulate on long agentic tasks.5---67## Compatibility8- Status: Beta9- [Beta header](https://platform.claude.com/docs/en/api/beta-headers): `task-budgets-2026-03-13`10- Supported models: `claude-fable-5-1`, `claude-mythos-5-1`, `claude-fable-5`, `claude-mythos-5`, `claude-opus-5`, `claude-opus-4-8`, `claude-opus-4-7`1112Task budgets let you tell Claude how many tokens it has for a full agentic loop, including thinking, tool calls, tool results, and output. The model sees a running countdown and uses it to prioritize work and finish gracefully as the budget is consumed.1314## When to use task budgets1516Task budgets work best for agentic workflows where Claude makes multiple tool calls and decisions before finalizing its output to await the next human response. Use them when:1718* You want Claude to self-regulate token spend on long-horizon tasks.19* You have a predictable per-task cost or latency ceiling to enforce.20* You want the model to finish gracefully (summarize findings, report progress) as it approaches the budget rather than cutting off mid-action.2122Task budgets complement the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort): effort controls how thoroughly Claude reasons about each step, while task budgets cap the total work Claude can do across an agentic loop.2324## Setting a task budget2526Add `task_budget` to `output_config` and include the beta header:2728<CodeGroup>29  ```bash cURL30  curl https://api.anthropic.com/v1/messages \31    -N \32    -H "x-api-key: $ANTHROPIC_API_KEY" \33    -H "anthropic-version: 2023-06-01" \34    -H "anthropic-beta: task-budgets-2026-03-13" \35    -H "content-type: application/json" \36    -d '{37      "model": "claude-opus-5",38      "max_tokens": 128000,39      "stream": true,40      "messages": [{41        "role": "user",42        "content": "Review the codebase and propose a refactor plan."43      }],44      "output_config": {45        "effort": "high",46        "task_budget": {"type": "tokens", "total": 64000}47      }48    }'49  ```5051  ```bash CLI52  ant beta:messages create --beta task-budgets-2026-03-13 \53    --stream --format jsonl <<'YAML' | jq 'select(.type == "message_delta").usage'54  model: claude-opus-555  max_tokens: 12800056  messages:57    - role: user58      content: Review the codebase and propose a refactor plan.59  output_config:60    effort: high61    task_budget:62      type: tokens63      total: 6400064  YAML65  ```6667  ```python Python68  client = anthropic.Anthropic()6970  with client.beta.messages.stream(71      model="claude-opus-5",72      max_tokens=128000,73      output_config={74          "effort": "high",75          "task_budget": {"type": "tokens", "total": 64000},76      },77      messages=[78          {"role": "user", "content": "Review the codebase and propose a refactor plan."}79      ],80      betas=["task-budgets-2026-03-13"],81  ) as stream:82      response = stream.get_final_message()8384  print(response.usage)85  ```8687  ```typescript TypeScript88  const client = new Anthropic();8990  const stream = client.beta.messages.stream({91    model: "claude-opus-5",92    max_tokens: 128000,93    output_config: {94      effort: "high",95      task_budget: { type: "tokens", total: 64000 }96    },97    messages: [{ role: "user", content: "Review the codebase and propose a refactor plan." }],98    betas: ["task-budgets-2026-03-13"]99  });100101  const response = await stream.finalMessage();102  console.log(response.usage);103  ```104105  ```csharp C#106107  var client = new AnthropicClient();108109  var responseUpdates = client.Beta.Messages.CreateStreaming(new MessageCreateParams110  {111      Model = Messages::Model.ClaudeOpus5,112      MaxTokens = 128000,113      Messages = [new() { Role = Role.User, Content = "Review the codebase and propose a refactor plan." }],114      OutputConfig = new BetaOutputConfig115      {116          Effort = Effort.High,117          TaskBudget = new BetaTokenTaskBudget { Total = 64000 },118      },119      Betas = ["task-budgets-2026-03-13"],120  });121122  var response = await responseUpdates.Aggregate();123  Console.WriteLine(response.Usage);124  ```125126  ```go Go127  client := anthropic.NewClient()128129  stream := client.Beta.Messages.NewStreaming(context.TODO(), anthropic.BetaMessageNewParams{130  	Model:     anthropic.ModelClaudeOpus5,131  	MaxTokens: 128000,132  	Betas:     []anthropic.AnthropicBeta{"task-budgets-2026-03-13"},133  	Messages: []anthropic.BetaMessageParam{{134  		Role: anthropic.BetaMessageParamRoleUser,135  		Content: []anthropic.BetaContentBlockParamUnion{{136  			OfText: &anthropic.BetaTextBlockParam{Text: "Review the codebase and propose a refactor plan."},137  		}},138  	}},139  	OutputConfig: anthropic.BetaOutputConfigParam{140  		Effort: anthropic.BetaOutputConfigEffortHigh,141  		TaskBudget: anthropic.BetaTokenTaskBudgetParam{142  			Total: 64000,143  		},144  	},145  })146147  message := anthropic.BetaMessage{}148  for stream.Next() {149  	event := stream.Current()150  	if err := message.Accumulate(event); err != nil {151  		panic(err)152  	}153  }154  if stream.Err() != nil {155  	panic(stream.Err())156  }157158  fmt.Printf("Usage: input_tokens=%d, output_tokens=%d\n", message.Usage.InputTokens, message.Usage.OutputTokens)159  ```160161  ```java Java162  AnthropicClient client = AnthropicOkHttpClient.fromEnv();163164  MessageCreateParams params = MessageCreateParams.builder()165      .model(Model.CLAUDE_OPUS_5)166      .maxTokens(128000L)167      .addUserMessage("Review the codebase and propose a refactor plan.")168      .outputConfig(BetaOutputConfig.builder()169          .effort(BetaOutputConfig.Effort.HIGH)170          .taskBudget(BetaTokenTaskBudget.builder().total(64000L).build())171          .build())172      .addBeta("task-budgets-2026-03-13")173      .build();174175  BetaMessageAccumulator accumulator = BetaMessageAccumulator.create();176  try (StreamResponse<BetaRawMessageStreamEvent> stream =177          client.beta().messages().createStreaming(params)) {178      stream.stream().forEach(accumulator::accumulate);179  }180181  BetaMessage response = accumulator.message();182  IO.println(response.usage());183  ```184185  ```php PHP186  use Anthropic\Beta\Messages\BetaRawMessageDeltaEvent;187188  $client = new Client();189190  $stream = $client->beta->messages->createStream(191      model: 'claude-opus-5',192      maxTokens: 128000,193      messages: [194          ['role' => 'user', 'content' => 'Review the codebase and propose a refactor plan.'],195      ],196      outputConfig: [197          'effort' => 'high',198          'taskBudget' => ['type' => 'tokens', 'total' => 64000],199      ],200      betas: ['task-budgets-2026-03-13'],201  );202203  // The final message_delta event carries the cumulative token usage for the request.204  $usage = null;205  foreach ($stream as $event) {206      if ($event instanceof BetaRawMessageDeltaEvent) {207          $usage = $event->usage;208      }209  }210211  echo $usage;212  ```213214  ```ruby Ruby215  client = Anthropic::Client.new216217  stream = client.beta.messages.stream(218    model: "claude-opus-5",219    max_tokens: 128_000,220    messages: [221      { role: "user", content: "Review the codebase and propose a refactor plan." }222    ],223    output_config: {224      effort: :high,225      task_budget: { type: :tokens, total: 64_000 }226    },227    betas: ["task-budgets-2026-03-13"]228  )229230  response = stream.accumulated_message231232  puts response.usage233  ```234</CodeGroup>235236The `task_budget` object has three fields:237238* `type`: always `"tokens"`.239* `total`: the number of tokens Claude can spend across the agentic loop, including thinking, tool calls, tool results, and output.240* `remaining` (optional): the budget remainder carried over from a prior request. Defaults to `total` when omitted.241242## How the budget countdown works243244Claude sees a budget-countdown marker injected server-side throughout the conversation. The marker shows how many tokens remain in the current agentic loop and updates as the model generates thinking, tool calls, and output, and as it processes tool results. Claude uses this signal to pace itself and finish gracefully as the budget is consumed.245246<Note>247  **The countdown is visible only to the model.** API responses do not include a remaining-budget field: there is no `task_budget` information in the response `usage` object, and SDKs have no accessor for it. To track spend client-side, sum token usage across the requests in your loop as shown in [Measure your current usage](https://platform.claude.com/docs/en/build-with-claude/task-budgets#measure-your-current-usage), or pass your own figure forward with `remaining` when [carrying a budget across compaction](https://platform.claude.com/docs/en/build-with-claude/task-budgets#carrying-a-budget-across-compaction-with-remaining).248</Note>249250<Warning>251  **The countdown reflects tokens Claude has processed in the current agentic loop, not tokens you resend between requests.** If your client sends the full conversation history on every follow-up request, your client-side token count might differ from the budget Claude is tracking. If you also decrement `remaining` while resending full history, the model sees an under-reported budget and the countdown drops faster than it should, causing Claude to wrap up earlier than the budget actually allows. Set a generous budget and let the model self-regulate against the countdown rather than trying to mirror it client-side.252</Warning>253254### What counts as a turn255256The budget covers one agentic turn, also called an agentic loop: everything Claude does in response to one user message that carries no tool results. A turn can span several requests.257258A user message that carries no tool results starts a new turn with a fresh budget. Today, the countdown still counts earlier turns' history while it remains in the context. A common case is a follow-up after Claude has ended its turn, for example because the budget ran out:259260```json261{ "role": "user", "content": "Continue." }262```263264A user message that contains `tool_result` blocks continues the current turn, because your client is resolving tool calls that are part of that turn:265266```json267{268  "role": "user",269  "content": [270    { "type": "tool_result", "tool_use_id": "toolu_01", "content": "<npm audit output>" }271  ]272}273```274275That holds even when the message adds new content alongside the tool results:276277```json278{279  "role": "user",280  "content": [281    { "type": "tool_result", "tool_use_id": "toolu_01", "content": "<npm audit output>" },282    { "type": "text", "text": "Also check the Dockerfile." }283  ]284}285```286287Server-side [compaction](https://platform.claude.com/docs/en/build-with-claude/compaction) during a turn does not reset the budget: tokens the turn consumed before the compaction still count against it. Tokens from before the turn began do not count, even when a compaction at the start of a turn summarizes them. Today, that exclusion applies only to the budget carried across a server-side compaction; earlier turns' history still counts while it remains in the context.288289### Worked example: budget counting across requests290291The task budget counts what Claude **sees** (thinking, tool calls and results, and text), not what's in your request payload. In an agentic loop your client resends the full conversation on every request, so the payload keeps growing, but the budget only decrements by what is new: the tokens Claude generates and the content it has not seen before. The following example is one [agentic turn](https://platform.claude.com/docs/en/build-with-claude/task-budgets#what-counts-as-a-turn) made of three requests: the first carries the user message, and the next two each resend the history with a tool result appended.292293Consider a loop with `task_budget: {type: "tokens", total: 100000}` and a single `bash` tool.294295**Request 1.** You send the initial request:296297```json298{299  "messages": [300    { "role": "user", "content": "Audit this repo for security issues and report findings." }301  ]302}303```304305Claude thinks, then emits a tool call and stops with `stop_reason: "tool_use"`:306307```json308{309  "role": "assistant",310  "content": [311    {312      "type": "thinking",313      "thinking": "I'll start by listing dependencies to look for known-vulnerable packages..."314    },315    {316      "type": "tool_use",317      "id": "toolu_01",318      "name": "bash",319      "input": { "command": "cat package.json && npm audit --json" }320    }321  ]322}323```324325Suppose this assistant message (thinking plus the tool call) totals 5,000 generated tokens. The countdown Claude saw during generation ended near `remaining` ≈ 95,000.326327**Request 2.** Your client runs the tool, then resends the full history with the tool result appended:328329```json330{331  "messages": [332    { "role": "user", "content": "Audit this repo for security issues and report findings." },333    {334      "role": "assistant",335      "content": [336        { "type": "thinking", "thinking": "I'll start by listing dependencies..." },337        {338          "type": "tool_use",339          "id": "toolu_01",340          "name": "bash",341          "input": { "command": "cat package.json && npm audit --json" }342        }343      ]344    },345    {346      "role": "user",347      "content": [348        {349          "type": "tool_result",350          "tool_use_id": "toolu_01",351          "content": "<2,800 tokens of npm audit output>"352        }353      ]354    }355  ]356}357```358359The resent messages from request 1 are not counted again, but the 2,800-token tool result is new content and counts against the budget. Claude spends another 4,000 tokens on thinking and a second tool call (`grep -rn "eval(" src/`). The countdown ends near `remaining` ≈ 88,200.360361**Request 3.** Full history resent again with the second tool result (1,200 tokens of grep output) appended. Claude writes a 6,000-token final findings report and stops with `stop_reason: "end_turn"`. `remaining` ≈ 81,000.362363Putting the three requests side by side makes the distinction between payload size and budget spend explicit:364365| Request   | Request payload (approx. input tokens you sent) | Tokens counted against budget this request                | Budget `remaining` after |366| --------- | ----------------------------------------------- | --------------------------------------------------------- | ------------------------ |367| 1         | \~20                                            | 5,000 (thinking + `tool_use`)                             | \~95,000                 |368| 2         | \~7,800 (messages from request 1 + tool result) | 6,800 (2,800 tool result + 4,000 thinking and `tool_use`) | \~88,200                 |369| 3         | \~13,000 (full history + second tool result)    | 7,200 (1,200 tool result + 6,000 `text`)                  | \~81,000                 |370| **Total** | **\~20,820 sent across requests**               | **19,000 counted against budget**                         | N/A                      |371372Your client sent the original user message three times and the first assistant message twice, but each was counted once. The budget spent 19,000 of 100,000 tokens, even though the cumulative payload your client transmitted was larger and the prompt-cached input on requests 2 and 3 was larger still.373374### Carrying a budget across compaction with `remaining`375376If your own code compacts or rewrites the message history between requests (for example, by summarizing earlier messages), the server has no memory of how much budget was spent before compaction. Pass `remaining` on the next request so the countdown continues from where you left off rather than resetting to `total`:377378<CodeGroup exclude="shell">379  ```python Python380  # Tokens spent before compaction, tracked client-side381  tokens_spent_so_far = 45000382383  output_config = {384      "effort": "high",385      "task_budget": {386          "type": "tokens",387          "total": 128000,388          "remaining": 128000 - tokens_spent_so_far,389      },390  }391  ```392393  ```typescript TypeScript394  // Tokens spent before compaction, tracked client-side395  const tokensSpentSoFar = 45000;396397  const outputConfig = {398    effort: "high",399    task_budget: {400      type: "tokens",401      total: 128000,402      remaining: 128000 - tokensSpentSoFar403    }404  };405  ```406407  ```csharp C#408  // Tokens spent before compaction, tracked client-side409  var tokensSpentSoFar = 45000;410411  var outputConfig = new BetaOutputConfig412  {413      Effort = Effort.High,414      TaskBudget = new BetaTokenTaskBudget415      {416          Total = 128000,417          Remaining = 128000 - tokensSpentSoFar,418      },419  };420  ```421422  ```go Go423  // Tokens spent before compaction, tracked client-side424  tokensSpentSoFar := int64(45000)425426  outputConfig := anthropic.BetaOutputConfigParam{427  	Effort: anthropic.BetaOutputConfigEffortHigh,428  	TaskBudget: anthropic.BetaTokenTaskBudgetParam{429  		Total:     128000,430  		Remaining: anthropic.Int(128000 - tokensSpentSoFar),431  	},432  }433  ```434435  ```java Java436  // Tokens spent before compaction, tracked client-side437  long tokensSpentSoFar = 45000;438439  BetaOutputConfig outputConfig = BetaOutputConfig.builder()440      .effort(BetaOutputConfig.Effort.HIGH)441      .taskBudget(BetaTokenTaskBudget.builder()442          .total(128000L)443          .remaining(128000L - tokensSpentSoFar)444          .build())445      .build();446  ```447448  ```php PHP449  // Tokens spent before compaction, tracked client-side450  $tokensSpentSoFar = 45000;451452  $outputConfig = [453      'effort' => 'high',454      'taskBudget' => [455          'type' => 'tokens',456          'total' => 128000,457          'remaining' => 128000 - $tokensSpentSoFar,458      ],459  ];460  ```461462  ```ruby Ruby463  # Tokens spent before compaction, tracked client-side464  tokens_spent_so_far = 45_000465466  output_config = {467    effort: :high,468    task_budget: {469      type: :tokens,470      total: 128_000,471      remaining: 128_000 - tokens_spent_so_far472    }473  }474  ```475</CodeGroup>476477In this example, the tokens spent before compaction are the usage of all the messages you have removed from the history so far, measured as in [Measure your current usage](https://platform.claude.com/docs/en/build-with-claude/task-budgets#measure-your-current-usage). Leave out anything still present in the messages you send, including any summary you added, because the server counts those tokens itself. Update this figure only when you replace the history this way; don't decrement it per request. Pass the resulting `remaining` on every request, not only the one that compacts.478479For loops that resend the full uncompacted history on every request, omit `remaining` and let the server track the countdown.480481## Changing the budget mid-conversation482483`task_budget` is a request-level setting. To change the budget partway through a task, for example to extend it when the user broadens the request, set a new `task_budget` in `output_config` on the next request. Keep the caching consequence in mind: the budget value participates in the rendered prompt, so a changed value does not match cache entries created under the old one (see [Feature support](https://platform.claude.com/docs/en/build-with-claude/task-budgets#feature-support) below).484485## Task budgets are advisory, not enforced486487Task budgets are a **soft hint, not a hard cap**. Claude may occasionally exceed the budget if it is in the middle of an action that would be more disruptive to interrupt than to finish. The enforced limit on total output tokens is still `max_tokens`, which truncates the response with `stop_reason: "max_tokens"` when reached.488489For a hard cap on cost or latency, combine task budgets with a reasonable `max_tokens` value:490491* Use `task_budget` to give Claude a target to pace against.492* Use `max_tokens` as the absolute ceiling that prevents runaway generation.493494Because `task_budget` spans the full agentic loop (potentially many requests) while `max_tokens` caps each individual request, the two values are independent; one is not required to be at or below the other.495496<Warning>497  **A budget that is too small for the task can cause refusal-like behavior.** When Claude sees a budget that is clearly insufficient for the work being asked (for example, a 20,000-token budget for a multihour agentic coding task), it may decline to attempt the task at all, scope it down aggressively, or stop early with a partial result rather than start work it cannot finish. If you observe unexpected refusals or premature stops after setting a budget, raise the budget before debugging other parameters. Size budgets against your actual task-length distribution rather than a fixed default; see [Choosing a budget](https://platform.claude.com/docs/en/build-with-claude/task-budgets#choosing-a-budget).498</Warning>499500## Choosing a budget501502The right budget depends on how much work your agentic loop currently does. Rather than guessing, measure your existing token usage first and then tune from there.503504### Measure your current usage505506Run a representative sample of tasks **without** `task_budget` set and record the total tokens Claude spends per task. For an agentic loop, sum `usage.output_tokens` across every request in the loop, plus the tokens of the tool results you append between requests:507508<CodeGroup>509  ```bash CLI510  ant messages create --transform 'usage.output_tokens' <<'YAML'511  model: claude-opus-5512  max_tokens: 4096513  messages:514    - role: user515      content: Review the codebase and propose a refactor plan.516  YAML517  ```518519  ```python Python520  client = anthropic.Anthropic()521522  response = client.messages.create(523      model="claude-opus-5",524      max_tokens=4096,525      messages=[526          {"role": "user", "content": "Review the codebase and propose a refactor plan."}527      ],528  )529530  # Sum output_tokens (text + thinking + tool calls) across every request in your loop.531  print(response.usage.output_tokens)532  ```533534  ```typescript TypeScript535  const client = new Anthropic();536537  const response = await client.messages.create({538    model: "claude-opus-5",539    max_tokens: 4096,540    messages: [{ role: "user", content: "Review the codebase and propose a refactor plan." }]541  });542543  // Sum output_tokens (text + thinking + tool calls) across every request in your loop.544  console.log(response.usage.output_tokens);545  ```546547  ```csharp C#548549  var client = new AnthropicClient();550551  var response = await client.Messages.Create(new MessageCreateParams552  {553      Model = Model.ClaudeOpus5,554      MaxTokens = 4096,555      Messages = [new() { Role = Role.User, Content = "Review the codebase and propose a refactor plan." }],556  });557558  // Sum OutputTokens (text + thinking + tool calls) across every request in your loop.559  Console.WriteLine(response.Usage.OutputTokens);560  ```561562  ```go Go563  client := anthropic.NewClient()564565  response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{566  	Model:     anthropic.ModelClaudeOpus5,567  	MaxTokens: 4096,568  	Messages: []anthropic.MessageParam{569  		anthropic.NewUserMessage(anthropic.NewTextBlock("Review the codebase and propose a refactor plan.")),570  	},571  })572  if err != nil {573  	log.Fatal(err)574  }575576  // Sum OutputTokens (text + thinking + tool calls) across every request in your loop.577  fmt.Println(response.Usage.OutputTokens)578  ```579580  ```java Java581  AnthropicClient client = AnthropicOkHttpClient.fromEnv();582583  MessageCreateParams params = MessageCreateParams.builder()584      .model(Model.CLAUDE_OPUS_5)585      .maxTokens(4096L)586      .addUserMessage("Review the codebase and propose a refactor plan.")587      .build();588589  Message response = client.messages().create(params);590  // Sum outputTokens (text + thinking + tool calls) across every request in your loop.591  IO.println(response.usage().outputTokens());592  ```593594  ```php PHP595  $client = new Client();596597  $response = $client->messages->create(598      model: 'claude-opus-5',599      maxTokens: 4096,600      messages: [601          ['role' => 'user', 'content' => 'Review the codebase and propose a refactor plan.'],602      ],603  );604605  // Sum outputTokens (text + thinking + tool calls) across every request in your loop.606  echo $response->usage->outputTokens . "\n";607  ```608609  ```ruby Ruby610  client = Anthropic::Client.new611612  response = client.messages.create(613    model: "claude-opus-5",614    max_tokens: 4096,615    messages: [616      { role: "user", content: "Review the codebase and propose a refactor plan." }617    ]618  )619620  # Sum output_tokens (text + thinking + tool calls) across every request in your loop.621  puts response.usage.output_tokens622  ```623</CodeGroup>624625Run this across a representative set of tasks and record the distribution. Start with the p99 of your per-task token spend to understand how providing the model with a task budget might modify the model's behavior, then test up or down as needed.626627The minimum accepted `task_budget.total` is **20,000 tokens** on every model that supports task budgets (see [Feature support](https://platform.claude.com/docs/en/build-with-claude/task-budgets#feature-support)). Smaller values return a 400 error.628629## Interaction with other parameters630631* **`max_tokens`:** Orthogonal to task budgets. `max_tokens` is a hard per-request cap on generated tokens, while `task_budget` is an advisory cap across the full agentic loop (potentially spanning many requests). At `xhigh` or `max` effort, set `max_tokens` to at least 64k to give Claude room to think and act on each request.632* **[Effort](https://platform.claude.com/docs/en/build-with-claude/effort):** Effort controls how deeply Claude reasons per step. Task budgets control how much total work Claude does across an agentic loop. The two are complementary: effort tunes depth, task budgets tune breadth.633* **[Adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking):** Task budgets include thinking tokens in the count, so adaptive thinking scales down as the budget depletes.634* **[Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching):** The budget-countdown marker is injected server-side on each request, so it does not match across requests. If your client decrements `task_budget.remaining` on each follow-up request, the changed value invalidates any cache prefix that contains it. To preserve caching, set the budget once on the initial request and let the model self-regulate against the server-side countdown rather than mutating the budget client-side.635636## Feature support637638| Model             | Support                                     |639| ----------------- | ------------------------------------------- |640| Claude Fable 5.1  | Beta (set `task-budgets-2026-03-13` header) |641| Claude Mythos 5.1 | Beta (set `task-budgets-2026-03-13` header) |642| Claude Opus 5     | Beta (set `task-budgets-2026-03-13` header) |643| Claude Fable 5    | Beta (set `task-budgets-2026-03-13` header) |644| Claude Mythos 5   | Beta (set `task-budgets-2026-03-13` header) |645| Claude Sonnet 5   | Not supported                               |646| Claude Opus 4.8   | Beta (set `task-budgets-2026-03-13` header) |647| Claude Opus 4.7   | Beta (set `task-budgets-2026-03-13` header) |648| Claude Opus 4.6   | Not supported                               |649| Claude Sonnet 4.6 | Not supported                               |650| Claude Haiku 4.5  | Not supported                               |651652Task budgets are not supported on [Claude Code](https://code.claude.com/docs/en/overview) or Cowork surfaces. Use task budgets directly through the Messages API on a [supported model](https://platform.claude.com/docs/en/build-with-claude/task-budgets#feature-support).653654## Next steps655656<CardGroup>657  <Card title="Effort" icon="gauge" href="https://platform.claude.com/docs/en/build-with-claude/effort">658    Control how thoroughly Claude reasons about each step of an agentic loop.659  </Card>660661  <Card title="Adaptive thinking" icon="brain" href="https://platform.claude.com/docs/en/build-with-claude/thinking">662    Let Claude decide when and how much to use extended thinking.663  </Card>664665  <Card title="Compaction" icon="arrows-clockwise" href="https://platform.claude.com/docs/en/build-with-claude/compaction">666    Manage context in long-running conversations with server-side compaction.667  </Card>668669  <Card title="Prompt caching" icon="database" href="https://platform.claude.com/docs/en/build-with-claude/prompt-caching">670    Reduce cost and latency on repeated prompts by caching prompt prefixes.671  </Card>672</CardGroup>673
Files main
Menu

Theme