Desktop app cannot import CLI session: 'transcript has no cwd'
Resolved 💬 2 comments Opened Apr 15, 2026 by wilkes Closed May 25, 2026
Description
When attempting to open a CLI session transcript in the Claude Code desktop app, the import fails with:
CLI session <session-id> transcript has no cwd — cannot import
Steps to Reproduce
- Run a Claude Code CLI session in a project directory
- Attempt to open/import that session in the Claude Code desktop app
Root Cause
The transcript .jsonl file's first record is a file-history-snapshot type with no cwd field:
{
"type": "file-history-snapshot",
"messageId": "...",
"snapshot": {
"messageId": "...",
"trackedFileBackups": {},
"timestamp": "2026-04-14T20:54:58.699Z"
},
"isSnapshotUpdate": false
}
The cwd field does exist on attachment type records deeper in the file, but the desktop app appears to look for it in a metadata/init record at the start of the transcript and fails when it's not found.
Expected Behavior
The desktop app should either:
- Look for
cwdin any record type (e.g., the firstattachmentrecord), or - Gracefully handle missing
cwdby prompting the user to select a working directory
Environment
- Claude Code CLI (latest)
- Claude Code Desktop (macOS)
- macOS Darwin 25.3.0
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗