claude-settings-to-codex
v0.1.2
Published
Convert Claude Code settings.json permission settings into a Codex-oriented config.toml and conversion report.
Downloads
287
Maintainers
Readme
claude-settings-to-codex
claude-settings-to-codex is a CLI that converts a Claude Code settings.json file into a Codex-oriented config.toml plus a conversion report.
It focuses on permissions.allow, permissions.ask, and permissions.deny. Because Codex cannot represent Claude's per-command allowlist and denylist rules exactly, this tool performs a best-effort safe approximation and records incompatible parts in the report.
For common Git and GitHub CLI workflows, the report also suggests reusable Codex prefix_rule candidates such as ["git", "push"] or ["gh", "pr", "create"] so users can approve those operations once instead of being prompted every time. It also recognizes Claude wildcard-style entries like Bash(git:*) and Bash(gh:*), mapping them to broader Codex prefix candidates such as ["git"] and ["gh"]. Those recommendations are also written into config.toml as developer_instructions, because Codex does not expose a static per-command allowlist in config.toml. Denied Bash entries are excluded from these recommendations.
Usage
npx claude-settings-to-codexWhen you run it inside any project directory, it uses these default paths relative to the current directory:
- Input:
.claude/settings.json - Output:
.codex/config.toml - Report:
conversion-report.md
You can also override the paths explicitly:
npx claude-settings-to-codex \
--input ./path/to/settings.json \
--output ./.codex/config.toml \
--report ./conversion-report.mdNetwork handling:
npx claude-settings-to-codex --network off
npx claude-settings-to-codex --network auto
npx claude-settings-to-codex --network onoff: always generatenetwork_access = falseauto: setnetwork_access = trueonly when commands such asnpm install,curl,git push,git:*, orgh:*are detectedon: always generatenetwork_access = true
If you do not pass --network, the default is auto.
Local Development
If you want to test the CLI locally before publishing:
npm link
cd /path/to/target-project
claude-settings-to-codexYou can also run it directly from this repository:
node src/cli.js --helpConversion Policy
- Extract and analyze
Bash(...)rules - Generate
approval_policy = "on-request"by default - Generate
network_accesswith--network autosemantics by default - Use
sandbox_mode = "workspace-write"when at least one Bash permission exists, otherwiseread-only - Detect common Git / GitHub command families and suggest reusable
prefix_ruleapprovals in the report - Recognize wildcard-style Bash permissions like
Bash(git:*)andBash(gh:*) - Write suggested
prefix_rulefamilies intodeveloper_instructionsso Codex can request durable approvals using those prefixes - Prefer the most specific matching
prefix_rulecandidate to avoid over-broad approvals - Leave exact
allowanddenymappings as unsupported or lossy items in the report - Approximate Claude
askentries withon-request - Treat
gh ...,git push,git pull,git fetch, andgit:*commands as network-requiring when--network autois used
Test
npm testPublishing To npm
- Log in to npm:
npm login - Check whether the package name is available:
npm view claude-settings-to-codex - Run the tests:
npm test - Review the package contents:
npm pack --dry-run - Publish:
npm publish --access public
After publishing, users can run it from any project like this:
cd /path/to/project
npx claude-settings-to-codex