claude-code - 💡(How to fix) Fix VSCode extension: /clear slash command sent as verbatim message instead of clearing conversation [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#52999Fetched 2026-04-25 06:15:08
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×4commented ×2closed ×1

In the Claude Code VSCode extension, typing the full string /clear and then selecting the /clear autocomplete entry sends the literal text /clear to the model as a user message instead of clearing the conversation.

If you instead partially type (e.g. just /) and pick Clear conversation from the autocomplete popup without fully typing out the command, it works correctly.

Regression: this broke within the last couple of weeks, after I simultaneously upgraded VSCode and the Claude Code extension. I don't know which of the two upgrades introduced the break. Currently reporting against:

  • Claude Code: 2.1.119
  • VSCode: 1.117.0
  • Extension: [email protected]
  • OS: Linux 6.8.0-110-generic

Root Cause

In the Claude Code VSCode extension, typing the full string /clear and then selecting the /clear autocomplete entry sends the literal text /clear to the model as a user message instead of clearing the conversation.

If you instead partially type (e.g. just /) and pick Clear conversation from the autocomplete popup without fully typing out the command, it works correctly.

Regression: this broke within the last couple of weeks, after I simultaneously upgraded VSCode and the Claude Code extension. I don't know which of the two upgrades introduced the break. Currently reporting against:

  • Claude Code: 2.1.119
  • VSCode: 1.117.0
  • Extension: [email protected]
  • OS: Linux 6.8.0-110-generic

Fix Action

Workaround

Don't type the full command — type / (or a prefix like /cl) and pick Clear conversation from the autocomplete. In that path the command is interpreted correctly.

RAW_BUFFERClick to expand / collapse

Summary

In the Claude Code VSCode extension, typing the full string /clear and then selecting the /clear autocomplete entry sends the literal text /clear to the model as a user message instead of clearing the conversation.

If you instead partially type (e.g. just /) and pick Clear conversation from the autocomplete popup without fully typing out the command, it works correctly.

Regression: this broke within the last couple of weeks, after I simultaneously upgraded VSCode and the Claude Code extension. I don't know which of the two upgrades introduced the break. Currently reporting against:

  • Claude Code: 2.1.119
  • VSCode: 1.117.0
  • Extension: [email protected]
  • OS: Linux 6.8.0-110-generic

Steps to Reproduce (broken path)

  1. Open the Claude Code panel in VSCode.
  2. Type the full string /clear in the input.
  3. Slash-command popup shows /clear ("Clear conversation") highlighted.
  4. Select and submit.

Slash-command popup with /clear selected

Expected

Conversation is cleared (same as /clear in the CLI).

Actual

/clear is delivered to the model as a literal user message. The assistant responds to it conversationally; context is not cleared:

/clear appears as a user turn; the assistant runs a Bash tool and replies normally

Workaround

Don't type the full command — type / (or a prefix like /cl) and pick Clear conversation from the autocomplete. In that path the command is interpreted correctly.

Impact

/clear is one of the most frequently used slash commands. The current behavior along the "type-it-fully" path silently wastes tokens and pollutes context with a bogus user turn instead of resetting it.

extent analysis

TL;DR

The issue can be worked around by typing a prefix of the /clear command, such as / or /cl, and selecting Clear conversation from the autocomplete popup instead of typing the full command.

Guidance

  • Verify that the issue is specific to the "type-it-fully" path by reproducing the problem with different commands and prefixes.
  • Check if the problem persists when using other autocomplete entries or commands to ensure it's not a general issue with the autocomplete feature.
  • Consider reporting the issue to the extension developers, providing the reproduction steps and version information, to help them identify and fix the root cause.
  • In the meantime, use the provided workaround to avoid the incorrect behavior.

Example

No code snippet is provided as the issue is related to the behavior of the VSCode extension and not a code-specific problem.

Notes

The issue seems to be related to the interaction between the VSCode extension and the autocomplete feature, and it's unclear whether the problem is caused by the extension or VSCode itself. Further investigation is needed to determine the root cause.

Recommendation

Apply the workaround by typing a prefix of the /clear command and selecting Clear conversation from the autocomplete popup, as this is a reliable way to avoid the incorrect behavior until the root cause is identified and fixed.

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 extension: /clear slash command sent as verbatim message instead of clearing conversation [2 comments, 2 participants]