Error: File content (28375 tokens) exceeds maximum allowed tokens (25000). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.
I am using sonnet and claude code. Reading some files I get something like this:
Error: File content (28375 tokens) exceeds maximum allowed tokens (25000).
Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.
While I understand there is some reasoning for this, why is the limit 25000 when Sonnet supports 64000 and Opus 32000? Shouldn't it detect which model is in use and let it use it up to the limit, or ate least higher for Sonnet?
How about context? We have a 200k context, but is it used by claude code? I am loading a small codebase that should be not anywhere near the 200k but apparently, it fills context very quickly.
Kindly allow us to use the full context and max_tokens available, don't hardcode those things.
The same here. And previously, bigger files were not the problem. Was something changed?
facing the same issue
Same. Please advise! This is a severe limitation! We can't even get playright screenshots for that small??? playwright - Wait for (MCP)(time: 3) ⎿ Error: MCP tool "browser_wait_for" response (45599 tokens) exceeds maximum allowed tokens (25000). Please use pagination, filtering, or limit parameters to reduce the response size.
same issue
same issue
I hade the same issue but with MCP tools. I could assume context provider MCPs encounter this limit more often.
This is really frustrating, makes using mcp feel useless. I'm on claude max 20x
RTFM, the MCP maximum token limit can be configured in the env configuration section.
Hello, how do I set it up through env?
RTFM, the MCP maximum token limit can be configured in the env configuration section.
export MAX_MCP_OUTPUT_TOKENS=50000 or whatever limit. I read somewhere the 5x Max plan has - 88K token limit and 20x Max - 200K token limit
please allow us to manually set it higher if you don't want to increase the default 🙏 50k would already help a lot in my case.
previously was a env var to set the context size why it was removed? pls add it again
I've the same issue. Unfortunately working on a C driver and have limitations breaking the file up. Claude scanning through without being able to load the whole file, makes it look like it really doesn't understand what the file is doing and makes significantly more mistakes. Qwen code for instance, handles this totally fine.
same issue 😡
what we do about this now?
same - whenever I start a simple project my context already filled in with 50,000 tokens. I didn't see this issue before
export MAX_MCP_OUTPUT_TOKENS=50000or whatever limit. I read somewhere the 5x Max plan has - 88K token limit and 20x Max - 200K token limit
this works fro MCP tools, but we need one for files and context
Given 1M token context size, it should really allow larger files if user wants to pay
we have paid the MAX plan, it still limit our file read token!!!!
I just did:
cd ~/.npm-global/lib/node_modules/@anthropic-ai/claude-code
sed -i 's/25000/100000/g' cli.js
And then in claude:
/model sonnet[1m]
And it looks like it works for me.