Keep CI useful with coding agents
Updated
Coding agents push more often than people do, and every push starts CI, which keeps queues long and bills growing. The way out is to have the agent run the checks before it pushes, and have CI reuse that result instead of repeating it.
Why agents multiply CI
- They iterate through CI. An agent that doesn't run the checks itself pushes, reads the failure, and pushes again.
- They run in parallel. Several agents on one repository each start pipelines of their own.
- They repeat work. An agent's sandbox has no record of what you, CI or another agent already tested, so it runs everything again.
Check before the push
Tell the agent to run the checks first, in AGENTS.md or its instructions file. Instructions aren't a guarantee, so a pre-push hook is what makes them hold. A hook that runs the whole suite can time out a push, though, and an agent may work around it.
With hushrun, the hook runs no checks. It asks what CI would still run on this exact code, and refuses a recognized agent's push while a check that can run here hasn't passed:
$ git push hushrun: push refused: CI would run test again on a0b1c2d test: no pass yet for this exact code Run these here, then push again: npm run test
It knows the checks in the root package.json and in hushrun.yaml's stages, and leaves to CI what can't run here. People and agents it doesn't recognize get a warning, and --no-verify still gets past it. Nothing is lost when it does: CI runs whatever has no pass. npx hushrun ready prints the same list at any time, and --format json gives it as data. For coding agents has the details.
Share results between the agent and CI
Running the checks twice, once in the sandbox and again in CI, only moves the cost. To count once, the result has to reach CI. With hushrun run, a pass the agent records skips the check in CI, and the other way round:
$ hushrun run e2e -- playwright test --project site hushrun: e2e skipped: this exact code passed 1 min ago (saves 16s)
- On your laptop, an agent such as Claude Code, Codex or Cursor's agent uses your sign-in, with nothing to set up.
- In a sandbox, such as a Claude Code cloud session or an E2B or Docker sandbox, it uses an agent token and the key that comes with it. See Agents and sandboxes.
An agent also skips what another agent passed on the same files, so a fleet doesn't test the same code once per sandbox.
Decide what CI should trust
A pass from an agent means the agent's sandbox ran the check. Whether that's enough for your repository is your call:
- Reuse by default. CI skips a check that a laptop or an agent passed on the same files. Every such result is signed by a registered machine or by the agent's key.
- CI reuses only CI's results. Turn on this setting for a repository, and CI skips only on passes CI recorded. Agents still save time in their own runs.
- CI-only stages. For deploys, promotion can take evidence from CI alone. Approvals only ever count from people, so no agent approves its own deploy.
Set it up
Give your agent this prompt, or run npx hushrun init yourself:
Add hushrun to this repository. Run `npx hushrun init --yes` at the repository root; it prints a sign-in link, which I'll approve in my browser. Then show me the diff it made, run the checks it wrapped once, and commit the change on a new branch.init writes a skill and an AGENTS.md block for the agents that read them, and installs the hook.