Skip to main content

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

Homebrew

brew install sessionsync

PyPI

pip install sessionsync

Or with uv:

uv tool install sessionsync

Arch Linux

yay -S sessionsync

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
sessionsync --branch all

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 (default: current branch, use all for all)
--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 --branch all

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sessionsync-0.1.0.tar.gz (39.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sessionsync-0.1.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file sessionsync-0.1.0.tar.gz.

File metadata

  • Download URL: sessionsync-0.1.0.tar.gz
  • Upload date:
  • Size: 39.2 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

Hashes for sessionsync-0.1.0.tar.gz
Algorithm Hash digest
SHA256 846dff5b7a650998c021daa23f907b79d9a8ce97b940b1b3aa21bc73c474a8a7
MD5 23694e5de019c6824fad0733ed767e78
BLAKE2b-256 dde2ed62bbbf99f67727344498a62db0329607a3c70904ac80eef8eb2bb60dfc

See more details on using hashes here.

File details

Details for the file sessionsync-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sessionsync-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.1 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

Hashes for sessionsync-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2954ef9f7b2add848f5880310cb77b15233527cf6794dfcb93b2cedb2b20ee4
MD5 a6f495abf4a0ad8405581a854955573e
BLAKE2b-256 b1ac29824354c99df47ae69d32a26e055cd449abeac02bd1099b668ce1789ac0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page