Skip to main content

harness-exchange

Exchange sessions between codex, opencode, and claude-code.

Rate-limited on one tool but still have context you need? Port your session to another harness and keep going.

harness-exchange --from codex --to opencode

Installation

pip install harness-exchange

Requires Python 3.11+.

Usage

Interactive (arrow-key selection)

harness-exchange --from codex --to opencode

Lists the 15 most recent sessions from the source harness, each with a preview of the first and last message. Use arrow keys to select, Enter to transfer.

Non-interactive (session ID)

harness-exchange --from claude --to codex --session-id <session-uuid>

Combine with --non-interactive for scripting:

harness-exchange --from codex --to opencode --session-id <id> --non-interactive

All combinations

From To
codex opencode
codex claude
opencode codex
opencode claude
claude codex
claude opencode

Options

Flag Description
--from Source harness (codex, opencode, claude)
--to Target harness (codex, opencode, claude)
--session-id Transfer a specific session by ID (skips selection)
--limit Number of recent sessions to show (default: 15)
--non-interactive Skip interactive prompts (requires --session-id)

Storage locations

Each tool stores sessions in a different format:

Tool Format Location
codex JSONL rollouts ~/.codex/sessions/YYYY/MM/DD/*.jsonl
opencode SQLite ~/.local/share/opencode/opencode.db
claude-code JSONL transcript ~/.claude/projects/<cwd>/<sessionId>.jsonl (+ sessions/<pid>.json and history.jsonl)

The tool detects these paths automatically (uses $HOME). Writing to opencode uses opencode's own import command so the schema stays valid; writing to claude-code produces a real projects/ transcript so the session is resumable with claude --resume.

What gets transferred

  • All conversation messages, with user and assistant roles preserved
  • Tool calls and their outputs (where the target format supports them)
  • Session title, working directory (cwd), and timestamps
  • Agent and model information (where available)

Codex injects system prompts and context (AGENTS.md, <environment_context>, permissions/personality specs) as hidden turns; these are filtered out so only the real conversation is carried over.

How it works

  1. Lists the most recent sessions from the source harness (default: 15)
  2. Shows a preview of the first and last real user message for each session
  3. Reads the full session (metadata + all messages) from source storage
  4. Writes the session into the target harness's storage format

The interactive selector uses questionary with a plain-text fallback if the library isn't available.

Development

git clone https://github.com/cnmoro/harness-exchange.git
cd harness-exchange

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

License

MIT

Metadata

Release files for harness-exchange 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for harness-exchange 0.1.0
File Size Uploaded Provenance
harness_exchange-0.1.0.tar.gz 24.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for harness-exchange 0.1.0
File Interpreter ABI Platform
harness_exchange-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 45.5 kB

Release files / harness_exchange-0.1.0.tar.gz

Download URL harness_exchange-0.1.0.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5806c05997d3529f376924fcd6814fc4653dd5bc42f9cf182fc4b332ba4e2288
BLAKE2b-256 checksum
How to use checksums
37e314d5bbd09188baebf2c1c390c2e51f9ae2faded33cd98d9e50bbc650f798
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / harness_exchange-0.1.0-py3-none-any.whl

Download URL harness_exchange-0.1.0-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bab6c1b26544f78ee9738533afd87bf4798e9277de5f05a20f61862df79336d4
BLAKE2b-256 checksum
How to use checksums
13a4db009075536222fd3ff900c00230020989358415841e309f69b54c773b2a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Security for harness-exchange 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page