claude-code - 💡(How to fix) Fix Double-press Cmd+L silently destroys entire session with no confirmation [1 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#55590Fetched 2026-05-03 04:49:29
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1

Pressing Cmd+L (or Ctrl+L) twice within two seconds runs /clear, which irreversibly wipes the entire conversation — including sessions that may represent days of accumulated context and hundreds of thousands of tokens. There is no confirmation prompt, no undo, and no way to recover.

Root Cause

Pressing Cmd+L (or Ctrl+L) twice within two seconds runs /clear, which irreversibly wipes the entire conversation — including sessions that may represent days of accumulated context and hundreds of thousands of tokens. There is no confirmation prompt, no undo, and no way to recover.

Fix Action

Fix / Workaround

Current Workaround

RAW_BUFFERClick to expand / collapse

Summary

Pressing Cmd+L (or Ctrl+L) twice within two seconds runs /clear, which irreversibly wipes the entire conversation — including sessions that may represent days of accumulated context and hundreds of thousands of tokens. There is no confirmation prompt, no undo, and no way to recover.

The Problem

The chat:clearInput action has a hidden escalation: a single press redraws the screen, but a double press nukes the session. This is a UX anti-pattern for several reasons:

  1. The most destructive action in the tool is triggered by a casual double-tap of a common shortcut. Cmd+L is muscle memory for "clear screen" in every terminal emulator — users will double-tap it without thinking.

  2. There is zero confirmation. No "Are you sure?" dialog, no way to undo. The session is simply gone.

  3. The escalation behavior is not discoverable. Nothing in the UI warns that pressing the same key twice will do something catastrophically different from pressing it once.

  4. The two behaviors (redraw screen vs. destroy session) are bundled into a single, inseparable action. You cannot keep the useful single-press behavior without accepting the destructive double-press. The keybindings system does not allow separating them.

Impact

For workflows involving long-running sessions (multi-day, 100k+ tokens of accumulated context, ongoing architectural work), an accidental /clear is the single most destructive thing that can happen. It's not recoverable, and rebuilding that context is hours of work — if it's even possible.

Request

  1. Add a confirmation prompt before /clear — at minimum for sessions above a certain size or age. This is an irreversible, destructive action and should be treated as one.

  2. Separate clearInput (screen redraw) and clearConversation into independent, separately bindable actions. Users should be able to keep one without the other.

  3. More broadly: destructive behaviors like this should be opt-in, not mandatory defaults. Adding a hidden session-destroying escalation to a screen-redraw shortcut is not something that should ship as a default that users have to discover the hard way. Features with this level of blast radius should require explicit user opt-in.

Current Workaround

Unbinding Cmd+L, Ctrl+L, Cmd+K, and Meta+K entirely in keybindings.json, which also loses the useful screen redraw functionality.

Thank you for building Claude Code — it's an incredible tool and central to my daily workflow. That's precisely why getting this right matters so much.

extent analysis

TL;DR

Implement a confirmation prompt before executing the /clear command to prevent accidental session wipes.

Guidance

  • Consider adding a size or age threshold for sessions to determine when a confirmation prompt is necessary.
  • Separate the clearInput and clearConversation actions into independent, bindable actions to allow users to customize their workflow.
  • Review the keybindings system to ensure that destructive behaviors are opt-in and not mandatory defaults.
  • As a temporary workaround, users can unbind the problematic shortcuts in keybindings.json, but this will also disable the useful screen redraw functionality.

Example

No code snippet is provided as it is not explicitly supported by the issue.

Notes

The issue highlights the importance of careful design and testing of shortcuts and keybindings to prevent accidental data loss. The proposed solutions aim to balance usability with safety and customization.

Recommendation

Apply a workaround by adding a confirmation prompt before executing the /clear command, as this is a critical safety feature to prevent accidental session wipes.

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 Double-press Cmd+L silently destroys entire session with no confirmation [1 comments, 2 participants]