Skip to content

User message lost when slash command fails with 'Unknown skill' #32591

Description

@prokesmartin

Description

When a user types a message alongside a slash command (e.g. /myskill do something), and the slash command fails with Unknown skill: myskill, the user's original message is not preserved in the conversation history.

The message gets wrapped in a <local-command-caveat> tag and Claude is instructed to ignore it. The user's text is effectively swallowed — neither Claude nor the user can see what was originally typed.

Steps to reproduce

  1. Create a new project-level skill during an active session (e.g. .claude/skills/myskill/skill.md)
  2. Try to invoke it with /myskill (it won't be recognized until session restart)
  3. The terminal shows Unknown skill: myskill
  4. The user's message that accompanied the command is lost from the conversation
  5. The user cannot scroll back to see what they typed to retry it after restarting

Expected behavior

When a slash command fails, the user's original input should be preserved and visible in the conversation, so they can:

  • See what they typed
  • Copy/paste it to retry after a session restart
  • Or have Claude process the text portion of the message

Actual behavior

The entire message (including any user text) is hidden behind <local-command-caveat> and marked as something Claude should not respond to. The user has no way to retrieve their original input.

Impact

This is especially problematic when:

  • A skill was just created and the user needs to restart to pick it up
  • The user typed a long or detailed prompt alongside the slash command
  • The user wants to retry the same input after fixing the issue

Environment

  • Claude Code on Windows 11
  • Bash shell (Git Bash)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions