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)
5 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Update: Root cause clarified
After investigation, the
Unknown skillerror was caused by a skill discovery path issue, not just session caching:D:\Repos\EReasoner\(a worktree root, NOT a git repo)D:\Repos\EReasoner\main\.claude\skills\optimize\(inside the actual git repo subdirectory)clitest,review) ARE discovered — but they existed before the session startedFix: Copying the skill to
D:\Repos\EReasoner\.claude\skills\optimize\(the CWD-relative path) resolved it.The underlying UX issue remains valid though: When
/myskillfails with "Unknown skill", the user's accompanying message text is completely lost from the conversation. It's wrapped in<local-command-caveat>and hidden from both Claude and the user. The user cannot scroll back to see what they typed, making it impossible to retry after fixing the issue.---
Regarding the suggested duplicates — none of them match this issue:
This is specifically about slash command failure swallowing the user's input text.
We'll work on a way to surface the swallowed text as a system message, not as something Claude should help with directly. This helps users avoid accidentally incurring additional inference costs.
This was fixed in v2.1.74 — When a slash command fails with 'Unknown skill', the typed arguments are now echoed back so they can be copied and resubmitted. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.