claude-code - 💡(How to fix) Fix [Bug] Claude Code repeatedly requests permissions and forgets environment variables across sessions

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…

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/malcolm.titchmarsh/.local/share/claude/versions/2.1.81 (expected in multi-process scenarios)\n at TET (/$bunfs/root/src/entrypoints/cli.js:2724:2174)\n at fgq (/$bunfs/root/src/entrypoints/cli.js:2724:1318)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T06:29:51.962Z"},{"error":"Error: Request was aborted.\n at w0T (/$bunfs/root/src/entrypoints/cli.js:1907:8297)\n at next (native:1:11)\n at B29 (/$bunfs/root/src/entrypoints/cli.js:7276:7438)\n at next (native:1:11)\n at c29 (/$bunfs/root/src/entrypoints/cli.js:7281:10008)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T12:59:48.743Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:13364)\n at emit (node:events:92:22)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:78:3321)\n at request (/$bunfs/root/src/entrypoints/cli.js:81:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T13:27:57.065Z"},{"error":"Error: {"message":"Operation timed out.","originalLine":"138","originalColumn":"156250","line":"138","column":"156250","sourceURL":"/$bunfs/root/src/entrypoints/cli.js","stack":"Error: Operation timed out.\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:138:156250)","name":"Error"}\n at error (/$bunfs/root/src/entrypoints/cli.js:2670:27423)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:138:85385)\n at pz4 (/$bunfs/root/src/entrypoints/cli.js:138:85929)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:139:16930)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T13:27:57.114Z"},{"error":"Error: 1P event logging: 11 events failed to export (code=ECONNABORTED, timeout of 10000ms exceeded)\n at queueFailedEvents (/$bunfs/root/src/entrypoints/cli.js:397:2687)\n at async doExport (/$bunfs/root/src/entrypoints/cli.js:397:1559)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T13:27:57.166Z"},{"error":"Error: {"message":"Failed to export 11 events (code=ECONNABORTED, timeout of 10000ms exceeded)","originalLine":"397","originalColumn":"1710","line":"397","column":"1710","sourceURL":"/$bunfs/root/src/entrypoints/cli.js","stack":"Error: Failed to export 11 events (code=ECONNABORTED, timeout of 10000ms exceeded)\n at doExport (/$bunfs/root/src/entrypoints/cli.js:397:1710)\n at processTicksAndRejections (native:7:39)","name":"Error"}\n at error (/$bunfs/root/src/entrypoints/cli.js:2670:27423)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:138:85385)\n at pz4 (/$bunfs/root/src/entrypoints/cli.js:138:85929)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:139:17366)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T13:27:57.171Z"},{"error":"MaxFileReadTokenExceededError: File content (35805 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 gT9 (/$bunfs/root/src/entrypoints/cli.js:4312:23670)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T14:06:04.924Z"},{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:244:3940)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T14:52:42.618Z"},{"error":"Error: 429 {"type":"error","error":{"type":"rate_limit_error","message":"This request would exceed your account's rate limit. Please try again later."},"request_id":"req_011CaFEamk4XbFEtr3AiTS13"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:205:286312)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:244:5435)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T15:09:33.300Z"},{"…

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/malcolm.titchmarsh/.local/share/claude/versions/2.1.81 (expected in multi-process scenarios)\n    at TET (/$bunfs/root/src/entrypoints/cli.js:2724:2174)\n    at fgq (/$bunfs/root/src/entrypoints/cli.js:2724:1318)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T06:29:51.962Z"},{"error":"Error: Request was aborted.\n    at w0T (/$bunfs/root/src/entrypoints/cli.js:1907:8297)\n    at next (native:1:11)\n    at B29 (/$bunfs/root/src/entrypoints/cli.js:7276:7438)\n    at next (native:1:11)\n    at c29 (/$bunfs/root/src/entrypoints/cli.js:7281:10008)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T12:59:48.743Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:13364)\n    at emit (node:events:92:22)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:78:3321)\n    at request (/$bunfs/root/src/entrypoints/cli.js:81:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T13:27:57.065Z"},{"error":"Error: {\"message\":\"Operation timed out.\",\"originalLine\":\"138\",\"originalColumn\":\"156250\",\"line\":\"138\",\"column\":\"156250\",\"sourceURL\":\"/$bunfs/root/src/entrypoints/cli.js\",\"stack\":\"Error: Operation timed out.\\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:138:156250)\",\"name\":\"Error\"}\n    at error (/$bunfs/root/src/entrypoints/cli.js:2670:27423)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:138:85385)\n    at pz4 (/$bunfs/root/src/entrypoints/cli.js:138:85929)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:139:16930)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T13:27:57.114Z"},{"error":"Error: 1P event logging: 11 events failed to export (code=ECONNABORTED, timeout of 10000ms exceeded)\n    at queueFailedEvents (/$bunfs/root/src/entrypoints/cli.js:397:2687)\n    at async doExport (/$bunfs/root/src/entrypoints/cli.js:397:1559)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T13:27:57.166Z"},{"error":"Error: {\"message\":\"Failed to export 11 events (code=ECONNABORTED, timeout of 10000ms exceeded)\",\"originalLine\":\"397\",\"originalColumn\":\"1710\",\"line\":\"397\",\"column\":\"1710\",\"sourceURL\":\"/$bunfs/root/src/entrypoints/cli.js\",\"stack\":\"Error: Failed to export 11 events (code=ECONNABORTED, timeout of 10000ms exceeded)\\n    at doExport (/$bunfs/root/src/entrypoints/cli.js:397:1710)\\n    at processTicksAndRejections (native:7:39)\",\"name\":\"Error\"}\n    at error (/$bunfs/root/src/entrypoints/cli.js:2670:27423)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:138:85385)\n    at pz4 (/$bunfs/root/src/entrypoints/cli.js:138:85929)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:139:17366)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T13:27:57.171Z"},{"error":"MaxFileReadTokenExceededError: File content (35805 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 gT9 (/$bunfs/root/src/entrypoints/cli.js:4312:23670)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T14:06:04.924Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:244:3940)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T14:52:42.618Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaFEamk4XbFEtr3AiTS13\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:205:286312)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:244:5435)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T15:09:33.300Z"},{"…
RAW_BUFFERClick to expand / collapse

Bug Description Whenever tests are run I need to use environment variables. Claude keeps forgetting this. I am also prompted to give permission for grepping results for tests. It makes it impossible to be AFK and leave it running. I've asked claude to asjust permissions but it keeps asking. Also it has taken well over an hour and used lots of extra tokens to change a few files. This exprerience feels a lot worse than a few weeks back. I was 100% taken with Claude code but am starting to have second thoughts.

Environment Info

  • Platform: darwin
  • Terminal: intellij
  • Version: 2.1.81
  • Feedback ID: 5a3a44de-dd4c-4c5f-bac5-36f184d5654b

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/malcolm.titchmarsh/.local/share/claude/versions/2.1.81 (expected in multi-process scenarios)\n    at TET (/$bunfs/root/src/entrypoints/cli.js:2724:2174)\n    at fgq (/$bunfs/root/src/entrypoints/cli.js:2724:1318)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T06:29:51.962Z"},{"error":"Error: Request was aborted.\n    at w0T (/$bunfs/root/src/entrypoints/cli.js:1907:8297)\n    at next (native:1:11)\n    at B29 (/$bunfs/root/src/entrypoints/cli.js:7276:7438)\n    at next (native:1:11)\n    at c29 (/$bunfs/root/src/entrypoints/cli.js:7281:10008)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T12:59:48.743Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:79:13364)\n    at emit (node:events:92:22)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:78:3321)\n    at request (/$bunfs/root/src/entrypoints/cli.js:81:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T13:27:57.065Z"},{"error":"Error: {\"message\":\"Operation timed out.\",\"originalLine\":\"138\",\"originalColumn\":\"156250\",\"line\":\"138\",\"column\":\"156250\",\"sourceURL\":\"/$bunfs/root/src/entrypoints/cli.js\",\"stack\":\"Error: Operation timed out.\\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:138:156250)\",\"name\":\"Error\"}\n    at error (/$bunfs/root/src/entrypoints/cli.js:2670:27423)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:138:85385)\n    at pz4 (/$bunfs/root/src/entrypoints/cli.js:138:85929)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:139:16930)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T13:27:57.114Z"},{"error":"Error: 1P event logging: 11 events failed to export (code=ECONNABORTED, timeout of 10000ms exceeded)\n    at queueFailedEvents (/$bunfs/root/src/entrypoints/cli.js:397:2687)\n    at async doExport (/$bunfs/root/src/entrypoints/cli.js:397:1559)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T13:27:57.166Z"},{"error":"Error: {\"message\":\"Failed to export 11 events (code=ECONNABORTED, timeout of 10000ms exceeded)\",\"originalLine\":\"397\",\"originalColumn\":\"1710\",\"line\":\"397\",\"column\":\"1710\",\"sourceURL\":\"/$bunfs/root/src/entrypoints/cli.js\",\"stack\":\"Error: Failed to export 11 events (code=ECONNABORTED, timeout of 10000ms exceeded)\\n    at doExport (/$bunfs/root/src/entrypoints/cli.js:397:1710)\\n    at processTicksAndRejections (native:7:39)\",\"name\":\"Error\"}\n    at error (/$bunfs/root/src/entrypoints/cli.js:2670:27423)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:138:85385)\n    at pz4 (/$bunfs/root/src/entrypoints/cli.js:138:85929)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:139:17366)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T13:27:57.171Z"},{"error":"MaxFileReadTokenExceededError: File content (35805 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 gT9 (/$bunfs/root/src/entrypoints/cli.js:4312:23670)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T14:06:04.924Z"},{"error":"Error: Request was aborted.\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:244:3940)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T14:52:42.618Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaFEamk4XbFEtr3AiTS13\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:205:286312)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:244:5435)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-20T15:09:33.300Z"},{"…

Note: Content was truncated.

extent analysis

TL;DR

The most likely fix is to adjust the environment variables and permissions to prevent repeated prompts and timeouts, and to optimize file reading to avoid exceeding the maximum allowed tokens.

Guidance

  • Review and adjust environment variables to ensure they are set correctly for tests, reducing the need for repeated prompts.
  • Verify permissions for grepping results to prevent permission-related errors and timeouts.
  • Optimize file reading by using offset and limit parameters to read specific portions of files, rather than reading entire files and exceeding the maximum allowed tokens (25000).
  • Consider implementing retry logic or increasing timeouts to handle temporary connection issues and rate limits.

Example

No specific code example can be provided without more context, but adjusting environment variables might involve setting them in a .env file or through the terminal before running tests.

Notes

The provided error messages and stack traces suggest a variety of issues, including timeouts, connection aborts, and rate limits. Without more specific information about the code and environment, it's challenging to provide a precise solution. The suggestions above aim to address the most apparent issues.

Recommendation

Apply workaround: Adjust environment variables, permissions, and file reading strategies to mitigate the issues described, as the problem seems to stem from configuration and usage rather than a version-specific bug that could be fixed by upgrading.

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 Code repeatedly requests permissions and forgets environment variables across sessions