[BUG] 400 Input is too long for requested model with `global.anthropic.claude-sonnet-4-5-20250929-v1:0`

Resolved 💬 18 comments Opened Oct 1, 2025 by eware-godaddy Closed Apr 3, 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?

I've never had this issue with any previous sonnet bedrock models. But ever since using global.anthropic.claude-sonnet-4-5-20250929-v1:0 on Claude-Code v2.0.1 I'm constantly seeing the error:

API Error: 400 Input is too long for requested model.

Even trying to do a force compaction doesn't solve the issue.

Running maocs 15.6.1

What Should Happen?

It should never throw a 400 error, and compact if it's running out of context length.

Error Messages/Logs

API Error: 400 Input is too long for requested model.

Steps to Reproduce

Run claude-code with the following environment variables set:

AWS_PROFILE=sso-caas-dev-private CLAUDE_CODE_USE_BEDROCK=1 ANTHROPIC_MODEL='global.anthropic.claude-sonnet-4-5-20250929-v1:0' ANTHROPIC_SMALL_FAST_MODEL='us.anthropic.claude-3-5-haiku-20241022-v1:0' AWS_REGION=us-west-2 claude

Keep running the prompts until you get close to the end of the context. You'll start to see this error message:

API Error: 400 Input is too long for requested model.

Trying to run /compact - even when the compaction occurs doesn't solve the issue.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.1

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

<img width="366" height="516" alt="Image" src="https://github.com/user-attachments/assets/ab078430-20a6-4008-ab1c-e0e17877fcaf" />

View original on GitHub ↗

18 Comments

eware-godaddy · 9 months ago

I think the issue is that those log files I was loading in were very large, and weren't able to be compacted away, or filled the context. My work around was to tell clause that those files were large so it would need to be smart about reading them.

mottysisam · 9 months ago

This happens on every MCP almost that goes the max limit, why can't the max limit be respected by CC?

Nantris · 7 months ago

This happens extremely randomly in Claude Code, on conversations that really at not very long.

Including all tool calls, this conversation is 16528 characters, and now I have to jump through hoops to continue it. This must be the tenth time I've hit this in a month. It would be nice to see a response.

My3VM · 7 months ago

I have run into this issue more often and been blocking almost after every tool call that results in a lengthy output.
Since I’m using directly “mcp_server” parameter with the sdk, I don’t even get an opportunity to truncate the 3rd part tool response before reaching the model.

Given this ticket is more than a month old, I hope there is at least some workaround that community has figured out?
Appreciate help, thanks!

MrKuzio · 7 months ago

This issue has been reported before, here is a link to that "Issue": https://github.com/anthropics/claude-code/issues/760

There is some advice on how to proceed, but I haven't found it very useful, to be honest. You might be lucky, though.

github-actions[bot] · 6 months ago

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.

GrayThinker · 6 months ago

This issue is still happening and the recovery suggestions from the other issue are not working for me.

AsteroidHunter · 5 months ago

Happened to me for the first time just now while using the CC VS code extension. Commenting here because the root cause of the error is likely identical.

I did nothing besides continue the previous conversation. I haven't hit any limits and tried fixing the issue by

  • running /compact, which was interrupted by the same error, and then
  • closing and opening VSCode, which was a huge mistake since the chat history disappeared, ~~I really hope it is retrievable~~ thankfully retrieval was easy

Screenshots attached.

<img width="766" height="682" alt="Image" src="https://github.com/user-attachments/assets/a02686f6-0967-4bec-b7b2-561821f624bb" />
<img width="552" height="501" alt="Image" src="https://github.com/user-attachments/assets/46fc6a49-72f4-48ce-8562-04b9e2af40e2" />

thegrahamking · 5 months ago

@AsteroidHunter how did you retrieve the conversation history?

AsteroidHunter · 5 months ago

@thegrahamking They are stored in ~/.claude/projects/{your repo name}/ in .jsonl format.

I asked Opus to create a script that converts the .jsonl into a text file with neatly separated user and assistant messages. The file names look like hash codes, so when I want to convert a specific chat into a .txt, I just provide a portion of the chat's title to Opus (any sentence or paragraph from the chat would work), and Opus finds and converts it.

Pretty useful for retrieving information as the VSCode extension has many UI bugs!

smallscript · 5 months ago

This is a critical disaster issue. I have encountered it 5 times in 3 days and it almost always causes project corruption that is fatally lossy. It worse makes dumb assumptions that it can GIT recover when it has explicit information that GIT is not available and is NOT the SCM model. This is for the $200 maximum service support system.

princealirehman · 4 months ago

Its still happening for me till date, any work around for this ?

borean · 4 months ago

This happens too much at this point. I have found workarounds that seem ambiguous at best at what context is brought over to the new chat but this should be easily solvable. an external check on context filling and a hook to trigger compaction even at full.

AsteroidHunter · 4 months ago

Have you all updated claude code? I haven't faced this issue since my last complaint earlier.

Nantris · 4 months ago

Claude Code updates itself and this issue affects the web version too.

Cytofluorogenase · 4 months ago

Affecting me today, still not fixed. Double escape does nothing.

<img width="792" height="731" alt="Image" src="https://github.com/user-attachments/assets/5679b5a1-fdd1-4a76-b6a0-95bb08544bd9" />

<img width="791" height="685" alt="Image" src="https://github.com/user-attachments/assets/9c656e9c-13ca-419e-8f4e-1789c90591af" />

github-actions[bot] · 3 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 3 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.