Skip to content

Repository files navigation

claude2codex

Universal migration tool from Claude Code to OpenAI Codex CLI.

Scans your Claude Code setup (~/.claude, plugins, MCP servers, skills, commands, agents) and migrates it to Codex CLI (~/.codex, ~/.agents/skills, prompts) with full safety: automatic snapshots, rollback, and transparent loss reporting.

Quick Start

npx claude2codex migrate

This will:

  1. Scan your Claude Code setup
  2. Show you what will change (plan preview)
  3. Ask for confirmation
  4. Create a snapshot of your existing ~/.codex/
  5. Apply the migration
  6. Verify the result
  7. Write a loss report

Commands

CommandDescription
claude2codex scanScan Claude Code setup, output inventory
claude2codex planScan + convert, show what would change (dry-run)
claude2codex migrateScan + convert + apply with snapshot
claude2codex rollbackRestore from latest snapshot
claude2codex doctorVerify current Codex setup health
claude2codex reportRe-print the latest migration report
claude2codex snapshotsList available snapshots
claude2codex dump-fixtureExport anonymized setup for regression testing

Global Options

--claude-home <path> Claude home directory (default: ~/.claude)
--codex-home <path> Codex home directory (default: ~/.codex)
--overwrite Replace existing files/keys
--no-projects Skip project-scope migration
--no-network Skip upstream plugin inspection
--only <types> Only convert specific types (mcp,skill,command,...)
--skip <types> Skip specific types
--yes, -y Skip confirmation prompts
--json Structured JSON output
--verbose, -v Verbose logging

What Gets Migrated

Claude CodeCodex CLINotes
CLAUDE.mdAGENTS.mdContent appended with markers
~/.claude/skills/~/.agents/skills/Near-1:1 copy
~/.claude/commands/~/.codex/prompts/Frontmatter stripped
MCP serversconfig.toml [mcp_servers.*]All transports (stdio/http/sse)
Plugins (with .codex/)Clone + self-installUpstream-aware
Plugins (without .codex/)Unpacked to skills/prompts/mcpMechanical
SubagentsSkills + multi_agent=trueLossy (tools lost)
HooksDropped (except Stop→notify)Reported as loss
Permissionssandbox_mode + approval_policyCoarse mapping

Safety

  • Snapshot before every migration -- automatically created at ~/.codex/.claude2codex-backup-<timestamp>/
  • Automatic rollback on failure -- if any step fails, the entire migration is reverted
  • Non-destructive merge -- existing Codex config is preserved; new items are added alongside
  • Idempotent -- re-running migrate is safe; markers prevent duplication
  • Secrets never stored -- only env key names appear in IR and config; values use ${VAR} placeholders

Loss Reporting

Items that can't be translated are reported in ~/.claude2codex/reports/<timestamp>.md:

  • Action Required: dropped hooks, collapsed permissions, pending secrets
  • Informational: dropped frontmatter keys, plugin namespace flattening

Contributing

Export your setup as an anonymized fixture for regression testing:

claude2codex dump-fixture --output my-fixture

Then submit the fixture directory as a PR to help cover more edge cases.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

24 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages