claude-code - 💡(How to fix) Fix [Bug] Claude model performance below expected parameters in session [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#56304Fetched 2026-05-06 06:31:39
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×5

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/mirela/.local/share/claude/versions/2.1.119 (expected in multi-process scenarios)\n at mH6 (/$bunfs/root/src/entrypoints/cli.js:2736:2177)\n at E$8 (/$bunfs/root/src/entrypoints/cli.js:2736:1257)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T11:53:42.689Z"},{"error":"Error: 1: Command failed with ERR_STREAM_PREMATURE_CLOSE: code --force --install-extension anthropic.claude-code\nPremature close \n at vp1 (/$bunfs/root/src/entrypoints/cli.js:1687:4046)\n at async Lp1 (/$bunfs/root/src/entrypoints/cli.js:1687:1435)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T11:53:43.945Z"},{"error":"MaxFileReadTokenExceededError: File content (61632 tokens) exceeds maximum allowed tokens (25000). 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 qC7 (/$bunfs/root/src/entrypoints/cli.js:4789:12701)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T13:05:34.591Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (9 -> 9 messages). Message structure: [0] user; [1] assistant(id=msg_01FmVmEF99Hboy5yTXTnia9J, tool_uses=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [2] user(tool_results=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [3] assistant(id=msg_01ANTh5ZFQdSzycm8s5pmYJi, tool_uses=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [4] user(tool_results=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [5] assistant(id=msg_0123MGZdSwHxi6JS9upY2ELQ, tool_uses=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [6] user(tool_results=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [7] assistant(id=msg_01JHVRGv4xCi95BN7GMT1WB4, tool_uses=[toolu_01VrNMaVyBwjF4EHTUQn3xrP]); [8] user\n at Um7 (/$bunfs/root/src/entrypoints/cli.js:5310:10250)\n at V$K (/$bunfs/root/src/entrypoints/cli.js:8836:10173)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T13:13:35.994Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (11 -> 11 messages). Message structure: [0] user; [1] assistant(id=msg_01FmVmEF99Hboy5yTXTnia9J, tool_uses=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [2] user(tool_results=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [3] assistant(id=msg_01ANTh5ZFQdSzycm8s5pmYJi, tool_uses=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [4] user(tool_results=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [5] assistant(id=msg_0123MGZdSwHxi6JS9upY2ELQ, tool_uses=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [6] user(tool_results=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [7] assistant(id=msg_01JHVRGv4xCi95BN7GMT1WB4, tool_uses=[toolu_01VrNMaVyBwjF4EHTUQn3xrP]); [8] user; [9] assistant(id=c4e6fff5-f4e6-4ab3-af75-a1019aa733bf, tool_uses=[]); [10] user\n at Um7 (/$bunfs/root/src/entrypoints/cli.js:5310:10250)\n at V$K (/$bunfs/root/src/entrypoints/cli.js:8836:10173)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T13:16:45.091Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (13 -> 13 messages). Message structure: [0] user; [1] assistant(id=msg_01FmVmEF99Hboy5yTXTnia9J, tool_uses=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [2] user(tool_results=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [3] assistant(id=msg_01ANTh5ZFQdSzycm8s5pmYJi, tool_uses=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [4] user(tool_results=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [5] assistant(id=msg_0123MGZdSwHxi6JS9upY2ELQ, tool_uses=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [6] user(tool_results=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [7] assistant(id=msg_01JHVRGv4xCi95BN7GMT1WB4, tool_uses=[toolu_01VrNMaVyBwjF4EHTUQn3xrP]); [8] user; [9] assistant(id=4b87d77a-f568-4b63-ba1a-5775960b7091, tool_uses=[]); [10] user; [11] assistant(id=74a2f118-d83e-4939-a178-35bd229272bc, tool_uses=[]); [12] user\n at Um7 (/$bunfs/root/src/entrypoints/cli.js:5310:10250)\n at V$K (/$bunfs/root/src/entrypoints/cli.js:8836:10173)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T13:20:28.674Z"}]

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/mirela/.local/share/claude/versions/2.1.119 (expected in multi-process scenarios)\n    at mH6 (/$bunfs/root/src/entrypoints/cli.js:2736:2177)\n    at E$8 (/$bunfs/root/src/entrypoints/cli.js:2736:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T11:53:42.689Z"},{"error":"Error: 1: Command failed with ERR_STREAM_PREMATURE_CLOSE: code --force --install-extension anthropic.claude-code\nPremature close \n    at vp1 (/$bunfs/root/src/entrypoints/cli.js:1687:4046)\n    at async Lp1 (/$bunfs/root/src/entrypoints/cli.js:1687:1435)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T11:53:43.945Z"},{"error":"MaxFileReadTokenExceededError: File content (61632 tokens) exceeds maximum allowed tokens (25000). 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 qC7 (/$bunfs/root/src/entrypoints/cli.js:4789:12701)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T13:05:34.591Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (9 -> 9 messages). Message structure: [0] user; [1] assistant(id=msg_01FmVmEF99Hboy5yTXTnia9J, tool_uses=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [2] user(tool_results=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [3] assistant(id=msg_01ANTh5ZFQdSzycm8s5pmYJi, tool_uses=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [4] user(tool_results=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [5] assistant(id=msg_0123MGZdSwHxi6JS9upY2ELQ, tool_uses=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [6] user(tool_results=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [7] assistant(id=msg_01JHVRGv4xCi95BN7GMT1WB4, tool_uses=[toolu_01VrNMaVyBwjF4EHTUQn3xrP]); [8] user\n    at Um7 (/$bunfs/root/src/entrypoints/cli.js:5310:10250)\n    at V$K (/$bunfs/root/src/entrypoints/cli.js:8836:10173)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T13:13:35.994Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (11 -> 11 messages). Message structure: [0] user; [1] assistant(id=msg_01FmVmEF99Hboy5yTXTnia9J, tool_uses=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [2] user(tool_results=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [3] assistant(id=msg_01ANTh5ZFQdSzycm8s5pmYJi, tool_uses=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [4] user(tool_results=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [5] assistant(id=msg_0123MGZdSwHxi6JS9upY2ELQ, tool_uses=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [6] user(tool_results=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [7] assistant(id=msg_01JHVRGv4xCi95BN7GMT1WB4, tool_uses=[toolu_01VrNMaVyBwjF4EHTUQn3xrP]); [8] user; [9] assistant(id=c4e6fff5-f4e6-4ab3-af75-a1019aa733bf, tool_uses=[]); [10] user\n    at Um7 (/$bunfs/root/src/entrypoints/cli.js:5310:10250)\n    at V$K (/$bunfs/root/src/entrypoints/cli.js:8836:10173)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T13:16:45.091Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (13 -> 13 messages). Message structure: [0] user; [1] assistant(id=msg_01FmVmEF99Hboy5yTXTnia9J, tool_uses=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [2] user(tool_results=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [3] assistant(id=msg_01ANTh5ZFQdSzycm8s5pmYJi, tool_uses=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [4] user(tool_results=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [5] assistant(id=msg_0123MGZdSwHxi6JS9upY2ELQ, tool_uses=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [6] user(tool_results=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [7] assistant(id=msg_01JHVRGv4xCi95BN7GMT1WB4, tool_uses=[toolu_01VrNMaVyBwjF4EHTUQn3xrP]); [8] user; [9] assistant(id=4b87d77a-f568-4b63-ba1a-5775960b7091, tool_uses=[]); [10] user; [11] assistant(id=74a2f118-d83e-4939-a178-35bd229272bc, tool_uses=[]); [12] user\n    at Um7 (/$bunfs/root/src/entrypoints/cli.js:5310:10250)\n    at V$K (/$bunfs/root/src/entrypoints/cli.js:8836:10173)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T13:20:28.674Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description Report finding on session and on the fact that claude performed under the expected parameters

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.119
  • Feedback ID: b956855b-eb2d-4eac-8ea6-5da574c7dd0b

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/mirela/.local/share/claude/versions/2.1.119 (expected in multi-process scenarios)\n    at mH6 (/$bunfs/root/src/entrypoints/cli.js:2736:2177)\n    at E$8 (/$bunfs/root/src/entrypoints/cli.js:2736:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T11:53:42.689Z"},{"error":"Error: 1: Command failed with ERR_STREAM_PREMATURE_CLOSE: code --force --install-extension anthropic.claude-code\nPremature close \n    at vp1 (/$bunfs/root/src/entrypoints/cli.js:1687:4046)\n    at async Lp1 (/$bunfs/root/src/entrypoints/cli.js:1687:1435)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T11:53:43.945Z"},{"error":"MaxFileReadTokenExceededError: File content (61632 tokens) exceeds maximum allowed tokens (25000). 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 qC7 (/$bunfs/root/src/entrypoints/cli.js:4789:12701)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T13:05:34.591Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (9 -> 9 messages). Message structure: [0] user; [1] assistant(id=msg_01FmVmEF99Hboy5yTXTnia9J, tool_uses=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [2] user(tool_results=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [3] assistant(id=msg_01ANTh5ZFQdSzycm8s5pmYJi, tool_uses=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [4] user(tool_results=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [5] assistant(id=msg_0123MGZdSwHxi6JS9upY2ELQ, tool_uses=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [6] user(tool_results=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [7] assistant(id=msg_01JHVRGv4xCi95BN7GMT1WB4, tool_uses=[toolu_01VrNMaVyBwjF4EHTUQn3xrP]); [8] user\n    at Um7 (/$bunfs/root/src/entrypoints/cli.js:5310:10250)\n    at V$K (/$bunfs/root/src/entrypoints/cli.js:8836:10173)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T13:13:35.994Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (11 -> 11 messages). Message structure: [0] user; [1] assistant(id=msg_01FmVmEF99Hboy5yTXTnia9J, tool_uses=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [2] user(tool_results=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [3] assistant(id=msg_01ANTh5ZFQdSzycm8s5pmYJi, tool_uses=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [4] user(tool_results=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [5] assistant(id=msg_0123MGZdSwHxi6JS9upY2ELQ, tool_uses=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [6] user(tool_results=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [7] assistant(id=msg_01JHVRGv4xCi95BN7GMT1WB4, tool_uses=[toolu_01VrNMaVyBwjF4EHTUQn3xrP]); [8] user; [9] assistant(id=c4e6fff5-f4e6-4ab3-af75-a1019aa733bf, tool_uses=[]); [10] user\n    at Um7 (/$bunfs/root/src/entrypoints/cli.js:5310:10250)\n    at V$K (/$bunfs/root/src/entrypoints/cli.js:8836:10173)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T13:16:45.091Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (13 -> 13 messages). Message structure: [0] user; [1] assistant(id=msg_01FmVmEF99Hboy5yTXTnia9J, tool_uses=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [2] user(tool_results=[toolu_01C7P3FHt7btNy82DHLfcJxv]); [3] assistant(id=msg_01ANTh5ZFQdSzycm8s5pmYJi, tool_uses=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [4] user(tool_results=[toolu_01RVHK194tDUz8cTNtkTRoLa]); [5] assistant(id=msg_0123MGZdSwHxi6JS9upY2ELQ, tool_uses=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [6] user(tool_results=[toolu_01U7vPWKiXMiFGVZ7zirrZNP]); [7] assistant(id=msg_01JHVRGv4xCi95BN7GMT1WB4, tool_uses=[toolu_01VrNMaVyBwjF4EHTUQn3xrP]); [8] user; [9] assistant(id=4b87d77a-f568-4b63-ba1a-5775960b7091, tool_uses=[]); [10] user; [11] assistant(id=74a2f118-d83e-4939-a178-35bd229272bc, tool_uses=[]); [12] user\n    at Um7 (/$bunfs/root/src/entrypoints/cli.js:5310:10250)\n    at V$K (/$bunfs/root/src/entrypoints/cli.js:8836:10173)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-05T13:20:28.674Z"}]

extent analysis

TL;DR

The most likely fix involves addressing the MaxFileReadTokenExceededError by implementing pagination or filtering to reduce the file content tokens below the 25000 limit.

Guidance

  • Investigate the MaxFileReadTokenExceededError and consider using offset and limit parameters to read specific portions of the file.
  • Review the error messages related to ensureToolResultPairing and verify that the message structure is correctly paired between user and assistant interactions.
  • Check the file content size and adjust the reading approach to avoid exceeding the token limit.
  • Consider updating the code to handle premature close errors and lock acquisition failures.

Example

No specific code example can be provided without more context, but the solution may involve modifying the file reading logic to include pagination or filtering, such as:

// Pseudocode example
const fileContent = await readFileWithPagination(filePath, {
  offset: 0,
  limit: 25000
});

Notes

The provided error messages suggest issues with file reading, tool result pairing, and lock acquisition. However, without more context or information about the codebase, it's challenging to provide a specific solution.

Recommendation

Apply a workaround by implementing pagination or filtering to reduce the file content tokens, as this is the most explicit error message with a clear solution path.

FAIL-SAFE

Given the limited information, the primary focus should be on addressing the MaxFileReadTokenExceededError by adjusting the file reading approach to stay within the token limit.

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 model performance below expected parameters in session [1 participants]