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

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

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.1.tar.gz (39.1 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.1-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sessionsync-0.1.1.tar.gz
  • Upload date:
  • Size: 39.1 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.1.tar.gz
Algorithm Hash digest
SHA256 825a6690ee240aa47e519684bcd17ef962f3da3c1d1b3a14bd7724ac40f99535
MD5 9b0972201c618357e907f02e7b91fac4
BLAKE2b-256 62a5ec8fc2f065838282042854bffa990c0044cc18f8e8d1ad057b8912dbd53e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sessionsync-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 799863a61351613957124afca950f50c1bb9bd442c92be35b573da45fdde4153
MD5 0b36647ffae5aabd2a1383bc4db50257
BLAKE2b-256 c4adc4289c81db73f0c932c84e8873cc858cbe01817b734a826a84268e4dc998

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