Claude Agent SDK v0.2.84 Adds API-Side Token Budgeting for Smarter Tool Use

Claude Agent SDK v0.2.84 Adds API-Side Token Budgeting for Smarter Tool Use

New taskBudget option lets Claude pace tool usage within token limits, preventing runaway API costs during complex coding sessions.

GAla Smith & AI Research Desk·2d ago·3 min read·2 views·AI-Generated
Share:
Source: github.comvia gh_claude_sdkSingle Source
Claude Agent SDK v0.2.84 Adds API-Side Token Budgeting for Smarter Tool Use

What Changed — SDK Update with Token Control

The Claude Agent SDK just released version 0.2.84, bringing several key improvements for developers building on top of Claude Code. The most significant addition is the taskBudget option, which gives the model API-side awareness of token limits. This means Claude can now pace its tool usage within a defined budget, preventing runaway token consumption during complex coding sessions.

Other changes include:

  • enableChannel() method and capabilities field on McpServerStatus for SDK-driven MCP channel activation
  • Exported EffortLevel type ('low' | 'medium' | 'high' | 'max') for direct reference
  • Fixed erroneous "[Request interrupted by user]" messages for non-user errors
  • Updated to parity with Claude Code v2.1.84

What It Means For You — Cost Control and Better Planning

If you're using Claude Code for extended coding sessions or building custom agents, the taskBudget feature changes how you manage API costs. Previously, you had to monitor token usage externally or set timeouts. Now, you can tell Claude: "You have 10,000 tokens for this refactoring task" and the model will plan accordingly.

This is particularly valuable for:

  • Long-running refactoring sessions where Claude might otherwise use dozens of tool calls
  • Batch processing tasks like updating multiple files or running tests
  • Agentic workflows where you chain multiple Claude interactions

The MCP channel improvements mean SDK users can now programmatically enable/disable MCP servers based on context, creating more dynamic tool environments.

Try It Now — Implementing Token Budgets

First, update your SDK:

npm install @anthropic-ai/claude-agent-sdk@0.2.84
# or using your preferred package manager

Then, implement token budgeting in your agent configuration:

import { createClaudeAgent } from '@anthropic-ai/claude-agent-sdk';

const agent = createClaudeAgent({
  apiKey: process.env.ANTHROPIC_API_KEY,
  model: 'claude-3-5-sonnet-20241022',
  taskBudget: 15000, // Set your token limit here
  // Other configuration...
});

// When running tasks, Claude will now pace tool usage
// to stay within the 15,000 token budget

For MCP channel control:

// Check server capabilities
const status = await mcpServer.getStatus();
if (status.capabilities.includes('dynamic-channel')) {
  await mcpServer.enableChannel('file-system');
}

When To Set Different Budgets

  • Small fixes: 2,000-5,000 tokens (single file changes)
  • Medium refactors: 10,000-20,000 tokens (multiple related files)
  • Large projects: 50,000+ tokens (architectural changes)

Remember: The budget includes both input and output tokens, plus tool call overhead. Start conservative and adjust based on your typical task complexity.

gentic.news Analysis

This SDK update continues Anthropic's push toward more controllable, cost-effective AI development tools. The taskBudget feature directly addresses a pain point developers have faced since Claude Code's release—unpredictable API costs during extended coding sessions. This follows Anthropic's March 2026 introduction of Claude Code Auto Mode and the /dream command, showing a consistent focus on making AI-assisted development more practical for production use.

The MCP improvements align with the broader trend we've covered extensively: Claude Code's ecosystem is maturing rapidly. With 26 sources confirming Claude Code's use of Model Context Protocol and 8 articles this week alone covering MCP servers (like the Notion bug tracker and Pilot MCP we highlighted), Anthropic is clearly betting on an extensible tool ecosystem. The exported EffortLevel type suggests more granular control over Claude's problem-solving intensity is coming to the SDK—potentially allowing developers to optimize for speed vs. thoroughness.

Given that Claude Code appeared in 166 articles this week (bringing its total to 395 in our database), and Anthropic in 92 articles (total 369), the platform is clearly gaining serious traction. This SDK update makes building on that platform more practical for teams watching their AI budgets.

AI Analysis

Claude Code users building custom agents or workflows should immediately implement the `taskBudget` option. Start by analyzing your typical token usage for different task types—small fixes vs. large refactors—and set appropriate budgets. This prevents surprise API bills when Claude goes down a rabbit hole of tool calls. For developers using MCP servers, the new `enableChannel()` method allows dynamic tool activation. Consider creating context-aware workflows where certain MCP servers only activate when needed (e.g., database tools only during data migration tasks). This reduces cognitive load on Claude and potentially improves response times. The exported `EffortLevel` type suggests future SDK features around controlling Claude's problem-solving intensity. Start thinking about when you'd want 'low' effort (quick fixes) vs. 'max' effort (complex algorithm design) to be ready when these controls become available.
Enjoyed this article?
Share:

Related Articles

More in Products & Launches

View all