claude-code - 💡(How to fix) Fix [BUG] /clear does not preserve previous session for /resume, contradicting in-app description

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…

Error Message

Error Messages/Logs

No error message. The /clear command executes successfully, but the pre-clear session silently disappears from /resume with no warning.

Root Cause

Related Issues:

  • #32871 — /clear creates a new session rather than clearing in-place; likely root cause
  • #38158 — author requests this as a feature, but per the in-app description it is intended behavior that is broken

Code Example

No error message. The /clear command executes successfully, but the pre-clear session silently disappears from /resume with no warning.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The in-app description of /clear explicitly states:

"/clear - Start a new session with empty context; previous session stays on disk (resumable with /resume)"

In practice, the previous session is not resumable. After running /clear, the pre-clear conversation does not appear in /resume and cannot be recovered.

What Should Happen?

Per the in-app description, the cleared session should remain on disk and appear in /resume. The conversation history from before /clear should be accessible and resumable.

Error Messages/Logs

No error message. The /clear command executes successfully, but the pre-clear session silently disappears from /resume with no warning.

Steps to Reproduce

  1. Start a Claude Code session: claude
  2. Have a conversation (ask a few questions, get responses)
  3. Run /clear to start a new session
  4. Exit Claude Code
  5. Restart Claude Code and run /resume
  6. Observe: the pre-clear conversation is not listed and cannot be selected

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Prior to v2.1.128

Claude Code Version

v2.1.132

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Related Issues:

  • #32871 — /clear creates a new session rather than clearing in-place; likely root cause
  • #38158 — author requests this as a feature, but per the in-app description it is intended behavior that is broken

The behavior described in the in-app help suggests /clear should work like git stash — reset working state but preserve history. Currently it behaves more like deleting the branch.

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 [BUG] /clear does not preserve previous session for /resume, contradicting in-app description