claude-code - 💡(How to fix) Fix [Bug] claude-opus-4-6: Model behavior regression - hallucination and lost self-correction in code auditing [1 comments, 2 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#47739Fetched 2026-04-15 06:43:37
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×3commented ×1cross-referenced ×1subscribed ×1

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/fushihua/.local/share/claude/versions/2.1.104 (expected in multi-process scenarios)\n at Tc_ (/$bunfs/root/src/entrypoints/cli.js:2836:2153)\n at Se6 (/$bunfs/root/src/entrypoints/cli.js:2836:1233)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:33:14.722Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/fushihua/Desktop/CrabClaw.\n at call (/$bunfs/root/src/entrypoints/cli.js:4458:7632)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:34:26.885Z"},{"error":"MaxFileReadTokenExceededError: File content (23893 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 kY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:34:53.982Z"},{"error":"MaxFileReadTokenExceededError: File content (12557 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 kY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:36:19.859Z"},{"error":"Error: EISDIR: illegal operation on a directory, read '/Users/fushihua/Desktop/CrabClaw/CrabCode/crates/acosmi-supervisor/src'\n at G1H (/$bunfs/root/src/entrypoints/cli.js:3942:15399)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:36:29.205Z"},{"error":"MaxFileReadTokenExceededError: File content (31694 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 kY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:36:34.275Z"},{"error":"MaxFileReadTokenExceededError: File content (11287 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 …

Fix Action

Fix / Workaround

Description: Since v2.1.100, using claude-opus-4-6 with max reasoning depth, the model has exhibited a significant behavioral regression in the following areas:

  1. Superficial Code Auditing The model no longer performs genuine code-level verification (file-by-file, function-by-function cross-checking). It relies on documents or diff surfaces to draw conclusions, resulting in outputs that contradict the actual state of the codebase.
  2. Guessing Instead of Verifying When faced with uncertain context, the model fills gaps with assumptions rather than actively retrieving ground truth via tool calls (Read File, Bash, etc.). This introduces bugs instead of fixing them.
  3. Loss of Self-Correction In prior versions, the model proactively caught its own errors before outputting. In v2.1.105, errors are only corrected after the user explicitly points them out — and even then, only the surface issue is patched without re-evaluating broader constraints.
  4. Degraded Instruction Adherence User-defined constraints set within a session (e.g., "produce only one file per turn", "align on format rules before writing") are repeatedly violated within the same session. After correction, the model re-violates the same constraint in the next step.

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/fushihua/.local/share/claude/versions/2.1.104 (expected in multi-process scenarios)\n    at Tc_ (/$bunfs/root/src/entrypoints/cli.js:2836:2153)\n    at Se6 (/$bunfs/root/src/entrypoints/cli.js:2836:1233)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:33:14.722Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/fushihua/Desktop/CrabClaw.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4458:7632)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:34:26.885Z"},{"error":"MaxFileReadTokenExceededError: File content (23893 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 kY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:34:53.982Z"},{"error":"MaxFileReadTokenExceededError: File content (12557 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 kY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:36:19.859Z"},{"error":"Error: EISDIR: illegal operation on a directory, read '/Users/fushihua/Desktop/CrabClaw/CrabCode/crates/acosmi-supervisor/src'\n    at G1H (/$bunfs/root/src/entrypoints/cli.js:3942:15399)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:36:29.205Z"},{"error":"MaxFileReadTokenExceededError: File content (31694 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 kY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:36:34.275Z"},{"error":"MaxFileReadTokenExceededError: File content (11287 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  …
RAW_BUFFERClick to expand / collapse

Bug Description Bug Report: Claude Code v2.1.105 — Model Behavior Regression (Increased Hallucination / Loss of Self-Correction) Version: Claude Code 2.1.105 Model: claude-opus-4-6 (max reasoning depth) Regression Start: After v2.1.100

Description: Since v2.1.100, using claude-opus-4-6 with max reasoning depth, the model has exhibited a significant behavioral regression in the following areas:

  1. Superficial Code Auditing The model no longer performs genuine code-level verification (file-by-file, function-by-function cross-checking). It relies on documents or diff surfaces to draw conclusions, resulting in outputs that contradict the actual state of the codebase.
  2. Guessing Instead of Verifying When faced with uncertain context, the model fills gaps with assumptions rather than actively retrieving ground truth via tool calls (Read File, Bash, etc.). This introduces bugs instead of fixing them.
  3. Loss of Self-Correction In prior versions, the model proactively caught its own errors before outputting. In v2.1.105, errors are only corrected after the user explicitly points them out — and even then, only the surface issue is patched without re-evaluating broader constraints.
  4. Degraded Instruction Adherence User-defined constraints set within a session (e.g., "produce only one file per turn", "align on format rules before writing") are repeatedly violated within the same session. After correction, the model re-violates the same constraint in the next step.

Steps to Reproduce:

Model: claude-opus-4-6 Reasoning depth: max Task type: multi-file codebase refactoring + structured document generation Issue is most pronounced in long-context sessions (500+ exchange work sessions)

Expected Behavior:

Audit steps should actively read source files rather than infer from memory or documentation Session-level constraints should remain enforced throughout the conversation without repeated reminders Model should self-identify when its conclusions conflict with actual file contents and pause to re-verify

Actual Behavior:

Audit conclusions are based on inference and guesswork rather than actual file reads The same constraint requires repeated re-assertion before being respected No proactive self-correction; every error requires the user to manually discover and explicitly flag it

Impact: Multiple bugs have been introduced into the project codebase as a direct result of this regression. The reliability of the model as a coding agent has dropped substantially, shifting the burden of verification back onto the user and defeating the purpose of autonomous code review.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.104
  • Feedback ID: 6901fa31-2108-4221-93a8-61920314cdd1

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/fushihua/.local/share/claude/versions/2.1.104 (expected in multi-process scenarios)\n    at Tc_ (/$bunfs/root/src/entrypoints/cli.js:2836:2153)\n    at Se6 (/$bunfs/root/src/entrypoints/cli.js:2836:1233)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:33:14.722Z"},{"error":"Error: File does not exist. Note: your current working directory is /Users/fushihua/Desktop/CrabClaw.\n    at call (/$bunfs/root/src/entrypoints/cli.js:4458:7632)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:34:26.885Z"},{"error":"MaxFileReadTokenExceededError: File content (23893 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 kY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:34:53.982Z"},{"error":"MaxFileReadTokenExceededError: File content (12557 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 kY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:36:19.859Z"},{"error":"Error: EISDIR: illegal operation on a directory, read '/Users/fushihua/Desktop/CrabClaw/CrabCode/crates/acosmi-supervisor/src'\n    at G1H (/$bunfs/root/src/entrypoints/cli.js:3942:15399)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:36:29.205Z"},{"error":"MaxFileReadTokenExceededError: File content (31694 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 kY7 (/$bunfs/root/src/entrypoints/cli.js:4449:12671)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-13T00:36:34.275Z"},{"error":"MaxFileReadTokenExceededError: File content (11287 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  …

Note: Content was truncated.

extent analysis

TL;DR

The most likely fix involves addressing the MaxFileReadTokenExceededError by implementing a mechanism to read files in chunks or optimizing the file reading process to handle large files.

Guidance

  1. Implement chunked file reading: Modify the code to read files in smaller chunks, using offset and limit parameters, to avoid exceeding the maximum allowed tokens.
  2. Optimize file reading: Review the file reading process to optimize it for handling large files, potentially by searching for specific content instead of reading the whole file.
  3. Error handling: Improve error handling to catch and handle MaxFileReadTokenExceededError and other errors, providing more informative error messages and potentially retrying the operation with adjusted parameters.
  4. Model configuration: Consider adjusting the model's configuration, such as the maximum reasoning depth or the file reading limits, to better handle large files and complex tasks.
  5. Verify model behavior: Thoroughly test the model's behavior after implementing these changes to ensure that it correctly handles file reading and auditing tasks.

Example

// Example of reading a file in chunks
{
  "readFile": {
    "filePath": "/path/to/file",
    "offset": 0,
    "limit": 10000
  }
}

Notes

The provided error logs indicate that the model is encountering issues with reading large files, which may be related to the MaxFileReadTokenExceededError. Addressing this error and optimizing the file reading process may help resolve the regression issues.

Recommendation

Apply a workaround by implementing chunked file reading and optimizing the file reading process to handle large files, as this is likely to address the root cause of the regression issues.

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

claude-code - 💡(How to fix) Fix [Bug] claude-opus-4-6: Model behavior regression - hallucination and lost self-correction in code auditing [1 comments, 2 participants]