How to Set Up Reasoning Effort Control in Claude Code with DeepSeek Models

Set the CLAUDE_CODE_EFFORT_LEVEL environment variable to max, high, medium, or low in your Claude Code configuration file or shell environment to regulate computational depth when using DeepSeek models.

Claude Code uses reasoning effort levels to determine how much computational resources it allocates for generating code suggestions. When paired with DeepSeek's Anthropic-compatible models through the deepseek-ai/awesome-deepseek-agent repository, you can control this effort through the CLAUDE_CODE_EFFORT_LEVEL setting, either in the global Claude Code configuration file or via environment variables.

Configuring Reasoning Effort Control

The CLAUDE_CODE_EFFORT_LEVEL setting translates into deeper reasoning and longer context windows when set to higher values. You can configure this using two primary methods documented in docs/claude_code.md.

Method 1: Global Configuration File

Add the key under the "env" block in ~/.claude/settings.json (Linux/macOS) or %USERPROFILE%\.claude\settings.json (Windows). According to line 57 of docs/claude_code.md, setting the value to max (or high, medium, low depending on the model) tells Claude Code to request the highest-effort model parameters from DeepSeek.

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "<your DeepSeek API Key>",
    "ANTHROPIC_MODEL": "deepseek-v4-pro[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4-pro[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4-pro[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4-flash[1m]",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "CLAUDE_CODE_EFFORT_LEVEL": "max"
  }
}

Method 2: Environment Variables (Linux/macOS)

For temporary changes or CI pipelines, export CLAUDE_CODE_EFFORT_LEVEL before launching Claude Code. As documented at line 74 of docs/claude_code.md, use the following export commands:

export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=<your DeepSeek API Key>
export ANTHROPIC_MODEL=deepseek-v4-pro[1m]
export CLAUDE_CODE_EFFORT_LEVEL=max
claude   # launch Claude Code CLI

Method 3: Environment Variables (Windows PowerShell)

On Windows systems, set the variables using PowerShell syntax as shown at line 87 of docs/claude_code.md:

$env:ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
$env:ANTHROPIC_AUTH_TOKEN="<your DeepSeek API Key>"
$env:ANTHROPIC_MODEL="deepseek-v4-pro[1m]"
$env:CLAUDE_CODE_EFFORT_LEVEL="max"
claude   # start Claude Code

Understanding Effort Levels and Model Selection

The effort level works in conjunction with the DeepSeek model selection variables (ANTHROPIC_MODEL, ANTHROPIC_DEFAULT_OPUS_MODEL, etc.). By default, lines 50-53 of docs/claude_code.md suggest using the deepseek-v4-pro[1m] model for all three Claude families (Opus, Sonnet, and Haiku), though you can pair any of those with the effort flag to fine-tune performance versus cost.

  • max: Highest computational effort, deepest reasoning, longest context processing
  • high: Increased reasoning with moderate resource allocation
  • medium: Balanced performance for standard coding tasks
  • low: Minimal reasoning, fastest response times, lower cost

The Chinese translation in docs/claude_code.zh-CN.md provides equivalent instructions for bilingual teams, while CONTRIBUTING.md references these configuration patterns as standard practice for contributors working with Claude Code integrations.

Summary

  • Primary control: Use CLAUDE_CODE_EFFORT_LEVEL environment variable to adjust reasoning depth
  • Configuration location: Set persistently in ~/.claude/settings.json (Linux/macOS) or %USERPROFILE%\.claude\settings.json (Windows)
  • Temporary overrides: Export variables in shell sessions or CI pipelines before running claude
  • Model pairing: Combine effort levels with ANTHROPIC_MODEL variables pointing to DeepSeek endpoints like deepseek-v4-pro[1m]
  • Documentation source: Reference docs/claude_code.md in the deepseek-ai/awesome-deepseek-agent repository for line-specific configuration details

Frequently Asked Questions

What values can I set for CLAUDE_CODE_EFFORT_LEVEL?

You can set CLAUDE_CODE_EFFORT_LEVEL to max, high, medium, or low. The max setting requests the highest-effort model parameters from DeepSeek, triggering deeper reasoning and longer context windows, while low prioritizes speed and cost efficiency.

Does the reasoning effort level work with all DeepSeek models?

Yes, the effort level setting works with any DeepSeek model accessed through the Anthropic-compatible API endpoint (https://api.deepseek.com/anthropic). The configuration pairs CLAUDE_CODE_EFFORT_LEVEL with model selection variables like ANTHROPIC_MODEL or family-specific defaults such as ANTHROPIC_DEFAULT_OPUS_MODEL.

Where is the Claude Code configuration file located on Windows?

On Windows, store your configuration in %USERPROFILE%\.claude\settings.json. This file uses the same JSON structure as the Linux/macOS version, containing an "env" block where you define CLAUDE_CODE_EFFORT_LEVEL alongside your DeepSeek API credentials and endpoint settings.

Can I use different effort levels for different Claude model families?

While you set a global CLAUDE_CODE_EFFORT_LEVEL variable, you can override it per session by exporting different values before launching Claude Code. The repository recommends using deepseek-v4-pro[1m] for Opus, Sonnet, and Haiku families simultaneously, but you can create separate shell aliases or configuration files if you need distinct effort levels for different model families.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →