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

cx2cc

v0.1.0

Published

Convert Codex sessions to Claude Code session format for /resume

Readme

cx2cc

Convert Codex sessions into Claude Code session files so they appear in Claude Code's session history.

Why

The inverse of cc2cx. If you switch between Codex and Claude Code or want to reference a Codex session from Claude Code, this tool bridges the gap. It reads a Codex rollout JSONL, converts messages/tool calls/reasoning into Claude Code's session format, and writes the result so Claude Code discovers it.

Install

bun install -g cx2cc

Or run directly without installing:

bunx cx2cc <session-id|last>

npx cx2cc and npm install -g cx2cc work too.

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

Usage

cx2cc <session-id|last|path> [options]

Arguments:

  • session-id -- UUID (or prefix) of a Codex session (e.g. 019cb95c-bd13-7301-b898-2cc6832b32a7)
  • last -- automatically picks the most recently updated session
  • path -- direct path to a rollout JSONL file

Options:

| Flag | Description | |------|-------------| | --dry-run | Print converted JSONL to stdout without writing any files | | --project PATH | Override the Claude Code project path (default: session's cwd) | | --verbose | Print conversion stats (turns, lines, file paths) |

Examples

Convert the most recent Codex session:

cx2cc last

Preview what would be generated without writing anything:

cx2cc last --dry-run

Convert a specific session with verbose output:

cx2cc 019cb95c-bd13-7301-b898-2cc6832b32a7 --verbose

After running, the session will appear in Claude Code's session history for the corresponding project.

What it does

  1. Resolves the Codex rollout file via ~/.codex/state_5.sqlite (by session ID or most recent)
  2. Parses the rollout JSONL, extracting session metadata and grouping response items into turns
  3. Converts each turn into Claude Code's session format:
    • User messages with text content
    • Assistant messages with thinking, text, and tool_use content blocks
    • User continuation messages with tool_result blocks
    • Linked-list structure via uuid/parentUuid chain
  4. Writes the session file to ~/.claude/projects/<encoded-cwd>/<session-id>.jsonl

Tool mapping

Codex tools are translated to their Claude Code equivalents:

| Codex | Claude Code | |-------|-------------| | exec_command | Bash (or Read/Grep/Glob if pattern-detected) | | apply_patch (custom tool) | Edit | | mcp__* | Passed through unchanged |

When a session was originally converted with cc2cx, the original tool names are recovered by pattern-matching the command strings (e.g. cat -n back to Read, rg back to Grep).

Limitations

  • Subagent/team sessions are not converted (main session only)
  • Image content blocks are dropped
  • Token counts are not reconstructed
  • Native Codex apply_patch diffs are stored as metadata on Edit blocks rather than parsed into old/new strings

License

MIT