Skip to main content

Session Sharing

Share your Claude Code conversation history with teammates, collaborators, or across machines.

Overview

The session sharing system allows you to:
  • Export conversations as portable JSON files
  • Upload sessions to cloud storage (x0.at)
  • Clone shared sessions to continue conversations
  • Download session context as markdown files
Implemented in src/session-sharing.js, this feature enables seamless collaboration.

Exporting Sessions

Export as Markdown

Download a conversation as a markdown file optimized for Claude Code:
Markdown format:
Markdown exports are perfect for providing context to new Claude Code sessions or sharing read-only conversation history.

Export as JSON

Export the full session data for cloning:

Sharing Sessions

Upload to x0.at

Share sessions via the x0.at file hosting service:
Sharing workflow:
1

Export Session Data

Convert conversation to portable JSON format
2

Upload to x0.at

3

Share URL

Send the returned URL to collaborators:
x0.at retention policy:
  • Files are kept for 3-100 days based on size
  • Files are not encrypted by default
  • Don’t share sessions containing sensitive data (API keys, passwords, credentials)

Generate Share QR Code

Create QR codes for mobile sharing:
Display the QR code in a web interface or terminal for easy mobile scanning.

Cloning Sessions

Clone from URL

Download and import a shared session:
Clone process:

Clone Implementation

The cloning process (cloneSession method):
  1. Download - Fetch JSON from URL using curl
  2. Validate - Check session structure and required fields
  3. Install - Place in ~/.claude/projects/{project}/ directory
  4. Settings - Create settings.json with metadata
  5. Ready - Session appears in Claude Code session list

Session Installation

Cloned sessions are installed to the standard Claude Code directory:
settings.json structure:
Cloned sessions integrate seamlessly with Claude Code. Use claude --resume {id} or select them from the sessions list in the UI.

Message Limits

Large conversations are truncated to avoid excessive file sizes:
Limit indicators:

JSONL Format

Sessions use JSONL (JSON Lines) format - one JSON object per line:
This format allows:
  • Streaming - Append messages without parsing entire file
  • Partial reads - Read specific lines without loading all messages
  • Efficient parsing - Process one message at a time

Security & Privacy

Before sharing sessions:
  • Remove API keys and credentials from conversation history
  • Redact sensitive business logic or proprietary code
  • Check for hardcoded passwords or tokens
  • Verify no customer data is included

Sanitizing Sessions

Before export, review messages for:

Private Sharing

For sensitive projects, use private file sharing:
  1. Export locally - Save JSON to disk
  2. Encrypt - Use GPG or similar encryption
  3. Share privately - Use secure channels (Slack, email, private cloud)
  4. Decrypt - Recipient decrypts before cloning

Use Cases

Team Collaboration

Share context when handing off work:

Cross-Machine Sync

Continue work on different machines:

Code Review Context

Provide full context for code reviews:

Onboarding

Share project setup sessions with new team members:

API Reference

SessionSharing Class

Export Options

Clone Options

Troubleshooting

Clone Fails with β€œInvalid session file”

Causes:
  • Corrupted download
  • Not a valid Claude Code session export
  • Outdated export format
Solutions:
  • Re-download the file
  • Verify URL is correct
  • Check export was created with recent version

Upload to x0.at Fails

Solutions:
  • Check internet connection
  • Verify x0.at service is available
  • Try again in a few minutes

Session Not Appearing in Claude Code

Next Steps

Sandbox Execution

Run Claude Code in isolated environments

Remote Access

Access analytics dashboards remotely