[BUG] API Error 400: Tool name exceeds 200 character limit causing complete session failure
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code session becomes completely unresponsive with API error 400 after extended usage (~75+ messages). All subsequent commands, including simple text responses, trigger the same error about tool names exceeding 200 characters. Session becomes completely unusable with no recovery mechanism.
What Should Happen?
- Tool names should never exceed the 200 character API limit
- If individual commands fail, the session should remain functional for other commands
- Simple text responses should not be affected by tool name length issues
- There should be graceful error handling and recovery mechanisms
Error Messages/Logs
API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.75.content.1.tool_use
.name:
String should have at most 200 characters"},"request_id":"req_011CSyQ2VgbQwSWHfbzxPhpV"}
Steps to Reproduce
- Start a new Claude Code session
- Perform extended analysis work over ~75+ message exchanges including: - Use Read tool on large files (20MB+) - Use Task tool for complex multi-step analysis - Use WebSearch for research - Generate comprehensive reports/documentation
- Attempt a basic git command like: git remote add origin https://github.com/username/anyrepo.git
- Observe API 400 error appears
- Try any subsequent command (even simple text like "Need help?")
- All commands now fail with the same API 400 error
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
1.0.109 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
The error seems to be triggered after extensive session use, specifically around message 75. Once it occurs, the session becomes completely corrupted - even simple text responses that shouldn't involve any tools trigger the same API error. The only workaround is force quitting (Ctrl+C) and restarting Claude Code, which loses all conversation context and work progress.
Which MCP servers do you have installed? Claude Code's built-in tools should not run into this issue.
If this happens, one way to recover is to rewind your conversation. You can access the rewind menu by pressing Esc twice.
I’ve had the same issue over the weekend multiple times. To confirm, I do not have any MCP servers hooked up.
Just had this as well with 1.0.117.
@dicksontsai this just happened to me right after compacting a conversation
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.