Skip to content

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.

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.

  1. Codex: trust the project. Codex reads the project’s .codex/ only once it trusts the project. Run codex interactively once at the repo root and accept the trust prompt. (codex exec -s danger-full-access marks the project trusted without a prompt.)
  2. Codex: check the rules file. codex execpolicy check --rules .codex/rules/cvsm.rules gh pr merge 1 should print forbidden. This checks only the file itself.
  3. 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.
  4. Claude Code: check a live session. Open a session in the repo and confirm that all four skills are listed.

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.md for PR #<PR>.”
  • Codex: codex exec -s danger-full-access "Follow .agents/skills/review/SKILL.md for PR #<PR>." codex exec is sandboxed without network by default, and gh needs 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, --base can’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] means changes, otherwise pass. 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.

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.