[Bug] Anthropic API Error: Usage Policy violation with Sonnet 4.5 in Max Mode
Resolved 💬 3 comments Opened Nov 4, 2025 by olivere Closed Nov 8, 2025
Bug Description
I get the following API error. Using Sonnet 4.5 with 1M. I'm on Max Mode. Have 215k in context window now. In the middle of a debugging session. A bit frustrating really.
Perfect analysis! I can see exactly what's happening now
⎿ API Error: Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session for Claude Code to assist with a different task. If you are seeing this refusal repeatedly, try running /model claude-sonnet-4-20250514 to switch models.
Environment Info
- Platform: darwin
- Terminal: cursor
- Version: 2.0.32
- Feedback ID: b912ecf7-7e81-48cd-a5d2-44b934133bff
Errors
[{"error":"AxiosError: Request failed with status code 401\n at dR (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:25:1136)\n at IncomingMessage.<anonymous> (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:30:9845)\n at IncomingMessage.emit (node:events:530:35)\n at IncomingMessage.emit (node:domain:489:12)\n at endReadableNT (node:internal/streams/readable:1698:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n at o7A.request (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:32:2129)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Ml2 (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3630:15280)","timestamp":"2025-11-04T07:36:23.703Z"},{"error":"MaxFileReadTokenExceededError: File content (42623 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.\n at Rc2 (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3434:910)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3443:1301)\n at async fb5 (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2745:70325)\n at async HA1 (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2745:67382)\n at async file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:2745:66551","timestamp":"2025-11-04T07:44:02.951Z"},{"error":"MaxFileReadTokenExceededError: File content (42623 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.\n at Rc2 (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3434:910)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3443:1301)\n at async Oq (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:724:1190)\n at async file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1267:1379","timestamp":"2025-11-04T07:44:10.006Z"},{"error":"MaxFileReadTokenExceededError: File content (42623 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.\n at Rc2 (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3434:910)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3443:1301)\n at async Oq (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:724:1190)\n at async file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1267:1379","timestamp":"2025-11-04T07:44:58.034Z"},{"error":"MaxFileReadTokenExceededError: File content (42623 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.\n at Rc2 (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3434:910)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async Object.call (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3443:1301)\n at async Oq (file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:724:1190)\n at async file:///Users/oliver/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1267:1379","timestamp":"2025-11-04T07:45:02.904Z"},{"error":"MaxFileReadTokenExceededError: File content (42623 tokens) exceeds maximum allowed tokens (25000). Please use offset and li
Note: Error logs were truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗