[Feature Request] Session Export/Import for Cross-Machine Portability
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single feature request
Problem
There's no official way to export/import Claude Code sessions between machines. Users who work across multiple devices (desktop + laptop, macOS + Linux, work + home) cannot continue conversations on a different machine.
Use Cases
- Backups: Save important conversations for disaster recovery
- Machine migration: Moving from one computer to another
- Multi-device workflow: Start conversation on laptop, continue on desktop
- Team sharing: Share a conversation with a colleague
Current Behavior
Sessions are stored in ~/.claude/projects/<project>/ with .jsonl files and a sessions-index.json. Manually copying these files to another machine results in:
$ claude -c
No conversation found to continue
Regression Note
With version 2.1.5, manually copying session files between machines (and updating paths) worked as a workaround. After updating to 2.1.9, this no longer works - sessions are not recognized even after:
- Updating all hardcoded paths (
/Users/username→/home/username) - Fixing
sessions-index.jsonentries (fullPath, projectPath, fileMtime) - Patching session version field and thinkingMetadata structure
This suggests additional validation was added that blocks sessions not originally created on the current machine.
Proposed Solution
Add official export/import commands:
claude session export <sessionId> -o conversation-backup.json
claude session import conversation-backup.json
The export format should:
- Be self-contained (include all necessary metadata)
- Use relative paths or no paths (portable)
- Be human-readable (JSON)
- Support optional anonymization of file contents
Environment
- Source machine: macOS, Claude Code 2.1.5
- Target machine: NixOS, Claude Code 2.1.9
Priority
Medium
Category
Enhancement
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗