ECONNRESET / misleading error when reloading a renamed session (bridge "Epoch mismatch (409)")

Open 💬 0 comments Opened Jul 14, 2026 by mr-mosconi

Description

Reloading a session after renaming it (via the /resume picker) surfaces a confusing ECONNRESET-style error. Debug logs show the actual cause is unrelated to local networking: the session bridge rejects the old connection with a 409 "epoch superseded" once the renamed session registers a new epoch, and the resulting SSE abort is what surfaces to the user as a connection reset.

Steps to reproduce

  1. Start an interactive session (claude).
  2. Rename the session (/resume picker → rename, or -n <name> on launch).
  3. Load / resume that renamed session from another window while the original is still open.
  4. The original window's connection fails with an error the user perceives as ECONNRESET.

Relevant debug log (--debug api,bridge)

23:24:02.415  bridge:repl  Sent control_response for end_session ... result=error
23:24:02.478  ERROR  CCRClient: Epoch mismatch (409), shutting down
23:24:02.479  WARN   CCRClient: client events failed: epoch superseded
23:24:02.494  ERROR  SSETransport: Stream read error: The operation was aborted.
23:24:02.546  ERROR  CCRClient: Epoch mismatch (409), shutting down
23:24:02.547  WARN   CCRClient: delivery batch failed: epoch superseded

A separate, likely-unrelated transient timeout also appeared later in the same log:

23:24:42.289  WARN  CCRClient: client events failed: The operation timed out.

Expected behavior

When a session is superseded by another window (new epoch), the client should surface a clear message like "This session was resumed elsewhere" rather than a raw connection-reset error that reads as a network failure.

Environment

  • Claude Code version: 2.1.202
  • OS: macOS (Darwin 25.3.0)
  • Install: Homebrew cask

View original on GitHub ↗