How to Configure Thinking Budget for Claude Models in Claudian
To configure the thinking budget in Claudian, set the thinkingBudget key in claudian-settings.json to one of five preset levels (off, low, medium, high, xhigh), or use the toolbar gear icon in the chat interface—note that adaptive-thinking models use effortLevel instead and ignore the budget setting.
Claudian, an open-source plugin for interacting with Claude models, allows precise control over how many tokens the model spends on internal reasoning before generating visible output. This guide covers the dual configuration system—thinking budgets for legacy models and effort levels for adaptive-thinking models—based on the source code in the YishenTu/claudian repository.
Understanding Thinking Budget vs. Effort Level
Claudian implements two distinct mechanisms for controlling model reasoning, determined by the model type selected.
When to Use Thinking Budget
Use the thinking budget when working with custom or legacy Claude models (e.g., claude-3-haiku-20240307). The budget sets a hard token ceiling for the model's internal reasoning block. The available presets are defined in [src/core/types/models.ts](https://github.com/YishenTu/claudian/blob/main/src/core/types/models.ts#L18-L24):
export const THINKING_BUDGETS = [
{ value: 'off', label: 'Off', tokens: 0 },
{ value: 'low', label: 'Low', tokens: 4_000 },
{ value: 'medium', label: 'Med', tokens: 8_000 },
{ value: 'high', label: 'High', tokens: 16_000 },
{ value: 'xhigh', label: 'Ultra', tokens: 32_000 },
];
The budget is stored in user settings under the key thinkingBudget and defaults to 'off' as specified in DEFAULT_SETTINGS.
When to Use Effort Level
For adaptive-thinking models—the built-in Claude models (haiku, sonnet, opus and their 1M token variants)—Claudian ignores the thinkingBudget setting and instead uses effortLevel (low, medium, high, max). The system detects these models via the isAdaptiveThinkingModel() function in [src/core/types/models.ts](https://github.com/YishenTu/claudian/blob/main/src/core/types/models.ts#L56-L60):
export function isAdaptiveThinkingModel(model: string): boolean {
if (DEFAULT_MODEL_VALUES.has(model)) return true;
return /claude-(haiku|sonnet|opus)-/.test(model);
}
When this function returns true, the UI automatically hides the budget selector and displays the effort selector instead.
Configuration Methods
You can configure the thinking budget through three interfaces: the chat toolbar, direct JSON editing, or the programmatic API.
Via the Chat Toolbar
The simplest method uses the Thinking gear icon in the chat interface:
- Open any chat pane in Claudian.
- Locate the Thinking gear icon in the toolbar (or the Effort selector if using an adaptive model).
- Click the gear to reveal the five budget options: Off, Low, Med, High, and Ultra.
- Select the desired level.
The UI calls callbacks.onThinkingBudgetChange(budgetValue), which persists the value to .claude/claudian-settings.json. The implementation resides in [src/features/chat/ui/InputToolbar.ts](https://github.com/YishenTu/claudian/blob/main/src/features/chat/ui/InputToolbar.ts#L90-L118), specifically the renderBudgetGears method.
Editing Settings JSON Directly
For precise control or automation, edit the settings file directly:
{
"model": "claude-3-5-sonnet-20240620",
"thinkingBudget": "medium",
"effortLevel": "high"
}
Store this file at ~/.claude/claudian-settings.json (or the workspace-specific location). Changes take effect immediately upon saving, as the plugin hot-reloads settings. The interface definition in [src/core/types/settings.ts](https://github.com/YishenTu/claudian/blob/main/src/core/types/settings.ts) specifies:
export interface ClaudianSettings {
model: ClaudeModel;
thinkingBudget: ThinkingBudget; // Legacy token budget
effortLevel: EffortLevel; // Adaptive-thinking models only
// ... other settings
}
Programmatically via the Plugin API
Developers building plugins or custom commands can modify the budget through the settings API:
// Force a high budget for the next query
await plugin.settings.set('thinkingBudget', 'high');
await plugin.callbacks.onThinkingBudgetChange('high');
The QueryOptionsBuilder class in [src/core/agent/QueryOptionsBuilder.ts](https://github.com/YishenTu/claudian/blob/main/src/core/agent/QueryOptionsBuilder.ts#L53-L66) subsequently reads this value when constructing SDK calls:
const budgetSetting = ctx.settings.thinkingBudget;
const budgetConfig = THINKING_BUDGETS.find(b => b.value === budgetSetting);
const thinkingTokens = budgetConfig?.tokens ?? null;
return {
model: ctx.settings.model,
thinkingTokens: thinkingTokens && thinkingTokens > 0 ? thinkingTokens : null,
effortLevel: isAdaptiveThinkingModel(ctx.settings.model) ? ctx.settings.effortLevel : null,
// ... other options
};
Practical Code Examples
Reading the Current Budget
Access the current setting from a custom command:
const currentBudget = plugin.settings.thinkingBudget; // 'off' | 'low' | 'medium' | 'high' | 'xhigh'
new Notice(`Current thinking budget: ${currentBudget}`);
Implementing a Slash Command
Create a /set-budget command that validates and applies budget changes:
// src/utils/slashCommand.ts
if (args[0] && THINKING_BUDGETS.some(b => b.value === args[0])) {
await this.plugin.settings.set('thinkingBudget', args[0] as ThinkingBudget);
await this.plugin.callbacks.onThinkingBudgetChange(args[0] as ThinkingBudget);
new Notice(`Thinking budget set to ${args[0]}`);
}
Verifying SDK Token Limits
Inspect the generated query options to confirm the budget translates correctly:
import { QueryOptionsBuilder } from './src/core/agent/QueryOptionsBuilder';
const options = QueryOptionsBuilder.buildColdStartQueryOptions(ctx);
console.log('Thinking tokens sent to SDK:', options.thinkingTokens);
// Outputs: 8000 (for 'medium' budget) or null (for 'off')
Summary
- Two systems exist:
thinkingBudgetfor legacy models (0–32k tokens) andeffortLevelfor adaptive-thinking models. - Five preset levels control token allocation: off (0), low (4,000), medium (8,000), high (16,000), and xhigh/ultra (32,000).
- Configuration sources: Chat toolbar UI,
~/.claude/claudian-settings.json, or programmatic API viaplugin.settings.set(). - Detection logic in
isAdaptiveThinkingModel()determines which UI control appears. - Implementation converts budget strings to token integers in
QueryOptionsBuilder.tsbefore passing to the Claude SDK.
Frequently Asked Questions
What is the default thinking budget in Claudian?
The default value is 'off', meaning no tokens are allocated to the thinking block. This is defined in the DEFAULT_SETTINGS constant in [src/core/types/settings.ts](https://github.com/YishenTu/claudian/blob/main/src/core/types/settings.ts#L15-L18), which sets thinkingBudget: 'off' and effortLevel: 'medium'.
Why can't I see the thinking budget option for some models?
If you are using an adaptive-thinking model (built-in haiku, sonnet, opus, or their 1M variants), Claudian hides the budget selector and shows an Effort selector instead. The isAdaptiveThinkingModel() function in [src/core/types/models.ts](https://github.com/YishenTu/claudian/blob/main/src/core/types/models.ts#L56-L60) detects these models via regex matching against claude-(haiku|sonnet|opus)-.
How many tokens does each budget level allocate?
According to the THINKING_BUDGETS array in [src/core/types/models.ts](https://github.com/YishenTu/claudian/blob/main/src/core/types/models.ts#L18-L24): Off = 0 tokens, Low = 4,000 tokens, Medium = 8,000 tokens, High = 16,000 tokens, and XHigh/Ultra = 32,000 tokens. These values are passed as thinkingTokens to the Claude SDK.
Can I set a custom token count outside the preset values?
No. Claudian enforces the five enumerated values defined in ThinkingBudget type. The QueryOptionsBuilder only accepts the preset mappings; to use arbitrary token counts, you would need to modify the THINKING_BUDGETS constant in the source code or bypass the settings system entirely when constructing raw SDK calls.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →