claude-code - 💡(How to fix) Fix [Bug] Pasted text lost when prompt truncated; hidden line count inaccurate [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#55617Fetched 2026-05-03 04:48:47
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/KevinHG/.local/share/claude/versions/2.1.122 (expected in multi-process scenarios)\n at m_8 (/$bunfs/root/src/entrypoints/cli.js:2769:2177)\n at YD_ (/$bunfs/root/src/entrypoints/cli.js:2769:1257)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:39:30.054Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server greptile invalid: Missing environment variables: GREPTILE_API_KEY\n at oGH (/$bunfs/root/src/entrypoints/cli.js:2769:32905)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:39:30.165Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server greptile invalid: Missing environment variables: GREPTILE_API_KEY\n at oGH (/$bunfs/root/src/entrypoints/cli.js:2769:32905)\n at async v (/$bunfs/root/src/entrypoints/cli.js:6355:12696)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:39:31.675Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server greptile invalid: Missing environment variables: GREPTILE_API_KEY\n at oGH (/$bunfs/root/src/entrypoints/cli.js:2769:32905)\n at async V (/$bunfs/root/src/entrypoints/cli.js:6355:11810)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:39:31.692Z"},{"error":"Error: console.error: [bun] Warning: ws.WebSocket 'unexpected-response' event is not implemented in bun\n at q (/$bunfs/root/src/entrypoints/cli.js:545:12024)\n at emitWarning (ws:43:42)\n at #onOrOnce (ws:170:18)\n at YO8 (/$bunfs/root/src/entrypoints/cli.js:7607:4503)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:05:20.278Z"},{"error":"Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 202152 tokens > 200000 maximum"},"request_id":"req_011CaXXVjCB1zfS3CruX1V65"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:57693)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:40:52.122Z"},{"error":"MaxFileReadTokenExceededError: File content (59192 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 qm1 (/$bunfs/root/src/entrypoints/cli.js:4852:12789)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:45:55.580Z"},{"error":"MaxFileReadTokenExceededError: File content (61888 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 qm1 (/$bunfs/root/src/entrypoints/cli.js:4852:12789)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:45:56.240Z"},{"error":"Error: LSP server plugin:pyright-lsp:pyright failed to start: Executable not found in $PATH: "pyright-langserver"\n at start (/$bunfs/root/src/entrypoints/cli.js:3201:22360)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T06:50:22.903Z"},{"error":"Error: Executable not found in $PATH: "pyright-langserver"\n at spawn (unknown)\n at spawn (node:child_process:667:35)\n at spawn (node:child_process:14:39)\n at start (/$bunfs/root/src/entrypoints/cli.js:3201:20896)\n at O (/$bunfs/root/src/entrypoints/cli.js:3201:24879)\n at $ (/$bunfs/root/src/entrypoints/cli.js:3201:30119)\n at Y (/$bunfs/root/src/entrypoints/cli.js:3201:30504)\n at w (/$bunfs/root/src/entrypoints/cli.js:3201:31063)\n at call (/$bunfs/root/src/entrypoints/cli.js:3224:889)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T06:50:22.907Z"},{"error":"Error: Failed to start LSP server for file /tmp/fetch_pensive_sample.py: Executable not found in $PATH: "pyright-langserver"\n at $ (/$bunfs/root/src/entrypoints/cli.js:3201:30145)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T06:50:22.908Z"},{"error":"Error: Executable…

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/KevinHG/.local/share/claude/versions/2.1.122 (expected in multi-process scenarios)\n    at m_8 (/$bunfs/root/src/entrypoints/cli.js:2769:2177)\n    at YD_ (/$bunfs/root/src/entrypoints/cli.js:2769:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:39:30.054Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server greptile invalid: Missing environment variables: GREPTILE_API_KEY\n    at oGH (/$bunfs/root/src/entrypoints/cli.js:2769:32905)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:39:30.165Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server greptile invalid: Missing environment variables: GREPTILE_API_KEY\n    at oGH (/$bunfs/root/src/entrypoints/cli.js:2769:32905)\n    at async v (/$bunfs/root/src/entrypoints/cli.js:6355:12696)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:39:31.675Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server greptile invalid: Missing environment variables: GREPTILE_API_KEY\n    at oGH (/$bunfs/root/src/entrypoints/cli.js:2769:32905)\n    at async V (/$bunfs/root/src/entrypoints/cli.js:6355:11810)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:39:31.692Z"},{"error":"Error: console.error: [bun] Warning: ws.WebSocket 'unexpected-response' event is not implemented in bun\n    at q (/$bunfs/root/src/entrypoints/cli.js:545:12024)\n    at emitWarning (ws:43:42)\n    at #onOrOnce (ws:170:18)\n    at YO8 (/$bunfs/root/src/entrypoints/cli.js:7607:4503)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:05:20.278Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 202152 tokens > 200000 maximum\"},\"request_id\":\"req_011CaXXVjCB1zfS3CruX1V65\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57693)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:40:52.122Z"},{"error":"MaxFileReadTokenExceededError: File content (59192 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 qm1 (/$bunfs/root/src/entrypoints/cli.js:4852:12789)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:45:55.580Z"},{"error":"MaxFileReadTokenExceededError: File content (61888 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 qm1 (/$bunfs/root/src/entrypoints/cli.js:4852:12789)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:45:56.240Z"},{"error":"Error: LSP server plugin:pyright-lsp:pyright failed to start: Executable not found in $PATH: \"pyright-langserver\"\n    at start (/$bunfs/root/src/entrypoints/cli.js:3201:22360)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T06:50:22.903Z"},{"error":"Error: Executable not found in $PATH: \"pyright-langserver\"\n    at spawn (unknown)\n    at spawn (node:child_process:667:35)\n    at spawn (node:child_process:14:39)\n    at start (/$bunfs/root/src/entrypoints/cli.js:3201:20896)\n    at O (/$bunfs/root/src/entrypoints/cli.js:3201:24879)\n    at $ (/$bunfs/root/src/entrypoints/cli.js:3201:30119)\n    at Y (/$bunfs/root/src/entrypoints/cli.js:3201:30504)\n    at w (/$bunfs/root/src/entrypoints/cli.js:3201:31063)\n    at call (/$bunfs/root/src/entrypoints/cli.js:3224:889)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T06:50:22.907Z"},{"error":"Error: Failed to start LSP server for file /tmp/fetch_pensive_sample.py: Executable not found in $PATH: \"pyright-langserver\"\n    at $ (/$bunfs/root/src/entrypoints/cli.js:3201:30145)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T06:50:22.908Z"},{"error":"Error: Executable…
RAW_BUFFERClick to expand / collapse

Bug Description If the CLI truncates my extra long prompt and I have pasted text in that wasn't expanded. Like it does the [[Pasted text #15 +2 lines] + (7 lines hidden) That pasted text is lost. Claude cannot see it. Also, that number of hidden lines is never right. I definitely had, like, 40 lines hidden. I get that it's probably using like, a very wide window for the estimation. Or, actually, I don't know how it works, but I've also seen before zero lines, which is wild.

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.1.122
  • Feedback ID: abbe80a7-c444-45ee-b0dc-69959a816d60

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/KevinHG/.local/share/claude/versions/2.1.122 (expected in multi-process scenarios)\n    at m_8 (/$bunfs/root/src/entrypoints/cli.js:2769:2177)\n    at YD_ (/$bunfs/root/src/entrypoints/cli.js:2769:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:39:30.054Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server greptile invalid: Missing environment variables: GREPTILE_API_KEY\n    at oGH (/$bunfs/root/src/entrypoints/cli.js:2769:32905)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:39:30.165Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server greptile invalid: Missing environment variables: GREPTILE_API_KEY\n    at oGH (/$bunfs/root/src/entrypoints/cli.js:2769:32905)\n    at async v (/$bunfs/root/src/entrypoints/cli.js:6355:12696)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:39:31.675Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server greptile invalid: Missing environment variables: GREPTILE_API_KEY\n    at oGH (/$bunfs/root/src/entrypoints/cli.js:2769:32905)\n    at async V (/$bunfs/root/src/entrypoints/cli.js:6355:11810)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T02:39:31.692Z"},{"error":"Error: console.error: [bun] Warning: ws.WebSocket 'unexpected-response' event is not implemented in bun\n    at q (/$bunfs/root/src/entrypoints/cli.js:545:12024)\n    at emitWarning (ws:43:42)\n    at #onOrOnce (ws:170:18)\n    at YO8 (/$bunfs/root/src/entrypoints/cli.js:7607:4503)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:05:20.278Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 202152 tokens > 200000 maximum\"},\"request_id\":\"req_011CaXXVjCB1zfS3CruX1V65\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:57693)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:40:52.122Z"},{"error":"MaxFileReadTokenExceededError: File content (59192 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 qm1 (/$bunfs/root/src/entrypoints/cli.js:4852:12789)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:45:55.580Z"},{"error":"MaxFileReadTokenExceededError: File content (61888 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 qm1 (/$bunfs/root/src/entrypoints/cli.js:4852:12789)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T05:45:56.240Z"},{"error":"Error: LSP server plugin:pyright-lsp:pyright failed to start: Executable not found in $PATH: \"pyright-langserver\"\n    at start (/$bunfs/root/src/entrypoints/cli.js:3201:22360)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T06:50:22.903Z"},{"error":"Error: Executable not found in $PATH: \"pyright-langserver\"\n    at spawn (unknown)\n    at spawn (node:child_process:667:35)\n    at spawn (node:child_process:14:39)\n    at start (/$bunfs/root/src/entrypoints/cli.js:3201:20896)\n    at O (/$bunfs/root/src/entrypoints/cli.js:3201:24879)\n    at $ (/$bunfs/root/src/entrypoints/cli.js:3201:30119)\n    at Y (/$bunfs/root/src/entrypoints/cli.js:3201:30504)\n    at w (/$bunfs/root/src/entrypoints/cli.js:3201:31063)\n    at call (/$bunfs/root/src/entrypoints/cli.js:3224:889)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T06:50:22.907Z"},{"error":"Error: Failed to start LSP server for file /tmp/fetch_pensive_sample.py: Executable not found in $PATH: \"pyright-langserver\"\n    at $ (/$bunfs/root/src/entrypoints/cli.js:3201:30145)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-29T06:50:22.908Z"},{"error":"Error: Executable…

Note: Content was truncated.

extent analysis

TL;DR

The issue can be mitigated by shortening the prompt to within the 200000 token limit or configuring the environment to handle longer prompts.

Guidance

  • Check the length of the prompt and shorten it if necessary to avoid the "prompt is too long" error.
  • Verify that the GREPTILE_API_KEY environment variable is set, as its absence is causing plugin errors.
  • Consider updating the configuration to increase the maximum allowed tokens for file reading, or use offset and limit parameters to read specific portions of the file.
  • Ensure that the pyright-langserver executable is in the system's PATH to resolve the LSP server plugin error.

Example

No code snippet is provided due to the lack of specific code-related issues in the given problem description.

Notes

The provided issue description is truncated, which might limit the ability to identify all potential causes. The errors suggest a mix of issues related to prompt length, environment variables, file reading limits, and executable paths.

Recommendation

Apply a workaround by shortening the prompt and setting the required environment variables, as these are the most direct issues identified in the provided errors.

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] Pasted text lost when prompt truncated; hidden line count inaccurate [1 participants]