Context is locked inside private formats
Claude Code and Codex both write JSONL, but their event structures differ. Switching tools usually means copying a summary by hand.
Local-first session bridge
Translate, copy, and sync Claude Code and Codex session history without losing the operational trail.
$ ctxb translate <session-id>
created target session
resume: codex resume ...
Why it matters
Coding-agent sessions include intent, assistant output, tool calls, shell commands, file operations, working directories, timestamps, and titles. Context Bridge normalizes that trace into a shared model, then renders it into a format the next tool can resume.
Pain points
The cost shows up after the switch: context fragments, traces break, and you start explaining the same work again. Context Bridge targets that hidden handoff cost.
Claude Code and Codex both write JSONL, but their event structures differ. Switching tools usually means copying a summary by hand.
A real coding session includes shell commands, patches, file reads, working directories, and errors. Plain chat export is not enough.
Long tasks, multi-day work, and reviews can miss critical commands or decisions when the handoff is written from memory.
Without provenance, generated sessions can be translated again and again, polluting local history.
Create a marked migration session that can later be cleaned, deduped, and skipped as a future sync source.
Create a one-shot native-looking target session without sync tracking metadata.
Mirror recent native sessions in a deterministic way for long-running two-agent workflows.
Capabilities
Normalize harness-specific events into one shared Session model.
Claude Code and Codex each own clear ingest and render logic.
Generated sessions are identifiable, skippable, cleanable, and safe from looped translation.
List, inspect, and filter local sessions across harnesses.
Install Claude Code Stop hooks or Codex notify hooks for lightweight auto-sync.
Expose session lookup, translation, and resume-command preparation over stdio.
Case tours
Move a session after the discovery, implementation, and test history already exist, then let the next agent continue from that trace.
ctxb list --harness claude-code
ctxb smoke <session-id>
ctxb translate <session-id> --to codex
Copy architecture notes, risk findings, file context, and command output into a fresh target session without marking it as generated.
ctxb copy <session-id>
# no provenance markers
# fresh target session id
Use sync or watch to mirror recent native sessions while fingerprints and source markers prevent duplicate chains.
ctxb sync --direction both --days 14
ctxb watch --direction both --days 1 -i 30
Let MCP hosts list sessions, trigger conversion, and receive executable resume commands without hard-coding local agent paths.
ctxb mcp config-snippet
ctxb mcp serve
Let one agent implement and another review while the generated target session keeps source metadata for later audit.
ctxb inspect <source-session>
ctxb translate <source-session>
ctxb inspect <target-session>
Use dry-run cleanup and dedupe commands to inspect generated sessions before removing confirmed migration artifacts.
ctxb clean --dry-run
ctxb dedupe --dry-run
# rerun without --dry-run when ready
Usage guide
List sessions first, then run a smoke check. Once the direction and resume command look right, choose translate, copy, or sync.
Global installation gives you both context-bridge and the short ctxb alias.
npm install -g @mmmjk/context-bridge
ctxb --help
Start with a short time window, then widen --days if needed.
ctxb list --harness both --days 7 -n 20
ctxb inspect <session-id>
Smoke verifies conversion and prints the resume command without running a live model.
ctxb smoke <session-id>
ctxb smoke <session-id> --to codex
Use translate for traceable migration, copy for a clean independent start, and sync or watch for long-term mirroring.
ctxb translate <session-id>
ctxb copy <session-id>
ctxb sync --direction both --days 14
Translate prints the target agent resume command. Replace the prompt with your next task and continue.
# printed by translate
codex resume ... "<your next prompt>"
CLI first
The primary command is context-bridge, with ctxb as a shorter alias.
Core operations are local file reads and writes.
ctxb list --harness both --days 30 -n 20
ctxb inspect <session-id>
ctxb smoke <session-id>
ctxb translate <session-id>
ctxb copy <session-id>
# fresh target session
# no sync tracking metadata
ctxb sync --direction both --days 365
ctxb watch --direction both --days 1 -i 30
Install
npm install -g @mmmjk/context-bridge
context-bridge --help
ctxb --help