claude-code - 💡(How to fix) Fix [Bug] Anthropic API Error: Usage Policy violation on chemistry computation tasks [3 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45050Fetched 2026-04-09 08:14:29
View on GitHub
Comments
3
Participants
4
Timeline
7
Reactions
1
Author
Timeline (top)
labeled ×4commented ×3

Error Message

[{"error":"Error: Failed to delete keychain entry\n at G5q (/$bunfs/root/src/entrypoints/cli.js:249:281163)\n at async YEq (/$bunfs/root/src/entrypoints/cli.js:402:898)\n at async eh6 (/$bunfs/root/src/entrypoints/cli.js:402:796)\n at async QH_ (/$bunfs/root/src/entrypoints/cli.js:1866:2077)\n at async cYH (/$bunfs/root/src/entrypoints/cli.js:1891:5678)\n at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:1960:40966)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T01:54:04.074Z"},{"error":"Error: 413 {"error":{"type":"request_too_large","message":"Request exceeds the maximum size"}}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:52000)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4942)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T02:03:41.210Z"},{"error":"MaxFileReadTokenExceededError: File content (20523070 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n at CT7 (/$bunfs/root/src/entrypoints/cli.js:4309:13191)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T02:03:41.211Z"},{"error":"FileTooLargeError: File content (1.3MB) exceeds maximum allowed size (256KB). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n at N4H (/$bunfs/root/src/entrypoints/cli.js:3867:14967)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T02:36:25.436Z"},{"error":"MaxFileReadTokenExceededError: File content (25490 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n at CT7 (/$bunfs/root/src/entrypoints/cli.js:4309:13191)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T02:51:44.178Z"},{"error":"AxiosError: Request failed with status code 404\n at oB (/$bunfs/root/src/entrypoints/cli.js:108:1194)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12750)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:115:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T03:34:30.757Z"},{"error":"AxiosError: Request failed with status code 403\n at oB (/$bunfs/root/src/entrypoints/cli.js:108:1194)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12750)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:115:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T03:37:08.161Z"},{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3447)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T05:35:10.560Z"},{"error":"Error: Failed to delete keychain entry\n at G5q (/$bunfs/root/src/entrypoints/cli.js:249:281163)\n at async YEq (/$bunfs/root/src/entrypoints/cli.js:402:898)\n at async eh6 (/$bunfs/root/src/entrypoints/cli.js:402:796)\n at async QH_ (/$bunfs/root/src/entrypoints/cli.js:1866:2077)\n at async cYH (/$bunfs/root/src/entrypoints/cli.js:1891:5678)\n at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:1960:40966)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T06:25:05.579Z"},{"error":"Error: 529 {"type":"error","error":{"type":"overloaded_error","message":"Overloaded"},"request_id":"req_011CZqqFxc8H5nt53H2gNRvK"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:51975)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4942)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T06:30:03.327Z"}]

Code Example

[{"error":"Error: Failed to delete keychain entry\n    at G5q (/$bunfs/root/src/entrypoints/cli.js:249:281163)\n    at async YEq (/$bunfs/root/src/entrypoints/cli.js:402:898)\n    at async eh6 (/$bunfs/root/src/entrypoints/cli.js:402:796)\n    at async QH_ (/$bunfs/root/src/entrypoints/cli.js:1866:2077)\n    at async cYH (/$bunfs/root/src/entrypoints/cli.js:1891:5678)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:1960:40966)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T01:54:04.074Z"},{"error":"Error: 413 {\"error\":{\"type\":\"request_too_large\",\"message\":\"Request exceeds the maximum size\"}}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:52000)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4942)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T02:03:41.210Z"},{"error":"MaxFileReadTokenExceededError: File content (20523070 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at CT7 (/$bunfs/root/src/entrypoints/cli.js:4309:13191)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T02:03:41.211Z"},{"error":"FileTooLargeError: File content (1.3MB) exceeds maximum allowed size (256KB). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at N4H (/$bunfs/root/src/entrypoints/cli.js:3867:14967)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T02:36:25.436Z"},{"error":"MaxFileReadTokenExceededError: File content (25490 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at CT7 (/$bunfs/root/src/entrypoints/cli.js:4309:13191)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T02:51:44.178Z"},{"error":"AxiosError: Request failed with status code 404\n    at oB (/$bunfs/root/src/entrypoints/cli.js:108:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12750)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:115:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T03:34:30.757Z"},{"error":"AxiosError: Request failed with status code 403\n    at oB (/$bunfs/root/src/entrypoints/cli.js:108:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12750)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:115:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T03:37:08.161Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3447)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T05:35:10.560Z"},{"error":"Error: Failed to delete keychain entry\n    at G5q (/$bunfs/root/src/entrypoints/cli.js:249:281163)\n    at async YEq (/$bunfs/root/src/entrypoints/cli.js:402:898)\n    at async eh6 (/$bunfs/root/src/entrypoints/cli.js:402:796)\n    at async QH_ (/$bunfs/root/src/entrypoints/cli.js:1866:2077)\n    at async cYH (/$bunfs/root/src/entrypoints/cli.js:1891:5678)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:1960:40966)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T06:25:05.579Z"},{"error":"Error: 529 {\"type\":\"error\",\"error\":{\"type\":\"overloaded_error\",\"message\":\"Overloaded\"},\"request_id\":\"req_011CZqqFxc8H5nt53H2gNRvK\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:51975)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4942)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T06:30:03.327Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description regular computation chemistry tasks, always shows "API Error: Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup)" similar tasks done 10 days ago then 33% current session tokens gone

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.94
  • Feedback ID: cb9f8c1e-151b-4f8a-a518-bd8474148db9

Errors

[{"error":"Error: Failed to delete keychain entry\n    at G5q (/$bunfs/root/src/entrypoints/cli.js:249:281163)\n    at async YEq (/$bunfs/root/src/entrypoints/cli.js:402:898)\n    at async eh6 (/$bunfs/root/src/entrypoints/cli.js:402:796)\n    at async QH_ (/$bunfs/root/src/entrypoints/cli.js:1866:2077)\n    at async cYH (/$bunfs/root/src/entrypoints/cli.js:1891:5678)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:1960:40966)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T01:54:04.074Z"},{"error":"Error: 413 {\"error\":{\"type\":\"request_too_large\",\"message\":\"Request exceeds the maximum size\"}}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:52000)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4942)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T02:03:41.210Z"},{"error":"MaxFileReadTokenExceededError: File content (20523070 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at CT7 (/$bunfs/root/src/entrypoints/cli.js:4309:13191)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T02:03:41.211Z"},{"error":"FileTooLargeError: File content (1.3MB) exceeds maximum allowed size (256KB). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at N4H (/$bunfs/root/src/entrypoints/cli.js:3867:14967)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T02:36:25.436Z"},{"error":"MaxFileReadTokenExceededError: File content (25490 tokens) exceeds maximum allowed tokens (10000). Use offset and limit parameters to read specific portions of the file, or search for specific content instead of reading the whole file.\n    at CT7 (/$bunfs/root/src/entrypoints/cli.js:4309:13191)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T02:51:44.178Z"},{"error":"AxiosError: Request failed with status code 404\n    at oB (/$bunfs/root/src/entrypoints/cli.js:108:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12750)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:115:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T03:34:30.757Z"},{"error":"AxiosError: Request failed with status code 403\n    at oB (/$bunfs/root/src/entrypoints/cli.js:108:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:113:12750)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:115:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T03:37:08.161Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3447)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T05:35:10.560Z"},{"error":"Error: Failed to delete keychain entry\n    at G5q (/$bunfs/root/src/entrypoints/cli.js:249:281163)\n    at async YEq (/$bunfs/root/src/entrypoints/cli.js:402:898)\n    at async eh6 (/$bunfs/root/src/entrypoints/cli.js:402:796)\n    at async QH_ (/$bunfs/root/src/entrypoints/cli.js:1866:2077)\n    at async cYH (/$bunfs/root/src/entrypoints/cli.js:1891:5678)\n    at async <anonymous> (/$bunfs/root/src/entrypoints/cli.js:1960:40966)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T06:25:05.579Z"},{"error":"Error: 529 {\"type\":\"error\",\"error\":{\"type\":\"overloaded_error\",\"message\":\"Overloaded\"},\"request_id\":\"req_011CZqqFxc8H5nt53H2gNRvK\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:51975)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4942)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-08T06:30:03.327Z"}]

extent analysis

TL;DR

The issue is likely due to exceeding the maximum allowed size or tokens for file content, and using offset and limit parameters to read specific portions of the file may resolve the issue.

Guidance

  • Review the error messages to identify specific issues, such as "Request exceeds the maximum size" or "File content exceeds maximum allowed tokens".
  • Consider using offset and limit parameters to read specific portions of the file instead of reading the whole file.
  • Check the Usage Policy (https://www.anthropic.com/legal/aup) to ensure compliance with the API usage guidelines.
  • Verify that the file size is within the allowed limits (e.g., 256KB) and adjust accordingly.

Example

No specific code snippet can be provided without more context, but using offset and limit parameters might look like: readFile({ offset: 0, limit: 10000 }).

Notes

The issue may be related to changes in the API usage policy or file size limits, and it's essential to review the policy and adjust the code accordingly. The provided error messages indicate a variety of issues, including file size and token limits, and it's crucial to address each error separately.

Recommendation

Apply a workaround by using offset and limit parameters to read specific portions of the file, and review the Usage Policy to ensure compliance with the API usage guidelines. This approach should help resolve the issue without requiring an upgrade to a fixed version.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING