claude-code - 💡(How to fix) Fix [Bug] Terminal output from background loops erases Claude conversation history [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#52294Fetched 2026-04-24 06:10:57
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1subscribed ×1

Error Message

[{"error":"Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid authentication credentials"},"request_id":"req_011CaLCV73HwKrGJHntqvTTo"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:54339)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:05:02.447Z"},{"error":"AxiosError: Request failed with status code 400\n at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n at async NiH (/$bunfs/root/src/entrypoints/cli.js:253:275640)\n at async cx6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:11.057Z"},{"error":"AxiosError: Request failed with status code 400\n at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n at async NiH (/$bunfs/root/src/entrypoints/cli.js:253:275640)\n at async cx6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:12.149Z"},{"error":"AxiosError: Request failed with status code 400\n at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n at async NiH (/$bunfs/root/src/entrypoints/cli.js:253:275640)\n at async cx6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:12.380Z"},{"error":"AxiosError: Request failed with status code 400\n at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n at async NiH (/$bunfs/root/src/entrypoints/cli.js:253:275640)\n at async cx6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:13.935Z"},{"error":"Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid authentication credentials"},"request_id":"req_011CaLCjF1QjxaQbv3UgHi7h"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:54339)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:13.962Z"},{"error":"AxiosError: Request failed with status code 401\n at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:13:57.229Z"},{"error":"AxiosError: Request failed with status code 400\n at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAndRejections (native:7:39)\n at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:13:57.357Z"},{"error":"AxiosError: Request failed with status code 400\n at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n at emit (node:events:92:22)\n at endReadableNT (internal:streams/readable:865:50)\n at processTicksAnd…

Code Example

[{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"Invalid authentication credentials\"},\"request_id\":\"req_011CaLCV73HwKrGJHntqvTTo\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:54339)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:05:02.447Z"},{"error":"AxiosError: Request failed with status code 400\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async NiH (/$bunfs/root/src/entrypoints/cli.js:253:275640)\n    at async cx6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:11.057Z"},{"error":"AxiosError: Request failed with status code 400\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async NiH (/$bunfs/root/src/entrypoints/cli.js:253:275640)\n    at async cx6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:12.149Z"},{"error":"AxiosError: Request failed with status code 400\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async NiH (/$bunfs/root/src/entrypoints/cli.js:253:275640)\n    at async cx6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:12.380Z"},{"error":"AxiosError: Request failed with status code 400\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async NiH (/$bunfs/root/src/entrypoints/cli.js:253:275640)\n    at async cx6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:13.935Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"Invalid authentication credentials\"},\"request_id\":\"req_011CaLCjF1QjxaQbv3UgHi7h\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:54339)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:13.962Z"},{"error":"AxiosError: Request failed with status code 401\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:13:57.229Z"},{"error":"AxiosError: Request failed with status code 400\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:13:57.357Z"},{"error":"AxiosError: Request failed with status code 400\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAnd…
RAW_BUFFERClick to expand / collapse

Bug Description Having a loop running in a terminal and have conversation with claude in the same terminal. when the loop fires, it erases claude's output from the conversation i had in the meantime

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.117
  • Feedback ID: 29a80ae4-f66b-4ba6-930c-6f6aa4ea9bb9

Errors

[{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"Invalid authentication credentials\"},\"request_id\":\"req_011CaLCV73HwKrGJHntqvTTo\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:54339)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:05:02.447Z"},{"error":"AxiosError: Request failed with status code 400\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async NiH (/$bunfs/root/src/entrypoints/cli.js:253:275640)\n    at async cx6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:11.057Z"},{"error":"AxiosError: Request failed with status code 400\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async NiH (/$bunfs/root/src/entrypoints/cli.js:253:275640)\n    at async cx6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:12.149Z"},{"error":"AxiosError: Request failed with status code 400\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async NiH (/$bunfs/root/src/entrypoints/cli.js:253:275640)\n    at async cx6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:12.380Z"},{"error":"AxiosError: Request failed with status code 400\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async NiH (/$bunfs/root/src/entrypoints/cli.js:253:275640)\n    at async cx6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:13.935Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"Invalid authentication credentials\"},\"request_id\":\"req_011CaLCjF1QjxaQbv3UgHi7h\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:54339)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:08:13.962Z"},{"error":"AxiosError: Request failed with status code 401\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:13:57.229Z"},{"error":"AxiosError: Request failed with status code 400\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T06:13:57.357Z"},{"error":"AxiosError: Request failed with status code 400\n    at yd (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12752)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAnd…

Note: Content was truncated.

extent analysis

TL;DR

Run the loop and conversation with Claude in separate terminals to prevent output overlap.

Guidance

  • The issue seems to be related to the loop and conversation with Claude running in the same terminal, causing output to be erased.
  • To mitigate this, try running the loop in a separate terminal or process to prevent output conflicts.
  • Check if there are any terminal or shell settings that can be adjusted to handle output from multiple sources simultaneously.
  • Consider using a logging mechanism to preserve output from both the loop and conversation with Claude.

Notes

The provided error messages seem unrelated to the described issue of output being erased, as they appear to be authentication and request errors.

Recommendation

Apply workaround: Run the loop and conversation with Claude in separate terminals to prevent output overlap, as the provided information does not suggest a direct fix for the described issue.

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