`/desktop` fails with "CLI session transcript not found" when run as the first command in a session
Bug description
Running /desktop to migrate a session to the Claude Code desktop app fails when it is the first command in a fresh session (before any turn has been written). The desktop app shows:
CLI session transcript not found: 7f6698ae-8a22-4142-a948-248fe8f56982
Steps to reproduce (minimal)
- Start a new Claude Code session
- As the very first input, run
/desktop - Desktop app errors:
CLI session transcript not found: <session-id>
Running /desktop after the session has at least one turn works fine.
Diagnostic
On an empty session, no transcript .jsonl has been flushed to disk yet, so the session ID /desktop hands to the app doesn't resolve to any file. Confirmed for the failing ID:
$ find ~/.claude -name "7f6698ae-8a22-4142-a948-248fe8f56982*"
(no results)
while a session with at least one turn has its transcript present under the project dir (e.g. ~/.claude/projects/<encoded-cwd>/<session-id>.jsonl).
Expected behavior
/desktop either flushes/creates the transcript before handoff, or the desktop app handles a not-yet-written transcript gracefully (wait/retry, or an actionable message) instead of failing with "transcript not found".
Environment
- Claude Code 2.1.150
- macOS 15.7.4 (24G517), Apple Silicon
Notes
- Originally observed in a git worktree created by a custom hook (repo also uses git
separate-git-dir), but the worktree setup turned out to be incidental — the real condition is "/desktopinvoked before any transcript exists on disk."
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗