[BUG] API Error 400: Tool name exceeds 200 character limit causing complete session failure

Resolved 💬 7 comments Opened Sep 10, 2025 by Shamdon Closed Jan 12, 2026

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

  1. Start a new Claude Code session
  2. 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
  1. Attempt a basic git command like:

git remote add origin https://github.com/username/anyrepo.git

  1. Observe API 400 error appears
  2. Try any subsequent command (even simple text like "Need help?")
  3. 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.

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗