{"slug": "abusing-git-trailers-for-faster-ci-cd", "title": "Abusing Git Trailers for Faster CI/CD", "summary": "A developer's write-up describes using git commit trailers to cut CI/CD time: a hook has coding agents run tsc, lint and unit tests before pushing, and the commit records what ran in a `Checks-Run` trailer that the PR build reads to skip those steps. The trailer took about three minutes off each PR build, and the author reports reduced Buildkite agent contention at 100+ PRs a day, with `main` still running every step regardless of the trailer because a trailer is a claim, not a proof.", "body_md": "In [Don't Run It Twice](https://jonathannen.com/dont-run-it-twice/), I wrote about why our CI skips the checks an agent has already run. This is more on the how: using git trailers.\n\nA trailer is a `Key: value` line at the bottom of a commit message, under a blank line<sup>[\\[1\\]](#fn1)</sup>. You may have seen them as `Signed-off-by` and `Co-authored-by`<sup>[\\[2\\]](#fn2)</sup> against your commit.\n\n``` bash\n$ git commit -m \"Fix the stale cache\" --trailer \"Checks-Run: tsc, lint, unit\"\n$ git log -1 --format='%(trailers:key=Checks-Run,valueonly)'\ntsc, lint, unit\n```\n\nWe have a hook that has coding agents run `tsc`, lint and the unit tests before they push. In the vast majority of cases this is running on a cloud VM somewhere.\n\nCI used to repeat this on every push. And since we care about CI/CD times this was an aggressive fan-out to keep cycle times short.\n\nMy solution: the agent's commit records what it ran as a trailer, like the `Checks-Run` line above. The build on a PR/branch reads the trailer off the commit and skips the steps it lists. Everything else runs as normal.\n\nThe trailer travels with the commit, so CI has it the moment it has the code. There's no cache to stand up and no service to call.\n\nLike [a PR description](https://jonathannen.com/cold-read/), a trailer is a claim, not a proof. So only the PR build accepts the trailers. `main` runs every step again, whatever the trailer says.\n\nThe trailer took about three minutes off each PR build<sup>[\\[3\\]](#fn3)</sup>. The wall-clock time was the obvious win, but the bigger one was contention. Fewer Buildkite agents (the build-runner kind of agent) get spun up, fewer jobs sit waiting for one, and the ones that stay warm cache better. It's queuing theory at work: waits grow non-linearly as a pool gets busier, so shedding a little load cuts a lot of waiting. At 100+ PRs a day that is a lot of build minutes.\n\nYes, it's a poor man's Bazel<sup>[\\[4\\]](#fn4)</sup>. If your agents already run the checks before they push, give it a shot.", "url": "https://wpnews.pro/news/abusing-git-trailers-for-faster-ci-cd", "canonical_source": "https://jonathannen.com/abusing-git-trailers/", "published_at": "2026-11-21 00:00:00+00:00", "updated_at": "2026-11-21 18:42:10.893566+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "mlops"], "entities": ["Git", "Buildkite", "Bazel"], "also_reported_by": [], "takeaway": "Record the checks an agent already ran in a `Checks-Run` git trailer and have only the PR build skip those steps, keeping `main` running everything; the author measured about three minutes saved per PR build and less Buildkite agent contention at 100+ PRs a day.", "recommendation": {"advice": "Have coding agents write a `Checks-Run` trailer listing tsc, lint and unit tests they ran, let only PR builds skip those steps, and keep `main` running every check since trailers are claims, not proofs.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/abusing-git-trailers-for-faster-ci-cd", "markdown": "https://wpnews.pro/news/abusing-git-trailers-for-faster-ci-cd.md", "text": "https://wpnews.pro/news/abusing-git-trailers-for-faster-ci-cd.txt", "jsonld": "https://wpnews.pro/news/abusing-git-trailers-for-faster-ci-cd.jsonld"}}