Crash when typing too fast after pressing / for slash command menu
Bug Description
When pressing / to open the slash command picker and then pressing another key too quickly (before the menu fully renders), Claude Code crashes and dumps minified JS source + a stack trace to the terminal.
This is a race condition — the next keystroke arrives before the slash command menu is fully mounted, causing an unhandled error in the text editor's cursor/vim handling code.
Steps to Reproduce
- Start a Claude Code session
- Press
/to open the slash command menu - Immediately press another key (e.g.
uforui-ux-pro-max) within ~100-200ms - Claude Code crashes and dumps minified JS to the terminal
Expected Behavior
The slash command menu should either:
- Buffer/debounce the next keystroke until the menu is ready
- Gracefully handle input that arrives before the menu is mounted
Actual Behavior
The CLI crashes with a stack trace pointing to the text editor/cursor code:
(.nvm/versions/node/v20.20.0/lib/node_modules/@anthropic/claude-code/cli.js:7334:13728)
at Array.map (<anonymous>)
(.nvm/versions/node/v20.20.0/lib/node_modules/@anthropic/claude-code/cli.js:7334:13610)
(.nvm/versions/node/v20.20.0/lib/node_modules/@anthropic/claude-code/cli.js:7334:11814)
(.nvm/versions/node/v20.20.0/lib/node_modules/@anthropic/claude-code/cli.js:7335:5642)
Object.AX (.nvm/versions/node/v20.20.0/lib/node_modules/@anthropic/claude-code/cli.js:717:29971)
e3.useMemo (.nvm/versions/node/v20.20.0/lib/node_modules/@anthropic/claude-code/cli.js:212:267775)
fq (.nvm/versions/node/v20.20.0/lib/node_modules/@anthropic/claude-code/cli.js:7335:5566)
YZz (.nvm/versions/node/v20.20.0/lib/node_modules/@anthropic/claude-code/cli.js:7371:5678)
HK (.nvm/versions/node/v20.20.0/lib/node_modules/@anthropic/claude-code/cli.js:717:20892)
The dumped minified code references vim-like cursor operations (recordChange, operatorFind, cursor.findCharacter, nextVimWord, prevVimWord, etc.), suggesting the crash occurs in the text editor's input processing layer.
Environment
- Claude Code: v2.1.42
- Node.js: v20.20.0
- macOS: 26.3 (Darwin 25.3.0)
- Shell: zsh
- Terminal: likely iTerm2 or default Terminal.app
Workaround
Pausing briefly (~200ms) after pressing / before typing the next character avoids the crash.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗