Claude Code and Codex
CVSM works with Claude Code and Codex from one set of files: both read AGENTS.md and the same four skills, and each has its own config that forbids gh pr merge. You can run sessions of either tool side by side, each on its own task.
What each tool reads
Section titled “What each tool reads”| Claude Code | Codex | |
|---|---|---|
| Rules | AGENTS.md |
AGENTS.md |
| Skills | .claude/skills, a symlink to ../.agents/skills |
.agents/skills |
| Merge ban | .claude/settings.json: permissions.deny with Bash(gh pr merge:*) |
.codex/rules/cvsm.rules: gh pr merge is forbidden |
| Machine account (optional) | .claude/settings.local.json sets GH_CONFIG_DIR |
.codex/config.toml sets GH_CONFIG_DIR |
AGENTS.md is the only instruction file. Don’t add a CLAUDE.md: guard rejects .md files outside the allowed places, and CVSM reads only AGENTS.md.
Check that the rules are loaded
Section titled “Check that the rules are loaded”- Codex: trust the project. Codex reads the project’s
.codex/only once it trusts the project. Runcodexinteractively once at the repo root and accept the trust prompt. (codex exec -s danger-full-accessmarks the project trusted without a prompt.) - Codex: check the rules file.
codex execpolicy check --rules .codex/rules/cvsm.rules gh pr merge 1should printforbidden. This checks only the file itself. - Codex: check a live session. Open a Codex session in the repo and ask it to run
gh pr merge --help. The rule should block it; even if allowed, this command merges nothing. Confirm that all four skills (plan,implement,review,run) are listed. - Claude Code: check a live session. Open a session in the repo and confirm that all four skills are listed.
Start a fresh-context review
Section titled “Start a fresh-context review”The implementer never reviews its own PR. It starts a fresh reviewer that gets only the PR number, following section 4 of the review skill:
- Claude Code: a fresh subagent with the prompt “Follow
.agents/skills/review/SKILL.mdfor PR #<PR>.” - Codex:
codex exec -s danger-full-access "Follow .agents/skills/review/SKILL.md for PR #<PR>."codex execis sandboxed without network by default, andghneeds it, hence-s danger-full-access. - Codex built-in review, run in a checkout of the PR head with
codex exec review "<instructions>". In Codex 0.163,--basecan’t be combined with instructions, so the instructions name the base (git diff origin/main...HEAD) and carry the issue body, the Decisions on the issue and its parent, the parent’s spec if it is a study, and the review checklist. Its output tags findings[P0]to[P3]: any[P0]or[P1]meanschanges, otherwisepass. The session that ran it posts the output verbatim under the Verdict line, only if the PR head still equals the reviewed SHA.
For the inner loop before a PR, the implementer gives a fresh subagent, or codex exec -s danger-full-access in the worktree, only the issue number and the diff. That pre-PR review posts nothing.
Use a machine account with both
Section titled “Use a machine account with both”If agents use a machine account, both tools need GH_CONFIG_DIR pointed at its gh login, through two local files listed in .git/info/exclude:
-
.claude/settings.local.json:{"env": {"GH_CONFIG_DIR": "<dir>"}} -
.codex/config.toml:[shell_environment_policy]set = { GH_CONFIG_DIR = "<dir>" }
Both files live only in the main clone. A session started from the main clone passes the setting to the agents it starts; if you open a session directly in a worktree, put copies there first. The full setup is in Adopt CVSM.