claude-code - 💡(How to fix) Fix [BUG] Slash command autocomplete hijacks pasted absolute file paths starting with /

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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.

Root Cause

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.

RAW_BUFFERClick to expand / collapse

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

  1. 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).
  2. In the Claude Code input box, paste or type: /Users/games/workplace/.claude list files inside
  3. Observe that the input is auto-replaced (or the leading token is replaced) with the matched slash command, e.g. /hgame-knowledge.
  4. 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

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).

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING