User message lost when slash command fails with 'Unknown skill'
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
- Create a new project-level skill during an active session (e.g.
.claude/skills/myskill/skill.md) - Try to invoke it with
/myskill(it won't be recognized until session restart) - The terminal shows
Unknown skill: myskill - The user's message that accompanied the command is lost from the conversation
- 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)
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗