[BUG] React error #31 crash when typing custom slash commands

Resolved 💬 3 comments Opened Feb 2, 2026 by CiANSfi Closed Feb 6, 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?

Bug: React error #31 crash when typing custom slash commands

Environment

  • Claude Code version: 2.1.29
  • OS: Fedora 43 (Linux 6.18.7-200.fc43.x86_64)
  • Shell: bash/zsh

Description

Claude Code crashes with a React rendering error when typing custom slash commands (skills). The crash occurs during the incremental typing/autocomplete phase, typically after the command text turns blue (indicating recognition) and the user presses space or continues typing.

Built-in commands (/help, /clear, etc.) are not affected - only custom skills defined in .claude/ or project commands.

Steps to Reproduce

  1. Have at least one custom slash command/skill configured
  2. Start typing a custom slash command, e.g., /commit
  3. Wait for the text to turn blue (command recognition)
  4. Press space or continue typing

Result: Claude Code crashes with React error #31.

Expected Behavior

The command should be recognized and executed normally without crashing.

Actual Behavior

Application crashes with:

ERROR  Minified React error #31; visit https://react.dev/errors/31?args[]=object%20with%20keys%20%7Btype%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

Stack trace points to React reconciliation functions in the minified bundle:

- Y1 (/$bunfs/root/claude:669:8731)
- HI (/$bunfs/root/claude:669:10842)
- RF (/$bunfs/root/claude:669:12411)
- eh (/$bunfs/root/claude:669:14695)

Workaround

Type the command name without the leading slash, then type out other text in the message, then go back to the beginning and add the / character. This bypasses the incremental autocomplete code path and prevents the crash.

Analysis

React error #31 means "Objects are not valid as a React child". The error message indicates an object with keys {type} is being passed directly to React's renderer.

Likely cause: The autocomplete/command-matching UI component appears to handle built-in commands correctly but passes the raw skill descriptor object (which contains a type property) directly to React when rendering custom skills during incremental keystroke matching.

The workaround works because adding the / after typing the command name causes the parser to recognize the complete command in one pass, bypassing the incremental autocomplete rendering that triggers the bug.

Additional Context

  • The crash is intermittent but reproducible
  • Only affects custom slash commands/skills, never built-in commands
  • The crash happens during the recognition/autocomplete phase, not during command execution

What Should Happen?

Claude Code doesn't crash after completion of the typing of a slash command

Error Messages/Logs

See "Additional Information" (too long to paste into this text box)

Steps to Reproduce

  1. Have at least one custom slash command/skill configured
  2. Start typing a custom slash command, e.g., /commit
  3. Wait for the text to turn blue (command recognition)
  4. Press space or continue typing

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.29

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

  • Using Gnome Terminal + tmux/bash (Fedora 43)
  • Attached is the error output

error_output.txt

View original on GitHub ↗

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