VSCode fork action missing on messages starting with / due to broken slash command detection
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:
- 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.
- 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
- Open a session in VSCode
- Send a message starting with
/(e.g. paste a Unix path or compiler output starting with/usr/bin/...) - The message renders in monospace with no "Message actions" button, so there is 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
slashCommandMessagerendering 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
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗