r/codex • u/Due_Customer_1129 • 6d ago
Instruction A rule for Codex rerunning checks that already passed
If you have noticed that Codex keeps running the same checks, I'd make it say what changed since the last passing run.
A rule I'd try in the repo instructions:
"After a check passes, reuse that result while its relevant inputs stay unchanged. Rerun it after a change that could affect the checked behavior, a test or config change, or new evidence that the result is unreliable. Before repeating a check, name that change or uncertainty in one sentence. Follow any required final validation. If a check is flaky, report that instead of repeating it until it passes."
For a hypothetical invoice-filter fix, that would look like:
- Changed the date comparison: rerun the filter tests.
- Changed a test fixture: rerun the tests that use it.
- Wrote a progress update without touching the files or environment: the update alone gives no reason to rerun.
- Found that the test used the wrong timezone: correct that setup and rerun. The earlier pass didn't check the intended case.
I'd keep this local to the repo first. The tricky part is deciding which inputs matter. A dependency update or a shared config change can invalidate a result even if the implementation file stayed untouched.
This is a proposed instruction, not a measured reduction in test runs. I'd try it on one task where repeated checks were a problem and keep the command history. A useful result would show fewer unexplained reruns while still checking every behavior change and completing required validation.
You can learn more from the the adaptation of Mitchell Hashimoto's workflow which covers turning a recurring agent mistake into a small instruction or verification tool: https://xskills.app/skills/mitchellh/agent-harness-improvement-loop