[BUG] Slash command autocomplete hijacks pasted absolute file paths starting with /
Description
When I paste an absolute file path (which on macOS/Linux starts with /) into the Claude Code input, the slash command autocomplete treats the leading / as a command trigger and replaces or hijacks my input with a matched slash command (in my case, a skill named /hgame-knowledge).
This makes it very easy to accidentally launch a skill I never intended to invoke, simply by pasting a path and pressing Enter.
Steps to reproduce
- Have at least one skill installed whose name shares a prefix with a common path segment (e.g.
hgame-knowledge, or any skill starting with a letter that matches the start of a typical path). - In the Claude Code input box, paste or type:
/Users/games/workplace/.claude list files inside
- Observe that the input is auto-replaced (or the leading token is replaced) with the matched slash command, e.g.
/hgame-knowledge. - Pressing Enter then runs the skill instead of sending the path as plain text.
Expected behavior
- If the input clearly looks like a filesystem path (e.g.
/Users/...,/home/...,/etc/...,/tmp/..., or contains/separators beyond the first character), the slash command autocomplete should NOT engage. - Or at minimum, the autocomplete should not silently replace the typed/pasted text — it should only show as a suggestion that requires explicit selection (Tab/Enter on the suggestion popup).
Actual behavior
Pasted path is silently rewritten into a slash command, leading to unintended skill invocations.
Environment
- OS: macOS (Darwin 23.6.0)
- Shell: zsh
- Claude Code CLI (latest)
Impact
Low-severity but annoying — users who frequently paste local paths into Claude Code (a common workflow for code/data work) keep accidentally triggering skills. Also makes it look like skills are auto-firing on paths, which is not actually the case.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗