anthropics / anthropics/claude-code

Desktop: "Couldn't open that session" error when running /desktop before sending a message

Open
#95,072 0 comments 0 reactions 0 assignees View on GitHub
area:desktop bug has repro
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

**What happened**

If you open a brand-new `claude` session in the terminal and run `/desktop` before typing your first prompt, the Claude Desktop app shows this error instead of opening the session:

> Couldn't open that session. Its transcript may have been removed.

**Steps to reproduce**

1. Open a fresh terminal and run `claude` to start a new session.
2. Without sending any message, immediately run `/desktop`.
3. Switch to the Claude Desktop app.

**Expected behavior**

Since the session ID does exist, I'd expect the session to transfer to the desktop app normally and just show an empty conversation, ready for a first message. If that's not feasible, it should at least show an appropriate message like "This session doesn't have any messages yet" — not one implying something went wrong.

**Actual behavior**

Desktop shows "Couldn't open that session. Its transcript may have been removed," which reads like something went wrong or data was lost, when really no conversation has happened yet.

**Why I think this happens**

The local session transcript file (`~/.claude/projects/.../.jsonl`) is created as soon as the terminal session starts, but at that point it only contains session metadata (`mode`, `permission-mode`, `system` entries) — no `user`/`assistant` turns. It looks like Desktop's "open session" logic treats a transcript with zero conversation turns as invalid/missing, rather than as "not started yet."

**Suggested fix**

Have Desktop distinguish between "transcript missing/deleted" and "transcript exists but has no messages yet." Since the session ID is valid, ideally just transfer the (empty) session over; otherwise show a friendlier message in that case.

**Workaround**

Send at least one message in the terminal session before running `/desktop`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the flow by starting a fresh `claude` session and running `/desktop` before sending a message, then inspect the session transcript at `~/.claude/projects/.../.jsonl`. Trace how Desktop handles a transcript containing only metadata and verify that an existing empty session is distinguished from a missing or deleted transcript.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.