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.
npx claude2codex migrateThis will:
- Scan your Claude Code setup
- Show you what will change (plan preview)
- Ask for confirmation
- Create a snapshot of your existing
~/.codex/ - Apply the migration
- Verify the result
- Write a loss report
| Command | Description |
|---|---|
claude2codex scan |
Scan Claude Code setup, output inventory |
claude2codex plan |
Scan + convert, show what would change (dry-run) |
claude2codex migrate |
Scan + convert + apply with snapshot |
claude2codex rollback |
Restore from latest snapshot |
claude2codex doctor |
Verify current Codex setup health |
claude2codex report |
Re-print the latest migration report |
claude2codex snapshots |
List available snapshots |
claude2codex dump-fixture |
Export anonymized setup for regression testing |
--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
| Claude Code | Codex CLI | Notes |
|---|---|---|
CLAUDE.md |
AGENTS.md |
Content appended with markers |
~/.claude/skills/ |
~/.agents/skills/ |
Near-1:1 copy |
~/.claude/commands/ |
~/.codex/prompts/ |
Frontmatter stripped |
| MCP servers | config.toml [mcp_servers.*] |
All transports (stdio/http/sse) |
| Plugins (with .codex/) | Clone + self-install | Upstream-aware |
| Plugins (without .codex/) | Unpacked to skills/prompts/mcp | Mechanical |
| Subagents | Skills + multi_agent=true |
Lossy (tools lost) |
| Hooks | Dropped (except Stop→notify) | Reported as loss |
| Permissions | sandbox_mode + approval_policy |
Coarse mapping |
- 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
migrateis safe; markers prevent duplication - Secrets never stored -- only env key names appear in IR and config; values use
${VAR}placeholders
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
Export your setup as an anonymized fixture for regression testing:
claude2codex dump-fixture --output my-fixtureThen submit the fixture directory as a PR to help cover more edge cases.
MIT