[BUG] `/clear` in Claude Desktop resets current session in-place instead of creating a new session
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
In Claude Desktop (macOS), running /clear resets the current session in-place rather than creating a new session. The current session is renamed to "General coding session" in the sidebar and its message content is replaced with "No messages yet" — making the entire session history inaccessible through the UI.
In the terminal CLI, /clear correctly creates a new context window while preserving the original session as a separate, accessible entry in the session list. The desktop app does not match this behavior.
The raw .jsonl transcript file survives on disk at ~/.claude/projects/<project>/<uuid>.jsonl, but because the desktop app's session cache entry is reset rather than a new one being created, the transcript is permanently orphaned — there is no UI path to access it.
What Should Happen?
/clear in Claude Desktop should behave the same as in the terminal CLI: start a fresh context window (new session entry in the sidebar) while preserving the original session — including its title and full conversation history — as a separate, accessible entry.
Error Messages/Logs
Steps to Reproduce
- Open Claude Desktop (macOS) and start a session with at least a few messages in it
- Run
/clearin the chat input - Sidebar: the session is renamed to "General coding session"
- Main panel: "No messages yet" — all prior messages are gone
- Navigate away and back; restart the app — the history does not return
- Confirm the
.jsonltranscript still exists on disk at~/.claude/projects/.../<original-uuid>.jsonl— data is intact but inaccessible
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude 1.15200.0 (250bae) 2026-06-23T05:40:53.000Z
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Screenshots
Before running /clear
<img width="1392" height="1522" alt="Image" src="https://github.com/user-attachments/assets/f7ac0158-4b0a-4dd0-9d08-19a8d139b2b9" />
After running /clear
<img width="1392" height="1522" alt="Image" src="https://github.com/user-attachments/assets/1ef0c822-ff47-4c03-93a5-8c0875d4f361" />
Related Issues
- #59534 — same
/clearsession-preservation failure in CLI (closed stale); my bug is the desktop-app manifestation - #61172 — open CLI issue for the name-inheritance half of the same problem
Showing cached comments. Read the full discussion on GitHub ↗
4 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
These are not duplicates:
/clearsession-preservation failure in CLI (closed stale); my bug is the desktop-app manifestation and is more extensive/clearleaves the original transcript file on disk but resets the metadata file that points to it. That is why the sidebar row becomes "General coding session" and opens with "No messages yet" even though the conversation history is still under~/.claude/projects/<project-slug>/.I built
BasedGPT/claude-code-session-recoveryfor this orphaned-session case. Runpython tools/diagnose.pyfirst; it maps the metadata files against the transcript files and prints the exact repair command when the original transcript survives. Check the original UUID under~/.claude/projects/before changing anything, save the diagnosis output, and quit Desktop fully before applying the printed metadata repair.The upstream behaviour still needs fixing so
/clearcreates a new session-list entry, but the on-disk check separates that product bug from a genuinely missing transcript.Hope this helps, if my tools are able to help you, would appreciate a ⭐ :)
Just ran into this. I had Claude diagnose it, and here's what it came up with:
/clearorphans conversations from the desktop app's session history sidebarSummary
In the Claude desktop app, the session history sidebar keeps one entry per window, not one per conversation. That entry stores a single
cliSessionIdpointing at the current transcript. Running/clearstarts a new transcript on disk but overwritescliSessionIdin place rather than creating a new history entry.The result: every conversation you
/clearaway becomes unreachable from the sidebar, even though its transcript is fully intact on disk. There is no in-app way to list or reopen it.In my case the sidebar showed 1 entry for a directory that had 5 transcripts on disk.
Environment
| | |
|---|---|
| Claude desktop app | 1.30096.1 |
| Claude Code CLI | 2.1.231 (session process reported 2.1.229) |
| macOS | 26.6.1 (arm64) |
Reproduction
/clear.Expected: both conversations listed, each reopenable.
Actual: one entry, labelled with the generic "General coding session" placeholder. The pre-
/clearconversation is absent and cannot be reopened from anywhere in the app.Mechanism
There are three separate session stores, and the app-side one does not track a
/clear:| # | Path | Contents |
|---|---|---|
| 1 |
~/.claude/projects/<encoded-cwd>/<uuid>.jsonl| The real transcripts. One per/clear. Whatclaude --resumereads. || 2 |
~/.claude/sessions/<pid>.json| Live process registry, running sessions only. Carries anentrypointfield (claude-desktop/claude-vscode) and a messaging socket path. || 3 |
~/Library/Application Support/Claude/claude-code-sessions/<a>/<b>/local_<uuid>.json| The app-side records backing the sidebar and thelist_sessionsMCP tool. |Store 3 is the problem. A record looks like this:
createdAtis 12:15. The referencedcliSessionIdbelongs to a session that started at 15:53. In the intervening three and a half hours the same window produced two other transcripts:Neither has a
local_record of its own. Each was the value ofcliSessionIdinlocal_a7e30419at some point and was overwritten by the next/clear.Across the whole machine: 5
local_*.jsonrecords total, against 5 transcripts in this one project directory alone.The
+button does this correctly —/cleardoes notThe app already writes one record per conversation on another path. Starting a session with the
+button next to a folder was tested against a snapshot of both stores:| Action | App record | Transcript | Title |
|---|---|---|---|
|
+button |local_3f64a5e1created |02af8d8bcreated | "Sidebar plus button testing" — auto-titled ||
/clear| none created | created | never titled |Both stores went 5 → 6, paired 1:1. The window's existing record was left untouched and still points at its own transcript.
So the correct behaviour already exists and is reachable;
/clearsimply doesn't take that path.Two details worth noting for anyone reproducing this:
+and stopping there creates nothing. Send a message before checking.+session was titled from its first message, while a record that has been reused across/clearfor four hours still has notitlefield at all. (Correlation from two samples, not confirmed from source.)Knock-on effects
list_sessionsinherits the gap. The session-management MCP tool reads store 3, so it returns the same incomplete list. An agent asked "find my earlier session" cannot see the orphaned ones either.titlefield, so the sidebar renders "General coding session" — unhelpful for picking between windows even when entries do exist./resumeis unavailable in-app. It's an interactive terminal dialog, so the in-app user has no fallback path at all.Workaround
Resume from a terminal. Sessions are indexed by working directory, so the
cdis required:UUIDs are the filenames in
~/.claude/projects/<encoded-cwd>/.Suggested fix
Make
/cleartake the same path as+. That path already creates a newlocal_record, points it at a fresh transcript, leaves the prior record intact, and auto-titles it on first activity — which is exactly the desired behaviour.Two things that would help alongside it:
~/.claude/projects/<encoded-cwd>/would surface the conversations already orphaned on users' machines, not just prevent new ones.