Unexpected Model Selection: Claude 3.5 Haiku Forced by Statsig Configuration
Bug Description
Bug Report: Claude Code Using Claude 3.5 Haiku Model
Issue Description
After modifying MCP server configurations, Claude Code CLI is unexpectedly using the Claude 3.5 Haiku model instead of the default Claude 3.7 Sonnet model, as shown in the command output:
Total cost: $0.0034
Total duration (API): 6.9s
Total duration (wall): 1m 14.1s
Total code changes: 0 lines added, 0 lines removed
Token usage by model:
claude-3-5-haiku: 4.0k input, 64 output, 0 cache read, 0 cache write
Root Cause
The issue appears to be caused by Statsig configuration data in the Claude Code cache that has enabled the "useHaiku" feature flag. In the ~/.claude/statsig/statsig.cached.evaluations.*.json files, there is a configuration setting:
"useHaiku": true,
"haikuInterval": 5,
This setting is causing Claude Code to use the Haiku model for messages.
Files Affected
~/.claude/statsig/statsig.cached.evaluations.3599888669~/.claude/statsig/statsig.cached.evaluations.2932152684
These files contain the following configuration:
"responding": {
"spinner": "default",
"messages": "haiku",
"color": "claude",
"interval": 100
},
"toolUse": {
"spinner": "tools",
"messages": "haiku",
"color": "claude",
"interval": 250
},
"useHaiku": true,
"haikuInterval": 5,
How to Reproduce
- Run
claudefrom terminal - Issue any command (e.g.,
/bug) - Observe the token usage output showing Claude 3.5 Haiku being used
Impact
- Uses a smaller, less capable model than expected
- May affect quality of responses
- Different pricing tier than expected
Fix Options
Option 1: Clear Claude Code Configuration Cache
rm -rf ~/.claude/statsig/statsig.cached.evaluations.*
Option 2: Reset Claude Code Configuration
claude config reset
Option 3: Explicitly Set Model
claude config set model claude-3-7-sonnet-20250219
Option 4: Reinstall Claude Code
npm uninstall -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code
Prevention
To prevent this issue in the future:
- Avoid modifying MCP server configurations unless necessary
- Document any changes to configuration files
- Create backups of configuration files before making changes
- Add a verification step to check the model being used after configuration changes
Additional Information
The issue appears related to a feature flag configuration in the Statsig system that controls Claude Code's behavior. The specific configuration is enabling "useHaiku" and setting message types to "haiku" for both responding and tool use operations.
Environment Info
- Platform: linux
- Terminal: vscode
- Version: 0.2.114
- Feedback ID: 22c51083-4485-457e-b049-13dfd5488879
Errors
[{"error":"RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded\n at Socket.onChildStdout (node:child_process:490:14)\n at Socket.emit (node:events:518:28)\n at Socket.emit (node:domain:488:12)\n at addChunk (node:internal/streams/readable:559:12)\n at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)\n at Readable.push (node:internal/streams/readable:390:5)\n at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)","timestamp":"2025-05-14T19:13:54.102Z"},{"error":"Error: ENOENT: no such file or directory, open '/opt/mExpress/~/.claude'\n at Module.openSync (node:fs:581:18)\n at Object.readSync (file:///home/rmbg/.nvm/versions/node/v20.11.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:499:850)\n at sD (file:///home/rmbg/.nvm/versions/node/v20.11.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:502:260)\n at mB (file:///home/rmbg/.nvm/versions/node/v20.11.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:504:358)\n at file:///home/rmbg/.nvm/versions/node/v20.11.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1357:1059\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-05-14T19:16:43.787Z"},{"error":"Error: ENOENT: no such file or directory, open '/opt/mExpress/~/.claude'\n at Module.readFileSync (node:fs:453:20)\n at Object.readFileSync (file:///home/rmbg/.nvm/versions/node/v20.11.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:499:727)\n at mB (file:///home/rmbg/.nvm/versions/node/v20.11.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:504:376)\n at file:///home/rmbg/.nvm/versions/node/v20.11.1/lib/node_modules/@anthropic-ai/claude-code/cli.js:1357:1059\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-05-14T19:16:43.787Z"},{"error":"Error: ENOENT: no such file or directory, open '/opt/mExpress/~/.claude/projects'\n at Module.openSync (node:fs:581:18)\n at Object.readSync (file:%
Note: Error logs were truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗