[BUG] VSCode native extension: /clear is parsed as text, not routed as a slash command
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:
- Typing
/clearand pressing Enter — sends the literal string/clear
as a user message
- Typing
/cleand selecting/clearfrom 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
- Open Claude Code in the VSCode native extension
- Type
/clearand press Enter - Observe:
/clearappears as a user message in the chat
Reproduction B — selected from popup
- Same setup
- Type
/cle; the autocomplete popup offers/clear - Select
/clearfrom the popup - Observe:
/clearis inserted as plain text into the input box - Press Enter
- Observe:
/clearis 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 tostablein
~/.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
/clearstill 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:
- Closed the remote client session (mobile/web)
- Explicitly toggled
/remote-controloff in the VSCode session - 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.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗