---
title: "Validate every new agent commit"
description: "Run required checks for the latest agent-produced commit and make decisions from that commit’s results."
url: https://starsling.dev/ci-playbooks/techniques/keep-agent-ci-current
canonicalUrl: https://starsling.dev/ci-playbooks/techniques/keep-agent-ci-current
---

# Validate every new agent commit

Run required checks for the latest agent-produced commit and make decisions from that commit’s results.

## How to choose an approach

Compare the examples by repository setup, prerequisites, and risks before adopting one. Each company implemented this in its own environment; measure each change against your own baseline.

- **[Anthropic](https://starsling.dev/ci-playbooks/anthropic#ci-blocks-agent-regressions)**: Use it when Agents commit or open many pull requests, and existing behavior changes between merges. Check before adopting: Give agents a faster sampled run for their inner loop and keep the full suite as the merge gate, so the gate stays the same check for every agent and every platform.
- **[Shopify](https://starsling.dev/ci-playbooks/shopify#retrigger-ci-on-new-head)**: Use it when Dependency or security pull requests sit in review while the default branch and its lockfile move. Check before adopting: A branch that a person has taken over, or that has an open review, goes back to its author untouched. Adapted for GitHub Actions; compare the original system with yours.

## Apply this technique

````text
Evaluate and apply this CI technique to my repository: Validate every new agent commit.

Run required checks for the latest agent-produced commit and make decisions from that commit’s results.

Read the technique and its source-backed company examples: https://starsling.dev/ci-playbooks/techniques/keep-agent-ci-current.md

Inspect this repository’s CI workflows, build and test commands, dependencies, and recent run timings. Identify where this technique applies and explain the expected benefit using this repository’s evidence.
Measure a baseline from recent comparable runs: elapsed time, queue time, runner minutes and failures where available. If data is unavailable, say what cannot be measured.
Compare relevant company approaches, checking prerequisites, platform differences and tradeoffs. Rank applicable options by evidence, fit and measurable opportunity; do not present company results as predictions for this repo.
Recommend the smallest safe change, show what checks and fallback paths remain, and ASK ME WHICH CHANGE TO APPROVE BEFORE EDITING ANY FILES.
Only after approval, work on a new feature branch, make one reversible change, and open a reviewable pull request. Never merge or push to a default or protected branch.
Keep required checks, test coverage, deployment and release behavior intact. Validate the change and compare equivalent runs where possible; report limitations and what should be monitored after merge.
````

## How companies used this technique

Read what each company changed and follow the original sources.

### Anthropic: Run the existing test suite on every agent commit so new commits cannot break existing code

Anthropic added a continuous integration pipeline with stricter enforcement to its C compiler project, so every new commit from the agent team is tested against existing behavior and cannot break existing code. Bun's Rust port used the same gate at larger scale: the project's pre-existing test suite, run in CI on all platforms, decided when the port could merge.

Evidence: Company-reported result or observation

Over nearly 2,000 Claude Code sessions and $20,000 in API costs, the agent team produced a 100,000-line compiler that can build Linux 6.9 on x86, ARM, and RISC-V. ([Source](https://www.anthropic.com/research/building-c-compiler))

Use it when: Agents commit or open many pull requests, and existing behavior changes between merges.

Before applying it: Give agents a faster sampled run for their inner loop and keep the full suite as the merge gate, so the gate stays the same check for every agent and every platform.

[Read more in the Anthropic playbook](https://starsling.dev/ci-playbooks/anthropic#ci-blocks-agent-regressions)

[Primary source](https://www.anthropic.com/research/building-c-compiler)

### Shopify: Re-run CI on every new head and act only on that head's verdict

**Translated to GitHub Actions**

- What Shopify built: River, Shopify's AI agent in Slack, rebases pull requests and retriggers CI on each new head, then waits for the verdict on that head.
- Your GitHub Actions version: Re-run CI on every new head and act only on the verdict for that head.

Shopify's River, its AI agent in Slack, compares its work ledger with the live repository, pull request and tracker state before it acts on any item. In one batch of eight dependency pull requests River rebased seven and retriggered CI on each new head. The lockfile on the repository head had moved while the upgrades sat in review, so River grafted each upgrade into the current lockfile and left each branch's own copy behind. Each rebase made a new commit, so the CI-passed notifications that arrived moments after a force-push belonged to the earlier heads, and River waited for the real verdicts. Six of the seven came out green and went to their stewarding teams needing only an approval.

Evidence: Company-reported result or observation

2026: Security merges through Shopify's freshness-gated merge queue went from about 10% to 80% since launch. ([Source](https://shopify.engineering/river-vulnerability-remediation))

Use it when: Dependency or security pull requests sit in review while the default branch and its lockfile move.

Before applying it: A branch that a person has taken over, or that has an open review, goes back to its author untouched.

GitHub Actions adaptation: Compare the source system with your own workflow before applying this translation.

[Read more in the Shopify playbook](https://starsling.dev/ci-playbooks/shopify#retrigger-ci-on-new-head)

[Primary source](https://shopify.engineering/river-vulnerability-remediation)

## CI optimization is continuous work.

Apply this technique yourself, or use StarSling Runners for faster GitHub Actions and optional agent-driven optimization PRs, which teams on eligible paid plans can turn on.

[Get self-improving CI](https://starsling.dev/products/runners)

## Company Playbooks

### [Anthropic](https://starsling.dev/ci-playbooks/anthropic)

Run only affected tests

### [DoorDash](https://starsling.dev/ci-playbooks/doordash)

Run build and test in parallel, sharded across CI agents

### [Linear](https://starsling.dev/ci-playbooks/linear)

Benchmark the same job on faster hardware

### [Mastra](https://starsling.dev/ci-playbooks/mastra)

StarSling runners for the slowest test workflow

### [OpenAI](https://starsling.dev/ci-playbooks/openai)

Rank CI fixes by the minutes they save

### [Ramp](https://starsling.dev/ci-playbooks/ramp)

Move a CPU-bound test suite to a faster CPU

### [Shopify](https://starsling.dev/ci-playbooks/shopify)

Let an agent iterate against one CI metric

### [Spotify](https://starsling.dev/ci-playbooks/spotify)

Build arm64 on native arm64 runners

### [Stripe](https://starsling.dev/ci-playbooks/stripe)

Run only the tests a change can reach

### [Uber](https://starsling.dev/ci-playbooks/uber)

Build the merge-queue speculations most likely to be needed
