claude-code - 💡(How to fix) Fix VSCode fork action missing on messages starting with / due to broken slash command detection [2 comments, 2 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#49155Fetched 2026-04-17 08:49:19
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2renamed ×1

User messages that start with / are missing the "Message actions" button (fork arrow). This means you cannot fork the conversation from these messages.

Root Cause

The webview content block parser uses in-band signaling to detect slash commands:

let Y = J.startsWith("/");
return { type: "text", text: J, isSlashCommand: Y }

When isSlashCommand is true, the message renders via a flat slashCommandMessage path (just a <div> with monospace text) instead of the normal userMessageContainer path (which includes the actionButton for fork/message actions).

This is wrong in two ways:

  1. False positives: Any message starting with / is misdetected — e.g. pasting /usr/bin/c++ ... compiler output, or typing "/dev/null isn't working, help?" The message loses its action button and renders in monospace.

  2. Even for real slash commands, hiding the action button is wrong: There's no reason you shouldn't be able to fork from a point where you ran /branch, /compact, or any other slash command.

Fix Action

Fix

The isSlashCommand flag should not be inferred from message text content. Either:

  • Set it explicitly at the source (CLI/extension) when a message is actually a slash command
  • Or remove the slashCommandMessage rendering path entirely — there's no reason to hide the action button on any user message

Verified: setting isSlashCommand to always false restores the action button on all messages with no regressions.

Code Example

let Y = J.startsWith("/");
return { type: "text", text: J, isSlashCommand: Y }
RAW_BUFFERClick to expand / collapse

Description

User messages that start with / are missing the "Message actions" button (fork arrow). This means you cannot fork the conversation from these messages.

Root cause

The webview content block parser uses in-band signaling to detect slash commands:

let Y = J.startsWith("/");
return { type: "text", text: J, isSlashCommand: Y }

When isSlashCommand is true, the message renders via a flat slashCommandMessage path (just a <div> with monospace text) instead of the normal userMessageContainer path (which includes the actionButton for fork/message actions).

This is wrong in two ways:

  1. False positives: Any message starting with / is misdetected — e.g. pasting /usr/bin/c++ ... compiler output, or typing "/dev/null isn't working, help?" The message loses its action button and renders in monospace.

  2. Even for real slash commands, hiding the action button is wrong: There's no reason you shouldn't be able to fork from a point where you ran /branch, /compact, or any other slash command.

Reproduction

  1. Open a session in VSCode
  2. Send a message starting with / (e.g. paste a Unix path or compiler output starting with /usr/bin/...)
  3. The message renders in monospace with no "Message actions" button — no way to fork from it

Fix

The isSlashCommand flag should not be inferred from message text content. Either:

  • Set it explicitly at the source (CLI/extension) when a message is actually a slash command
  • Or remove the slashCommandMessage rendering path entirely — there's no reason to hide the action button on any user message

Verified: setting isSlashCommand to always false restores the action button on all messages with no regressions.

Version

Claude Code 2.1.109

extent analysis

TL;DR

The issue can be fixed by setting the isSlashCommand flag explicitly at the source or removing the slashCommandMessage rendering path to prevent hiding the action button on user messages.

Guidance

  • Identify the source of the isSlashCommand flag and modify it to only set the flag to true when a message is actually a slash command.
  • Consider removing the slashCommandMessage rendering path entirely, as there's no reason to hide the action button on any user message.
  • Verify the fix by checking that the action button is visible on all user messages, including those starting with /.
  • Test the fix with various scenarios, such as pasting Unix paths or compiler output starting with /, to ensure there are no regressions.

Example

// Instead of inferring isSlashCommand from message text content
let isSlashCommand = false; // or set it explicitly based on the message source

return { type: "text", text: J, isSlashCommand: isSlashCommand }

Notes

The provided fix has been verified to work without regressions by setting isSlashCommand to always false. However, a more robust solution would be to set the flag explicitly at the source.

Recommendation

Apply the workaround by setting isSlashCommand to false or removing the slashCommandMessage rendering path, as this has been verified to work without regressions.

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

claude-code - 💡(How to fix) Fix VSCode fork action missing on messages starting with / due to broken slash command detection [2 comments, 2 participants]