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

cc2cx

v0.1.0

Published

Convert Claude Code sessions to Codex-compatible rollout format for /resume

Readme

cc2cx

Convert Claude Code sessions into Codex rollout files so they appear in codex resume.

Why

We all know that Claude is better at some things and Codex is better at others. If you switch between them or want to reference a Claude Code session from Codex's /resume picker, this tool bridges the gap. It reads a Claude Code session JSONL, converts messages/tool calls/reasoning into Codex's rollout format, and registers the result so Codex discovers it.

Install

bun install -g cc2cx

Or run directly without installing:

bunx cc2cx <session-id|last>

npx cc2cx and npm install -g cc2cx work too.

Requires Node.js 18+ and a native compilation toolchain for better-sqlite3.

Usage

cc2cx <session-id|last> [options]

Arguments:

  • session-id -- UUID of a Claude Code session (e.g. 862e1482-b9cb-49ad-8631-e297a82463e0)
  • last -- automatically picks the most recently modified session across all projects

Options:

| Flag | Description | |------|-------------| | --dry-run | Print converted JSONL to stdout without writing any files | | --no-register | Write the rollout file but skip history.jsonl and SQLite registration | | --project PATH | Limit session search to a specific Claude Code project path | | --verbose | Print conversion stats (turns, lines, file paths) |

Examples

Convert the most recent Claude Code session:

cc2cx last

Preview what would be generated without writing anything:

cc2cx last --dry-run

Convert a specific session with verbose output:

cc2cx 862e1482-b9cb-49ad-8631-e297a82463e0 --verbose

After running, open Codex and the session will appear in the /resume list.

What it does

  1. Resolves the Claude Code session file from ~/.claude/projects/
  2. Parses the JSONL, deduplicating streamed assistant messages and walking the linked-list message chain
  3. Segments messages into turns (each user message starts a new turn)
  4. Converts each turn into Codex's rollout format:
    • session_meta header
    • response_item entries for user/assistant messages, reasoning, and tool calls
    • event_msg entries for turn lifecycle (task_started, task_complete, etc.)
    • turn_context metadata
  5. Writes the rollout file to ~/.codex/sessions/YYYY/MM/DD/
  6. Registers the session in ~/.codex/history.jsonl and ~/.codex/state_5.sqlite so it appears in /resume

Tool mapping

Claude Code tools are translated to their Codex equivalents:

| Claude Code | Codex | |-------------|-------| | Bash | exec_command | | Read | exec_command (as cat -n) | | Edit | exec_command (as apply_patch) | | Write | exec_command (as cat >) | | Grep | exec_command (as rg) | | Glob | exec_command (as rg --files) | | WebSearch, WebFetch | exec_command (as comment) | | mcp__* | Passed through unchanged | | ToolSearch | Skipped |

Limitations

  • Subagent/team sessions are not converted (main session only)
  • Image content blocks are dropped
  • Token counts are not reconstructed
  • Thinking blocks are emitted as plaintext reasoning summaries

License

MIT