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

Status Fixed / completed
Maintainer reply ✓ Yes — dicksontsai
Activity 5 comments · opened Mar 9, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (dicksontsai, collaborator) responded on this thread — see the highlighted reply below.

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)

View original on GitHub ↗

5 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/24776
  2. https://github.com/anthropics/claude-code/issues/18676
  3. https://github.com/anthropics/claude-code/issues/27338

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

prokesmartin · 7 months ago

Update: Root cause clarified

After investigation, the Unknown skill error was caused by a skill discovery path issue, not just session caching:

  • Claude Code was launched from D:\Repos\EReasoner\ (a worktree root, NOT a git repo)
  • The skill was created in D:\Repos\EReasoner\main\.claude\skills\optimize\ (inside the actual git repo subdirectory)
  • Other skills in that same path (clitest, review) ARE discovered — but they existed before the session started
  • After restarting the session, the new skill was still not found, confirming this is NOT a hot-reload issue

Fix: Copying the skill to D:\Repos\EReasoner\.claude\skills\optimize\ (the CWD-relative path) resolved it.

The underlying UX issue remains valid though: When /myskill fails 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:

  • #24776 — stashed messages during execution (different mechanism)
  • #18676 — Claude Desktop high-context send failure (different product)
  • #27338 — messages lost during background subagent runs (different mechanism)

This is specifically about slash command failure swallowing the user's input text.

dicksontsai collaborator · 7 months ago

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.

ashwin-ant collaborator · 6 months ago

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.

github-actions[bot] · 5 months ago

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.