DiffCI

Codex

Give Codex a measured CI validation step.

DiffCI lets Codex explain the tests a change can reach, fall back when the evidence is incomplete, and compare the selected path with the full test command when both can run safely.

npx "@diffci.com/diffci@latest" init
npx "@diffci.com/diffci@latest" check

Install the repository policy

Run init from the repository root. It creates an AGENTS.md instruction that tells Codex to use DiffCI as a validation lens before PR-ready answers, while preserving the repository's required commands.

On Windows PowerShell, quote the scoped package if the shell parses the @ token:

npx '@diffci.com/diffci@latest' check

Existing instruction files are preserved. Review the generated policy before committing it.

What Codex should report

A useful completion answer names the DiffCI verdict, fallback reason, selected tests, commands that actually ran, and the report path. A selection count alone is not runtime evidence.

  • Paired commands passed: report measured timings with the stated checkout and command scope.
  • Full-run fallback: report that the change could not be narrowed safely.
  • REFUSED or ERROR: continue with the repository's normal test commands.

Test commands may create generated files. Use observe --no-send when the task calls for analysis without execution.

Optional MCP connection

Codex clients with stdio MCP support can run npx -p "@diffci.com/diffci@latest" diffci-mcp and call diffci_check. The tool has the same execution behavior and safety boundary as the CLI command.

If the tool reports REFUSED, confirm that the checkout contains both comparison commits and that Git and Node.js 22.5 or later are available. If it reports ERROR, preserve the diagnostic and run the repository's normal validation commands.

Verify the Codex setup

  • Confirm the applicable AGENTS.md includes the DiffCI instruction and is not shadowed by a more specific instruction file.
  • Run one direct check from the repository root and verify that Codex reports the verdict, executed commands, fallback evidence, and output path.
  • On PowerShell, keep the scoped package name quoted; on every platform, retain the repository's required validation after a refusal or error.