claude-code - 💡(How to fix) Fix [BUG] First message starting with “/” is treated as a command even when it’s just text [1 participants]

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…
GitHub stats
anthropics/claude-code#54696Fetched 2026-04-30 06:38:33
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

Error Message

When I paste a message that starts with a forward slash as the first message in a new Claude Code conversation, Claude Code incorrectly interprets it as a command and then does nothing. If I send a follow up message, it replies that there’s no such command. This makes it impossible to paste paths or similar text as the first message without triggering an error.

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When I paste a message that starts with a forward slash as the first message in a new Claude Code conversation, Claude Code incorrectly interprets it as a command and then does nothing. If I send a follow up message, it replies that there’s no such command. This makes it impossible to paste paths or similar text as the first message without triggering an error.

What Should Happen?

Don't interpret path string as command

Error Messages/Logs

Steps to Reproduce

  1. Start a new conversation in Claude Code.
  2. Paste /example-path
  3. no response happening
  4. write a second message
  5. claude code replies it can't find a command /example-path

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

Claude 1.5354.0 (9a9e3d) 2026-04-29T01:14:34.000Z

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Warp

Additional Information

No response

extent analysis

TL;DR

The issue can be worked around by modifying the initial message to avoid starting with a forward slash or by adding a prefix to the path string.

Guidance

  • Verify that the issue only occurs when the first message in a conversation starts with a forward slash.
  • Try adding a space or a prefix (e.g., "Path: ") to the initial message to see if it prevents Claude Code from interpreting it as a command.
  • Test if this behavior is specific to the Opus Claude Model or if it occurs with other models as well.
  • Consider reporting this as a feature request to allow Claude Code to distinguish between commands and regular text, especially when pasting paths.

Example

No code snippet is provided as this issue seems to be related to the interaction with the Claude Code API rather than a specific code implementation.

Notes

The provided information suggests that this is not a regression and has never worked as expected. The workaround might not be ideal, but it could help mitigate the issue until a proper fix or feature update is implemented.

Recommendation

Apply workaround: Adding a prefix or modifying the initial message to avoid starting with a forward slash seems to be the most straightforward way to address this issue until a more permanent solution is available.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING