VSCode fork action missing on messages starting with / due to broken slash command detection

Open 💬 2 comments Opened Apr 16, 2026 by ojura

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.
  1. 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, 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 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

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗