AI coding has made CI a bottleneck, so we reworked ours to keep up
TL;DR Highlight
Tests quadrupled, yet Linear cut PR CI wait from 6+ to ~5 minutes and halved runner time per test.
Who Should Read
A backend developer on a TypeScript monorepo whose CI wait times and runner costs are rising as AI agents flood in PRs.
Core Mechanics
- Tests quadrupled, wait time still dropped
- The test suite almost quadrupled since the start of the year.
- PR wait fell from over 6 minutes to just over 5, and runner time per test roughly halved.
- Faster runners and compiler gave big wins
- Moving off GitHub Actions to third-party runners with faster CPUs, storage and cache made jobs 34% faster on average, comparing the two days either side of the switch.
- tsc-type jobs dropped 52%.
- Switching to tsgo cut the weekly median tsc check by 73%.
- Linting without the type checker
- Custom lint rules were rewritten as static analysis over the AST instead of using type info.
- ESLint dropped TypeScript, cutting API lint time by 68% and full-repo lint by 55%.
- Syntax-only rules also made the move to Oxlint easier.
- Shrink the gating jobs first
- Change-detection jobs got a capped fetch depth and no checkout where unneeded.
- Their median fell from 26s to 8s and the slowest run from 138s to 37s.
- Moving a cache-marker write out of the required check saved 42s on the merge path.
- Repeated setup was cut
- The Postgres client moved into a CI base image and pnpm install was restricted to the API package.
- Caching node_modules was dropped because a cache hit took about 28s versus about 7.5s for a filtered install.
- Per-shard setup fell from 110-140s to 67-73s.
- Cheap setup makes more shards viable
- Vitest splits by file, so a few huge files held up whole shards.
- After splitting large files and going to 8 shards, the critical job was about 19% faster and 19% cheaper in the initial benchmark.
- At 110-140s setup, 8 shards would have spent 15-19 minutes on setup alone.
- isolate: false was the biggest single win
- Safe files opt in by comment to share a module registry within each worker.
- The slowest shard fell from about 300-379s to about 195s, with roughly 17% monthly savings.
- Files using fake timers or tangled shared state stayed in the isolated project.
Community Reactions
- Opinion that human testing is the real bottleneck
- One commenter said checking whether the product works the way customers will understand and like is the slow part.
- Opinion that LLM-written tests are often useless
- Commenters said many tests in LLM-heavy PRs only exercise built-ins or trivial behavior.
- Others asked whether four times the tests produced four times the value.
- Experience cutting CI with self-hosting and Bazel
- One commenter got CI with full linting and unit tests under 60 seconds using self-hosted runners, Podman and Docker images as cache.
- Others said Bazel gives about 10s builds with a warm cache, and that build and test must be scheduled together.
- Opinion that agents prefer small isolated services
- One commenter argued contract-only boundaries let agents iterate internally, favoring them over monoliths.
How to Apply
- Make change-detection checkouts shallow
- Open the first change-detection or path-filter job in your workflow today.
- Set a limited fetch-depth and delete checkout from jobs that need no working tree.
- Compare job durations before and after.
- Measure per-shard setup before adding shards
- Read test job logs to time install and DB prep before tests start.
- Cut setup with pnpm --filter installs and a base image before raising shard count.
- Split big test files and relax Vitest isolation
- Split the large test files in your slowest shard.
- Put only safe files into an isolate: false project with an opt-in comment, and keep fake-timer files out.
- Put test rules in your agent instructions
- If agents write your tests, add the opt-in conditions and teardown rules to the skill or instruction file.
Try It
# Paste into Claude Code or ChatGPT (the article's method turned into a prompt)
Below are our CI workflow file and a summary of recent job logs.
{{workflow YAML}}
{{per-job duration / setup time}}
Analyze in this order.
1. Find unnecessary full checkouts in front-of-pipeline jobs that gate others (change detection, etc.).
2. Find setup repeated in every job (apt, pnpm install, DB migrations).
3. Tell me whether full-workspace installs can become installs of only the needed packages.
4. Calculate whether adding shards would make setup cost exceed test time.
5. List each fix by expected time saved and show the modified YAML.
Next step: paste per-file test durations of your slowest shard and ask which files to split.Terminology
Related Papers
A Beginner's Guide to Local AI with Inkling, Qwen, and Unsloth
Install Unsloth Desktop, load a quantized Qwen model, and share a private ChatGPT-like AI on your home LAN.
Muru – AI-assisted Rust server for Python apps by mod_WSGI's creator
mod_wsgi's creator is building Muru, an AI-assisted Rust ASGI/WSGI server, documenting it in public
87% of the Anthropic power will come from gas and 11% from coal in 2028
Analysis of Anthropic's contracted data centers: 87% gas, 11% coal power in 2028
Anthropic’s Nasdaq debut
Anthropic listed on Nasdaq and closed its first day below its opening price.
OpenAI still has a WebRTC Problem
WebRTC drops late audio, hurting voice AI; MoQ retransmits and buffers instead
Gemini 4 Neon
Gemini 4 Neon cuts cost per task 32% versus Carbon, at $3 input and $15 output per million tokens
AI is killing All About Berlin
After Google AI Overviews, a Berlin guide site lost 70-75% of its traffic.
Not Everything Needs an LLM
PostHog used small decision models to skip 98.7% of expensive LLM calls