[BUG] VS Code extension crashes with React #185 (render loop) when selecting "Switch branch and continue" during Web session resume

Resolved 💬 3 comments Opened Mar 29, 2026 by mindfury Closed Apr 1, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

What's Wrong?

The VS Code extension crashes with a React #185 "Maximum update depth exceeded" error when resuming a Web session (originated from Claude Desktop) that was created on a non-default branch, and the user selects "Switch branch and continue" from the branch confirmation dialog.

The extension panel shows:

Something went wrong — Re-launch the extension to continue.

Error rendering content: Minified React error #185; visit
https://reactjs.org/docs/error-decoder.html?invariant=185
for the full message or use the non-minified dev environment
for full errors and additional helpful warnings.

React error #185 is "Maximum update depth exceeded" — a component is triggering setState inside a render, causing an infinite re-render loop. The crash occurs during the state transition that follows a branch switch confirmation, suggesting the branch-switch callback triggers a state update that re-triggers the dialog or session-load logic.

Steps to Reproduce

  1. Start a session in Claude Desktop (Web session, on a non-default feature branch — e.g. claude/resume-session-P4t0N)
  2. Open the Claude Code panel in VS Code
  3. Select the "Web" tab in the session picker
  4. Click the listed session (e.g., "Resume previous coding session 5m")
  5. A confirmation prompt appears:

> "Switch branch to claude/resume-session-P4t0N?"
> Options: 1) Switch branch and continue 2) Continue without switching 3) Cancel

  1. Select Option 1: Switch branch and continue

Result: Extension crashes with React #185 render loop. Panel shows "Something went wrong — Re-launch the extension to continue."

Expected: Branch is switched and the session resumes normally in the VS Code extension.

Environment

| Field | Value |
|---|---|
| Claude Code VS Code extension version | 2.1.86 |
| VS Code version | 1.113.0 |
| OS | Windows 11 |
| WSL2 distro | Ubuntu |
| Session origin | Claude Desktop (Web session) |
| Branch | claude/resume-session-P4t0N (non-default feature branch) |

Known Workaround

Selecting Option 2: "Continue without switching branch" avoids the crash. Then manually run git checkout claude/resume-session-P4t0N in the integrated terminal.

Additional Notes

  • Options 2 and 3 do not crash — only Option 1 triggers the render loop
  • Hypothesis: the branch-switch completion callback triggers a session-state update that re-fires the branch-check condition, causing the dialog or session-loader component to enter a setState loop
  • Related issues (different triggers, same error class): #26552, #27216, #13921

What Should Happen?

Branch is switched and the Web session resumes normally inside the VS Code extension, with the correct branch active.

Error Messages/Logs

Error rendering content: Minified React error #185; visit
https://reactjs.org/docs/error-decoder.html?invariant=185
for the full message or use the non-minified dev environment
for full errors and additional helpful warnings.

Steps to Reproduce

  1. Start a session in Claude Desktop (Web session, on a non-default feature branch — e.g. claude/resume-session-P4t0N)
  2. Open the Claude Code panel in VS Code
  3. Select the "Web" tab in the session picker
  4. Click the listed session (e.g., "Resume previous coding session 5m")
  5. A confirmation dialog appears: "Switch branch to claude/resume-session-P4t0N?" with three options: 1) Switch branch and continue 2) Continue without switching 3) Cancel
  6. Select Option 1: Switch branch and continue

Result: Extension crashes immediately with React #185 render loop. Panel shows "Something went wrong — Re-launch the extension to continue."

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.86

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗