[BUG] VSCode native extension: /clear is parsed as text, not routed as a slash command

Resolved 💬 3 comments Opened Apr 26, 2026 by goodacre-manchester Closed Apr 29, 2026

Description

In the VSCode native Claude Code extension, the /clear slash command is
no longer routed to its handler. Both ways of invoking it produce the same
broken behaviour:

  1. Typing /clear and pressing Enter — sends the literal string /clear

as a user message

  1. Typing /cle and selecting /clear from the autocomplete popup —

inserts /clear as plain text into the prompt input; on Enter, sends
it as a user message

In both cases the model receives /clear as text, the conversation does
not reset, and the prior context persists.

The autocomplete popup does still list /clear as a valid slash command,
so registration and discovery work — only the autocomplete-→execution and
typed-→execution paths are broken. Other slash commands (e.g. /compact)
work correctly, so the regression is isolated to /clear.

Reproduction A — typed

  1. Open Claude Code in the VSCode native extension
  2. Type /clear and press Enter
  3. Observe: /clear appears as a user message in the chat

Reproduction B — selected from popup

  1. Same setup
  2. Type /cle; the autocomplete popup offers /clear
  3. Select /clear from the popup
  4. Observe: /clear is inserted as plain text into the input box
  5. Press Enter
  6. Observe: /clear is sent as a user message

Expected (both): Slash command is intercepted; panel clears; fresh context starts
Actual (both): /clear is sent as a literal user message

Environment

  • Claude Code extension: anthropic.claude-code 2.1.120 (win32-x64)
  • VSCode: 1.117.0 (commit 10c8e557c8b9f9ed0a87f61f1c9a44bde731c409, x64)
  • OS: Windows 11 Enterprise 24H2, build 10.0.26200
  • Auto-update channel: previously latest, now pinned to stable in

~/.claude/settings.json (does not retro-downgrade installed build)

  • Settings: no PreCompact / Stop / SessionStart / UserPromptSubmit hooks

in user or project settings.json that could intercept /clear

Isolation

  • /compact (different slash command, different code path) is intercepted

correctly in the same session — regression is isolated to /clear's
command-routing path

  • /clear still appears in the autocomplete popup, so command registration

and discovery are intact

  • Command Palette → "Open in New Tab" produces a fresh context, confirming

the underlying new-session machinery still works

  • Reproduces across new VSCode windows / freshly-opened workspaces

Possible correlation: /remote-control

Regression onset coincided with first use of /remote-control. Diagnostic
steps tried, none of which restored /clear routing:

  1. Closed the remote client session (mobile/web)
  2. Explicitly toggled /remote-control off in the VSCode session
  3. Opened fresh VSCode windows / new tabs

So either remote-control state persists beyond toggle-off, or it was a
coincidence. Possibly related to #40144 and #42876 (existing /clear desync
reports around Remote Control), but filed separately because the symptom
here is "/clear is parsed as text, not a slash command", not a UI desync
between local and remote views.

Workaround

Command Palette → "Open in New Tab" instead of /clear.

View original on GitHub ↗

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