CLI to export and archive coding agent sessions to multiple formats.
Project description
SessionSync
SessionSync exports AI coding agent sessions to standardized file formats. It reads session data from Claude Code, OpenCode, and Pi, then converts them to Markdown, JSON, or TOON format.
Problem
AI coding agents store session data in different formats and locations. This makes it difficult to:
- Review past conversations across multiple agents
- Search and organize session history
- Share, back up or archive coding sessions
- Analyze tool usage patterns
Long sessions also cause agents to enter the "DUMB ZONE". Short sessions avoid this but lose context. SessionSync exports sessions to files so agents can read them back, giving them memory through the filesystem.
Supported Agents
- Claude Code
- OpenCode
- Pi
Export Formats
| Format | Description |
|---|---|
| Markdown | Human-readable with YAML frontmatter containing session metadata |
| JSON | Structured data for programmatic access and analysis |
| TOON | Binary format for compact storage |
Installation
PyPI
pip install sessionsync
Or with uv:
uv tool install sessionsync --prerelease=allow
Usage
Export all sessions from the current workspace:
sessionsync
Export sessions from a specific agent:
sessionsync --agent claude
sessionsync --agent opencode
sessionsync --agent pi
Export to a specific format:
sessionsync --format json
sessionsync --format toon
Filter by git branch:
sessionsync --branch main
Watch mode for continuous export:
sessionsync --watch
Options
| Option | Short | Description |
|---|---|---|
--agent |
-a |
Agent to sync: claude, opencode, pi, or all (default: all) |
--output |
-o |
Output directory (default: .sessions) |
--format |
-f |
Export format: markdown, json, or toon (default: markdown) |
--workspace |
-w |
Filter by workspace path (default: current directory) |
--branch |
-b |
Filter by git branch |
--no-subagents |
Exclude subagent sessions | |
--no-tools |
Exclude tool use and result messages | |
--no-thinking |
Exclude assistant thinking messages | |
--no-attachments |
Exclude file attachments | |
--watch |
Watch for changes and sync continuously | |
--verbose |
-v |
Enable debug logging |
Examples
Export only main sessions without subagents:
sessionsync --no-subagents
Export without tool calls and thinking blocks:
sessionsync --no-tools --no-thinking
Export all Claude Code sessions to JSON:
sessionsync --agent claude --format json
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sessionsync-0.1.2.tar.gz.
File metadata
- Download URL: sessionsync-0.1.2.tar.gz
- Upload date:
- Size: 42.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
343b8928b0a8d7b4787f3a97cf5f64d2ca0260031cb7337140d74f5f32e266fc
|
|
| MD5 |
6f64b24a73fd58542516e10ef9434fac
|
|
| BLAKE2b-256 |
a35cefc56769860c255b228c0fa1266a98262b75c7fd81e5978ff7ba756b6921
|
File details
Details for the file sessionsync-0.1.2-py3-none-any.whl.
File metadata
- Download URL: sessionsync-0.1.2-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
132712e6c895377c50783a85f8a90e2e8d81e2a82f43d3114383a10420fe947d
|
|
| MD5 |
f6c1cce491e058f5e0fb35fe64bce0f6
|
|
| BLAKE2b-256 |
8e008e3639aa5689b3bfbbe0eea1b3fcc79063f450769a0b66ccf3071db37e20
|