Crash when typing /a or /u mid-line in input

Resolved 💬 3 comments Opened Feb 2, 2026 by nodramallamaa Closed Feb 6, 2026

Description

Claude Code crashes with an unhandled exception when typing /a or /u in the middle of input text (not at the beginning of a new command line).

Steps to Reproduce

  1. Start Claude Code
  2. Begin typing a message (any text)
  3. Type /a or /u somewhere in the middle of your input (not at the start)
  4. Observe crash with stack trace

Expected Behavior

Typing /a or /u mid-line should be treated as literal text, not trigger slash command parsing.

Actual Behavior

Application crashes and displays a stack trace pointing to the slash command autocomplete logic.

Stack Trace

6053: `,R-1)+1,D=T.indexOf(`
6054 `,R),$=D===-1?T.length:D,H=T.slice(B,$),q=R-B,O=[];for(let
     G=0;G<H.length;G++)if(H[G]===A)O.push(G);for(let G=0;G<O.length-1;G+=2){let
     C=O[G],J=O[G+1];if(C≤q&&q≤J)return
     _?{start:B+C+1,end:B+J}:{start:B+C,end:B+J+1}}return null}function YK8(T,R,A,_,B){let
     D=0,$=-1;for(let q=R;q≥0;q--)if(T[q]===_&&q≠R)D++;else
     if(T[q]===A){if(D===0){$=q;break}D--}if($===-1)return null;D=0;let H=-1;for(let
     q=$+1;q<T.length;q++)if(T[q]===A)D++;else
     if(T[q]===_){if(D===0){H=q;break}D--}if(H===-1)return null;return
     B?{start:$+1,end:H}:{start:$,end:H+1}}

Key frames:

  • <anonymous> (/$bunfs/root/claude:6051:11879)
  • fjA (/$bunfs/root/claude:6051:11765)
  • zjA (/$bunfs/root/claude:6051:9969)

Environment

  • Claude Code Version: 2.1.29
  • OS: macOS (Darwin 25.2.0)
  • Platform: darwin

Workaround

Avoid typing / followed by a or u mid-line. Pasting text containing these sequences works without triggering the crash.

View original on GitHub ↗

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