claude-code - 💡(How to fix) Fix [Bug] Claude model generating incorrect code in extended sessions [1 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#48417Fetched 2026-04-16 07:00:44
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Error Message

[{"error":"McpToolCallError: {"name":"APIResponseError","code":"validation_error","status":400,"headers":{},"body":"{\"object\":\"error\",\"status\":400,\"code\":\"validation_error\",\"message\":\"Failed to execute query: Something went wrong. (429)\",\"request_id\":\"d594b9ba-7fb4-49da-90a7-eddf01927f62\"}","request_id":"d594b9ba-7fb4-49da-90a7-eddf01927f62"}\n at xh9 (/$bunfs/root/src/entrypoints/cli.js:1772:63)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:20:08.463Z"},{"error":"MaxFileReadTokenExceededError: File content (60285 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 tw7 (/$bunfs/root/src/entrypoints/cli.js:4535:12021)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:24:05.638Z"},{"error":"MaxFileReadTokenExceededError: File content (60285 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 tw7 (/$bunfs/root/src/entrypoints/cli.js:4535:12021)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:24:09.611Z"},{"error":"Error: Request was aborted.\n at JC_ (/$bunfs/root/src/entrypoints/cli.js:1290:12508)\n at next (native:1:11)\n at Dp7 (/$bunfs/root/src/entrypoints/cli.js:8032:9307)\n at next (native:1:11)\n at Pp7 (/$bunfs/root/src/entrypoints/cli.js:8037:12450)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:35:51.253Z"},{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:35:54.177Z"}]

Code Example

[{"error":"McpToolCallError: {\"name\":\"APIResponseError\",\"code\":\"validation_error\",\"status\":400,\"headers\":{},\"body\":\"{\\\"object\\\":\\\"error\\\",\\\"status\\\":400,\\\"code\\\":\\\"validation_error\\\",\\\"message\\\":\\\"Failed to execute query: Something went wrong. (429)\\\",\\\"request_id\\\":\\\"d594b9ba-7fb4-49da-90a7-eddf01927f62\\\"}\",\"request_id\":\"d594b9ba-7fb4-49da-90a7-eddf01927f62\"}\n    at xh9 (/$bunfs/root/src/entrypoints/cli.js:1772:63)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:20:08.463Z"},{"error":"MaxFileReadTokenExceededError: File content (60285 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 tw7 (/$bunfs/root/src/entrypoints/cli.js:4535:12021)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:24:05.638Z"},{"error":"MaxFileReadTokenExceededError: File content (60285 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 tw7 (/$bunfs/root/src/entrypoints/cli.js:4535:12021)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:24:09.611Z"},{"error":"Error: Request was aborted.\n    at JC_ (/$bunfs/root/src/entrypoints/cli.js:1290:12508)\n    at next (native:1:11)\n    at Dp7 (/$bunfs/root/src/entrypoints/cli.js:8032:9307)\n    at next (native:1:11)\n    at Pp7 (/$bunfs/root/src/entrypoints/cli.js:8037:12450)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:35:51.253Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:35:54.177Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description model has been making dumb mistakes in the last 12+hours
I asked to create a skill, it created a command. I asked to create one more skill, it created .claude/skills/<skillName>.md  wrong naming convention instead of <skillName>/SKILL.md Asked it to organize my obsidian, it recommended my folder should be "Research" instead of "research" . It moved all content to "Research" folder and deleted "research" . since it is same folder on Mac, it just deleted my folder. Luckily I noticed and asked it to restore in same session.

My confidence on claude is really shaken in last 12 hrs... Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.109
  • Feedback ID: 82704baa-3215-452e-8b37-e71eb1e879db

Errors

[{"error":"McpToolCallError: {\"name\":\"APIResponseError\",\"code\":\"validation_error\",\"status\":400,\"headers\":{},\"body\":\"{\\\"object\\\":\\\"error\\\",\\\"status\\\":400,\\\"code\\\":\\\"validation_error\\\",\\\"message\\\":\\\"Failed to execute query: Something went wrong. (429)\\\",\\\"request_id\\\":\\\"d594b9ba-7fb4-49da-90a7-eddf01927f62\\\"}\",\"request_id\":\"d594b9ba-7fb4-49da-90a7-eddf01927f62\"}\n    at xh9 (/$bunfs/root/src/entrypoints/cli.js:1772:63)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:20:08.463Z"},{"error":"MaxFileReadTokenExceededError: File content (60285 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 tw7 (/$bunfs/root/src/entrypoints/cli.js:4535:12021)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:24:05.638Z"},{"error":"MaxFileReadTokenExceededError: File content (60285 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 tw7 (/$bunfs/root/src/entrypoints/cli.js:4535:12021)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:24:09.611Z"},{"error":"Error: Request was aborted.\n    at JC_ (/$bunfs/root/src/entrypoints/cli.js:1290:12508)\n    at next (native:1:11)\n    at Dp7 (/$bunfs/root/src/entrypoints/cli.js:8032:9307)\n    at next (native:1:11)\n    at Pp7 (/$bunfs/root/src/entrypoints/cli.js:8037:12450)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:35:51.253Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-15T09:35:54.177Z"}]

extent analysis

TL;DR

The model's recent mistakes may be related to API response errors and file reading limitations, suggesting a need to review API request handling and file processing.

Guidance

  • Review the API request handling to address the validation_error with a 400 status code and the MaxFileReadTokenExceededError for file content exceeding the maximum allowed tokens.
  • Consider implementing offset and limit parameters when reading files to avoid exceeding the token limit.
  • Investigate the Request was aborted errors to determine if they are related to the API request handling or file processing issues.
  • Verify if the model's behavior is consistent across different platforms and environments to rule out any platform-specific issues.

Example

No specific code snippet can be provided without more context, but reviewing the error handling in the cli.js file, particularly around lines 1772 and 4535, may help identify the root cause.

Notes

The provided information suggests that the issues may be related to API request handling and file processing, but without more context or details about the model's implementation, it's challenging to provide a definitive solution.

Recommendation

Apply a workaround by reviewing and adjusting the API request handling and file processing to address the identified errors, as the exact cause and solution are not immediately clear from the provided information.

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