npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

agent-session-bridge

v0.1.1

Published

Bridge local AI coding sessions between Pi, Claude Code, and Codex.

Readme

Agent Session Bridge

CI License: MIT npm version

Local-first session portability for Pi, Claude Code, and Codex.

agent-session-bridge mirrors resumable conversations between the three local coding agents so you can start in one tool, switch tools in the same folder, and keep going from the same thread.

Agent Session Bridge demo

https://github.com/user-attachments/assets/d1b151a4-78e9-42ef-98ee-bb5045809f51

Why

Each agent stores sessions in a different place and in a different format:

  • Pi uses session trees in ~/.pi/agent/sessions
  • Claude Code uses JSONL transcripts in ~/.claude/projects
  • Codex uses rollout event logs in ~/.codex/sessions

This project sits between them and keeps those local stores in sync.

The goal is simple:

  1. talk to Pi in a repo
  2. open Claude Code or Codex in that same repo
  3. resume the same conversation instead of starting over

What Makes It Different

This repo is not a session viewer, a skills sync, or a live agent-to-agent bridge.

It is focused on one job:

  • parse native session formats
  • convert them into the other tools' native formats
  • keep replay-safe mirror state on disk
  • repair older imported sessions when history got messy

The distinctive angle is local-first durability.

  • The bridge writes directly into each tool's own session store.
  • The CLI installs self-contained runtime assets into ~/.agent-session-bridge/runtime.
  • Sync, repair, and validation are all built around real local agent behavior.

Install

Public npm install:

npx agent-session-bridge setup
npx agent-session-bridge doctor

Or install globally:

npm install -g agent-session-bridge
agent-session-bridge setup
agent-session-bridge doctor

Tarball flow also works if you want to test an unpublished local build:

npm pack
npx --yes --package ./agent-session-bridge-0.1.1.tgz agent-session-bridge setup
npx --yes --package ./agent-session-bridge-0.1.1.tgz agent-session-bridge doctor

Local checkout flow:

git clone https://github.com/bohdanpodvirnyi/agent-session-bridge.git
cd agent-session-bridge

pnpm install
pnpm build
node packages/cli/dist/cli/src/index.js setup
node packages/cli/dist/cli/src/index.js doctor

CLI

Main commands:

  • setup: install Pi, Claude Code, and Codex integration for the current repo
  • enable: enable sync for the current repo or globally
  • doctor: read-only health check for bridge config, installed integrations, hook status, and registry links for the current repo
  • repair: rewrite already-existing mirrored Pi or Claude session files for the current repo when imported history needs cleanup
  • import: backfill foreign sessions into selected target tools with --latest or --all
  • list: show registry conversations
  • audit: dump the local bridge registry

Examples:

agent-session-bridge setup
agent-session-bridge enable --global
agent-session-bridge doctor
agent-session-bridge repair
agent-session-bridge import --tool codex --all

Command Semantics

  • doctor does not import, repair, or create links.
  • doctor reports bridge registry conversations linked to the current repo, not the total number of raw session files on disk.
  • repair only cleans mirrored Pi and Claude session files that already exist for the current repo.
  • repair does not backfill old sessions, discover missing sessions, or create new bridge links.
  • import --latest imports the single best foreign-session candidate for the repo into the selected target tool.
  • import --all is the one-shot backfill command. It imports all foreign-session candidates for the repo into the selected target tool.

Typical recovery flow:

  1. Run agent-session-bridge doctor to confirm setup, config, and hook health.
  2. Run agent-session-bridge import --tool <target> --all to backfill older sessions into a target tool.
  3. Run agent-session-bridge repair only if imported Pi or Claude transcripts need cleanup afterward.

How It Works

At a high level:

  1. detect a source session from Pi, Claude Code, or Codex
  2. normalize it into a shared internal message model
  3. write compatible mirror entries into the target tool stores
  4. track offsets and mirror identities in a local registry
  5. prevent replay loops and repair malformed historical imports

Runtime state lives under:

  • ~/.agent-session-bridge/config.json
  • ~/.agent-session-bridge/registry.json
  • ~/.agent-session-bridge/runtime/

Repo Layout

Top-level packages:

  • packages/core: parsers, converters, registry, config, sync, dedupe, repair helpers
  • packages/cli: install, doctor, import, repair, audit, and setup commands
  • packages/pi: Pi integration surface
  • packages/claude-code: Claude Code integration surface
  • packages/codex: Codex integration surface
  • packages/daemon: optional backfill and filesystem-driven helpers

Reference material:

Validation

This repo includes:

  • parser and converter unit tests
  • file-level end-to-end coverage
  • temp-home integration tests
  • real-command E2E coverage against installed pi, claude, and codex

Run the standard suite:

pnpm test
pnpm typecheck
pnpm fixture:validate
pnpm exec prettier --check .

Run the real-agent suite:

pnpm test:real-agents

Examples

Config examples live in examples/config.

The demo loop in examples/flows/three-agent-loop.md shows the intended flow:

  1. start a conversation in Pi
  2. resume it in Claude Code
  3. continue it in Codex
  4. come back to Pi and keep going

Current Limitations

  • Older imported transcripts can still need repair if they were created by earlier bridge versions.
  • Some legacy Codex imports can still emit orphan-output warnings during resume.
  • Public API and config shape may still evolve as the project hardens.