[BUG] React error #185 crash when cycling permissions with Shift+Tab
Description
Claude Code CLI crashes with React error #185 (Maximum update depth exceeded) when cycling through options in the "bypass permissions" dialog using Shift+Tab.
Version
- Claude Code: 2.1.2
- Platform: Linux 6.14.0-37-generic
- Installation: Local (
/home/jan/.claude/local/node_modules/@anthropic-ai/claude-code/)
Steps to Reproduce
- Launch Claude Code CLI (session starts normally)
- Trigger the permissions prompt that shows "bypass permissions on (shift+tab to cycle)"
- Press Shift+Tab to cycle through permission options
- CLI crashes immediately with React error #185
Error Output
Error: Minified React error #185; visit https://react.dev/errors/185 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at E4 (file:///home/jan/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:743:16256)
at sB (file:///home/jan/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:743:15769)
at e8 (file:///home/jan/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:743:31880)
at i2 (file:///home/jan/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:743:31479)
at file:///home/jan/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3069:2230
at TA (file:///home/jan/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3411:619)
at onInput (file:///home/jan/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3055:8202)
at Object.wrappedOnInput [as current] (file:///home/jan/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:3055:5060)
at file:///home/jan/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:870:2516
at hn.J (file:///home/jan/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:870:3364)
Expected Behavior
Shift+Tab should cycle through the permission options (e.g., "bypass permissions" → "ask for permissions" → etc.) without crashing.
Actual Behavior
The CLI terminates immediately with a React infinite render loop error, losing the entire session.
Root Cause Analysis
React error #185 indicates "Maximum update depth exceeded" - the TUI's input handler (onInput/wrappedOnInput) is triggering a state update that causes a re-render, which triggers another state update, creating an infinite loop.
The stack trace shows the crash originates in the input handling pipeline while processing the Shift+Tab keypress in the permissions dialog component.
Workaround
Avoid using Shift+Tab in permission dialogs. Instead:
- Use arrow keys + Enter to select options
- Or launch with
--dangerously-skip-permissionsflag to bypass the dialog entirely
Related Issues
This appears to be the same underlying bug as:
- #13921 - Generic React error #185
- #16452 - Crash when invoking skills with long arguments
- #15307 - Crash during voice dictation (continuous input)
- #15751 - Crash with rapid character input via xdotool
- #15781 - Typing too fast crashes CLI
All share the same React error #185 in the TUI's input handling system.
Additional Context
- Terminal: Predator (assuming custom terminal or shell setup)
- This is a critical UX bug - the crash is triggered by a UI hint that explicitly tells users to use Shift+Tab
- The minified React code makes debugging impossible without access to the source-mapped/unminified build
Suggested Fix
The TUI's input handler needs debouncing/throttling or proper state batching to prevent infinite render loops when processing rapid/repeated input events.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗