[BUG] Interactive CLI silently exits after successful Bash tool result; session resumes normally

Open 💬 1 comment Opened Jul 10, 2026 by zarrddd

Claude Code silent exit after successful Bash tool result

Preflight

  • [x] Searched existing issues; the closest report is #62202, but that is a deterministic Desktop/VS Code wrapper SIGTERM every five minutes. This event was a one-off interactive terminal CLI exit after roughly three days of uptime, with no recorded SIGTERM or exit code.
  • [x] This report contains one issue.
  • [ ] The affected process was Claude Code 2.1.201. A newer 2.1.205 binary is bundled with Claude Desktop on the same Mac, but the Homebrew-linked interactive CLI was not upgraded during the affected long-running session.
  • [x] No private source code, credentials, customer/company names, private URLs, local usernames, or full session transcript are included.

What's wrong?

An interactive Claude Code process silently exited to the shell immediately after a successful Bash tool result. The terminal displayed no Claude Code error, crash text, or reason for exit. The user did not request /exit and had to manually resume the session.

The affected CLI process had been running for approximately three days. The persisted transcript was about 4.6 MB and later request metadata showed a very large context/cache footprint (roughly 492k cache-creation input tokens). This may be relevant, but no root cause is asserted.

Timeline (CST, UTC+8)

  • 13:34:09 — Claude Code invoked a Bash tool for a local integration test.
  • 13:34:17 — Bash returned successfully with the expected test output and exit status; the session transcript contains this tool result.
  • 13:34:45.889 — macOS unified log shows claude.exe entering its CoreAnalytics exit handler, cancelling its own XPC connection, and closing network connections.
  • No .ips DiagnosticReport was created. No Jetsam, memory-pressure kill, SIGKILL, crash, or fatal exception was found for this process.
  • 13:35:41 — the user manually ran claude --resume <redacted-session-id>; the same persisted session recovered and continued.

The transcript contains no assistant response or explicit error between the successful tool result and process termination.

Expected behavior

After a successful tool result, the interactive process should continue the assistant turn and remain open. If Claude Code must terminate, it should show and persist an actionable reason and exit code.

Sanitized evidence

Successful final tool result:

health: ok
integration checks returned expected structured responses
done
0 load failures

Relevant macOS unified-log events:

2026-07-10 13:34:45.889 claude.exe: Entering exit handler.
2026-07-10 13:34:45.890 claude.exe: current process cancelled the XPC connection.
2026-07-10 13:34:45.891 system services: connection invalidated because client process cancelled or exited.
2026-07-10 13:34:45.920 mDNSResponder: DNSServiceCreateConnection STOP for claude.exe.

There was no matching crash report or macOS forced-termination record.

Steps to reproduce

The issue has occurred once and is not yet deterministic:

  1. Keep an interactive Claude Code terminal session open for multiple days.
  2. Let the persisted transcript and tool history grow substantially (in this case about 4.6 MB, with a later request showing about 492k cached input tokens).
  3. Run an ordinary Bash tool that starts a local test server, performs several HTTP requests, stops that server, and returns normally.
  4. Observe that after the successful tool result the Claude Code process may exit silently to the shell.
  5. Run claude --resume <session-id>; the same session can be recovered.

Environment

  • Claude Code: 2.1.201
  • Model metadata: claude-fable-5, xhigh effort
  • Platform: Anthropic account/API
  • OS: macOS 15.5 (24F74)
  • Hardware: Apple Mac16,7, 48 GB RAM
  • Terminal: iTerm2 3.6.10
  • Shell: zsh
  • Invocation: interactive claude --dangerously-skip-permissions
  • Plugins/MCP servers: enabled; exact private configuration omitted

Regression

Unknown. This is the first observed occurrence.

Related but not duplicate

  • #62202 reports exit code 143 every exactly five minutes in the Desktop/VS Code wrapper. This report concerns a terminal CLI process after roughly three days of uptime; no 143/SIGTERM evidence or periodic pattern was observed.
  • #1757 concerns repeated authentication prompts. Although the user manually restarted/resumed after this event, logs do not establish authentication expiry as the cause.

Requested diagnostics improvement

Please persist a final structured termination event containing the trigger, exit code/signal, current session ID hash, last completed tool type, and whether termination was requested by the user. A silent normal-looking teardown leaves no reliable way to distinguish an internal exit path from an external signal.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗