Watch the CI on one of our agent PRs and most of what it does already happened ten minutes earlier. The agent that wrote the change ran tsc, lint, ran the unit tests, and only then pushed. It has to as I've got in a hook. CI then did all three again from scratch, and took ten minutes over it.
With most of our commits written by agents[1], that is a lot of repetition. The agent already ran the checks, and a hook can (mostly reasonably) record that.
So that's what we built: The agent leaves a git trailer under the commit message[2] recording what it ran before it pushed: tsc, lint, the unit tests.
The PR build reads the trailer and skips just those steps.
Over the last few weeks our builds have gone from ~10 minutes to 1.5 minutes. A good third of that was this change. The wall-clock saving was the obvious win, but the bigger one was contention: fewer Buildkite agents (the "runner" kind of agent)[3] get spun up, fewer jobs sit waiting for one, and the ones that stay warm cache better. At 100+ PRs a day that is a lot of build minutes that can be banked.
The obvious question is trust, since a trailer is just a claim. Anything that will go to main or an environment is forced to run all the steps again. This step stops all the churn on the all the intermediate branches and pushes.
This is a poor man's Bazel. Bazel does it properly, keying every action on a content hash and pulling the result from a remote cache[4]; this is keyed on a hook's record of what ran. It works because the agent did the work, the hook saw it, and the thing that matters gets checked again on main anyway.
Never Pick It Up Twice was about not touching a PR twice, and this is the same rule for the machines.