claude-to-codex
v0.1.3
Published
Convert Claude Code repo artifacts (CLAUDE.md, skills, commands, agents) into Codex-native equivalents
Readme
claude-to-codex
[!WARNING] This project was primarily vibe-coded with GPT-5.4. It works, but review the output before trusting it blindly.
Convert Claude Code repo artifacts into Codex-native equivalents. Run it once to migrate your project's CLAUDE.md files, skills, commands, and agent configs to the Codex format.
What it converts
CLAUDE.md→AGENTS.md(andCLAUDE.local.md→AGENTS.override.md,.claude/CLAUDE.md→.agents/AGENTS.md).claude/skills/→.agents/skills/— entire skill directories copied with all supporting files.claude/commands/→.agents/skills/— commands converted to Codex skills.claude/agents/→.codex/config.toml+.codex/agents/*.toml— agent roles, MCP servers, model, sandbox mode- Path references in all text content automatically rewritten to Codex equivalents
disable-model-invocation→ generates Codexopenai.yamlpolicy files- Symlinks between
CLAUDE.md↔AGENTS.mdreplaced with concrete files
Usage
# Preview what would change (dry-run is the default)
npx claude-to-codex@latest
# Preview with machine-readable output
npx claude-to-codex@latest --json
# Apply changes
npx claude-to-codex@latest --writeWorks with any Node package runner:
bunx claude-to-codex@latest --write
pnpm dlx claude-to-codex@latest --writeOptions
--dry-run Plan changes without writing files (default)
--write Write the planned changes
--json Print machine-readable output
--emit-report Write codex-migration-report.json after a successful write
--root-dir <path> Explicit conversion root
--dangerous-allow-dirty-git Allow writes when the git worktree has uncommitted changes
--dangerous-no-git-backup Allow writes without git-backed rollback safetyDetails
Agents
Agent markdown files (.claude/agents/<name>.md) are converted into a central .codex/config.toml (enabling multi_agent and registering all roles) plus per-agent .codex/agents/<role-id>.toml files containing developer_instructions, model, sandbox_mode, and mcp_servers.
Converted agent features:
- Markdown body →
developer_instructions - Inline
mcpServersdefinitions (command,args,url,env, etc.) →[mcp_servers.<name>]in role TOML description→ registered inconfig.toml- Tool restrictions and permission modes →
sandbox_modeinference (see Models, Roles & Permissions)
Dropped agent features (no Codex equivalent — warnings emitted):
maxTurns,skills(preload),hooks,memory,background,isolation- MCP servers referenced by name only (string array) — concrete config unavailable
permissionMode: dontAskandpermissionMode: bypassPermissions
Paths
All text content (instruction files, skills, commands) is scanned for Claude-specific path references which are rewritten to Codex equivalents:
CLAUDE.md→AGENTS.mdCLAUDE.local.md→AGENTS.override.md.claude/CLAUDE.md→.agents/AGENTS.md.claude/skills/→.agents/skills/.claude/agents/→.codex/config.toml and .codex/agents/
Exact artifact source-to-target paths are applied first, then generic patterns catch remaining references. Binary files in skill directories are copied verbatim without rewriting.
Models, Roles & Permissions
Model mapping:
opus→gpt-5.5withmodel_reasoning_effort = "high"sonnet→gpt-5.5withmodel_reasoning_effort = "medium"haiku→gpt-5.5withmodel_reasoning_effort = "low"
Built-in role mapping:
Explore→explorergeneral-purpose→worker(approximated)Plan→planner(forcedread-onlysandbox)
Permission and sandbox inference:
permissionMode: plan→sandbox_mode = "read-only"permissionMode: acceptEdits→ inherited (approximated)toolsallowlist withoutEdit/Write→sandbox_mode = "read-only"disallowedToolsblockingEdit/Write→sandbox_mode = "read-only"
Safety
- Dry-run by default — nothing is written unless you pass
--write. - Refuses to write in a dirty worktree unless you pass
--dangerous-allow-dirty-git. - Refuses to write outside a git repo unless you pass
--dangerous-no-git-backup. - Never writes to gitignored target paths.
- Skips files that are already up to date (content-equal check).
- Never deletes files it didn't create.
- Pass
--emit-reportwith--writeto generate acodex-migration-report.jsonwith full details on what was discovered, converted, skipped, dropped, and approximated.
License
MIT
