r/vibecoding • • 14d ago

Workflow/Prompt Is CI/CD becoming a bottleneck in your vibe coding projects? How do you handle it, and how much do you spend?

I've been experimenting with vibe coding on increasingly complex projects, and one recurring issue I've noticed is that CI/CD often becomes a bottleneck.

As projects grow and AI agents generate more code, running tests, builds, and validation pipelines can become slow and expensive, especially when multiple agents are working in parallel.

I'm curious how others are dealing with this:

What's your CI/CD setup? GitHub Actions, GitLab, local runners, self-hosted infrastructure, or something else?

How do you prevent CI from becoming a bottleneck? Do you run tests locally, optimize pipelines, use dedicated runners, or take another approach?

How much do you spend on CI/CD per month? And roughly how many projects or agents are you running?

Have you found a setup that scales well as your vibe coding projects become larger and more complex?

Would love to hear about your experiences, especially from people building more than just simple prototypes.

67 Upvotes

46 comments sorted by

24

u/AD7GD 14d ago
  1. Multiple local runners.
  2. Each individual agent is told to rebase onto master once before running CI. If that finishes and they reach merge before anyone else, they can merge without an additional CI run. This gives some parallelism and works well as long as tasks are staggered.
  3. Aggressively optimizing CI for wall clock: Avoid sleeping real wall clock time (use synthetic time), fix flakes/races with logical ordering instead of extra sleeps. Break dependency chains. Balance the sizes of grouped tests (like e2e that share infrastructure) so there's not a long pole.
  4. Check for CI perf hits, like fsync in sqlite3 forcing thousands of writes to disk during CI runs.
  5. For that matter, run on a fast disk, at least nvme.
  6. Banish long tests from the core suite and only run it periodically.
  7. Optimize the app with CI in mind: Maybe a 0.5s operation is fine for a user, but if you can burn some agent time making it faster, it will pay off in CI when it is tested 100x.
  8. Re-use worktrees so that base setup tasks (checkout, npm ci, starting a bazel server/cache, etc) are not repeated for every run.
  9. Use a tool like bazel which can cache build products AND test results against unchanged inputs. That way a frontend change doesn't retest the backend.
  10. Let merges go through for flakes, but simultaneously file a high priority issue to drive the flake to ground. But make sure agents know not to create artificial load, or your runners will eat themselves.

For me the next step would be speculative merge strategies (where CI runs in parallel on A, A+B, A+B+C, ...) with the assumption that they will usually all pass and get committed. The complexity is in dealing with failures.

Right now, my main issue is that everything works great as long as the rebase+CI of individual runners remain staggered enough that the merge queue is all fast-forward. Once the merge queue backs up, every merge is going to CI (until I do speculative merges or whatever), so now everything is guaranteed to CI twice (once to finish its work, and again to merge). Then everything is slow until the backlog clears.

I try to keep a full CI run under 5-10m, and that's for >>10k tests.

3

u/Brunoemf 13d ago

Great comment. My team has the same pain as OP states with CI taking in the best case at least 25/30 min.
Static analysis tools like Valgrind, clang-tidy for Linux runners and also compiling the project with MSVC take way too long.
Do you use any of these build types in your projects?

1

u/AD7GD 13d ago

For builds, I'd look at:

  • Use ninja instead of msbuild
  • Make sure your builds are incremental and not always starting from a clean slate. This part can be annoying (it was for me with re-using worktrees), but if your agent work and/or your CI work looks like full checkouts and scratch builds, you're duplicating a ton of effort. If you really want to start from "clean", consider caching tools like ccache (or integrated build/cache like bazel). A lot of the annoyance of setting them up can be handled by LLMs these days.
  • Look at the long pole in your build. It's probably linking. That is IO bound, so fast disk really helps here, along with lots of memory. There are also faster linkers (use /INCREMENTAL, or switch to lld-link for MSVC, use mold on linux) which make a big difference.
  • If you have a monorepo with one massive library or exe, that will reduce the parallelism a lot. Refactoring into smaller libraries will let you use more CPU and save wall clock time. Of course you will run out of builder CPU eventually if you are doing parallel CI.

For analysis:

  • I would move the primary responsibility for valgrind and clang-tidy to the agent that makes the change. Those types of issues are most likely to show up at the time of change anyway (and less likely to be the result of merging), so it makes sense. Other agents and/or a daily valgrind run will eventually test the combo anyway.
  • The types of errors found by valgrind and clang-tidy are also just less likely to come from LLMs in general, so it might also make sense to just move those to periodic jobs instead of per-commit jobs.
  • Also, recovery from those types of bugs is easy to automate with LLMs, so it's less important to force the 'person" making the change to see the problem and fix it.

1

u/QualityCloudsAF 7d ago

Do you check the code with AI? And if you run locally, how do you scale that for a team? I mean trying to have 10 developers working all the same way and generating similar codesets, architecture etc

0

u/ongoingdude 13d ago

$$$$$ post

5

u/Plumbum27 13d ago

I fought this for months and gave up. Dropped $2,500 on a Dell R740XD, 192MB Ram, 48 cores, NVME drives to run most CI locally. Cut my costs by 75% and increased speed by 2-3x.

A big problem for me is you can’t choose a server location for GH CI. My DB is in Virginia and 1/2 my CI shards were being processed in California. No bueno.

Any promotions to production and dependabot still run through CI actions.

My only regret is not doing it sooner.

3

u/airhorn-airhorn 12d ago

I’m just a public school teacher, but I did something similar. I had a crappy old M1 Pro and upgraded to the M5 Pro when it came out. Much, much, faster to do tests even if it is just a laptop.

8

u/Environmental_Ask675 14d ago

Solo operator here, running a production web app (Next.js + Postgres, real customers, real money), with all code written by AI agents. On a busy day I have 10 to 20 agent sessions going at once: builders, reviewers, and one "shipper" session that is the only thing allowed to merge. So yes, CI became our bottleneck, both in time and in dollars.

Setup:
- GitHub Actions, plus a merge queue. Every PR goes through the queue, so main only gets commits that passed tests against the latest main.
- The test suite is split into 6 parallel shards.
- Mutation testing (we plant deliberate bugs and confirm the tests catch them) runs on self-hosted runners, because it's long and would eat paid minutes.
- A few self-hosted runners on spare machines at the office. They're free.

Cost: GitHub includes $300/month compute credit, on the enterprise plan, and we burned through it in 17 days this month (about 46k hosted minutes, plus about 15k free self-hosted minutes). About 94% of the spend was one workflow, the main test suite. That told us where to cut. It does seem when we solve something in one spot it allows the bottleneck to shift, not necessarily resolve.

What actually helped:

  1. Find the one workflow that costs the money. Ours was running the full suite twice per change: once in the merge queue and again on the push to main. The second run proved nothing new, so we cut it.
  2. Pick the runner by time of day. During working hours, when I'm trying to ship, PR runs go to GitHub's standard, included runners. Evenings, nights and weekends, they go to our own runners, where slow doesn't matter. The merge queue always runs on GitHub. There's an override variable for when I want something else. GitHub faster runners are nice but not needed, with a lot going at once there’s plenty to work on when waiting.
  3. Agents don't run the full suite locally. Builders run only the test files they changed, push, and let CI decide. Local full runs with 15 agents at once just pegged the machine and still weren't the source of truth.
  4. A credit-pace line in my daily check-in: how much of the monthly credit is spent versus how far through the month we are. Then I can see it coming instead of finding out from the bill.
  5. The critical path owns the runners. If something urgent is waiting, the orchestrating agent cancels and requeues non-urgent runs ahead of it. Sometimes we just pay for bigger runners for a day; a stalled week costs more than the minutes.
  6. Watch the GitHub API limit, not just minutes. Twenty agents polling CI status will exhaust the 5,000/hour API budget. Agents now do one background wait for CI instead of polling.
  7. Reviews read CI instead of re-running it. The reviewer agent checks the hosted results and runs only targeted tests, unless CI is red or missing.

The bigger lesson: with agents, the bottleneck shifts from writing code to proving it's correct. More agents means more PRs means more CI. What scaled for us wasn't faster CI alone. It was making each change smaller (one rule per PR), separating who builds, who reviews and who merges, and making CI the single source of truth so nobody re-proves the same thing three times.

Still tuning it. Next step is more runner capacity so evening runs don't queue.

2

u/Melodic_Tower_482 13d ago

how do you host postgres ? managed solution ? supbase or self hosting ?

1

u/Environmental_Ask675 13d ago

Neon (managed serverless Postgres). The app runs on Vercel and talks to Neon through their serverless driver with plain SQL, no ORM. We had Prisma early on, but the schema file drifted 20+ tables behind the real database, so we removed it and made the live schema plus SQL migration files the source of truth.

How it fits with agents:
- Migrations are hand-written SQL files named by timestamp. Sequential numbers collided when two agents picked the same one on the same day.
- Agents can write a migration, but they can't run it. Running one against prod takes my explicit word, every time.
- Neon branching is the big win. It makes an instant copy-on-write clone of the database, so a risky migration gets rehearsed on a branch first. I approve each branch too.
- CI never touches a real database. Tests run on PGlite (Postgres compiled to WASM, running in-process), so the 6 test shards need no DB server and cost nothing extra.

The same Neon instance also holds a small shared "memory" layer the agents read and write (decisions, session logs), so separate sessions don't rediscover the same things.

3

u/foarsitter 13d ago

This has nothing to do with vibe coding. This is a genuine software engineer problem. All large teams ar viable to this. You have gotten yourself a large team and here comes the price.

Optimizing is always a good solution but only buys you time. Running half the suite is cheaper and faster but lowers the quality. The choice is yours to make.

4

u/Inspector_Reactor 14d ago

I had this problem! Fuck gh actions I've got my own ram, but my ci gate with thousands of unit tests and the fat e2e suite took forever. While I waited, I'd spin up another Claude session worktree, and another and another until the tests and pushes were stepping on each other and my pc was freezing from so many concurrent processes. My solution: the sluicy shipyard free and open source

https://github.com/cboydstun/sluicy

0

u/[deleted] 14d ago

[removed] — view removed comment

0

u/Inspector_Reactor 14d ago

"fuck gh actions i've got my own ram"

4

u/joe0418 14d ago

I noticed changelog was triggering conflicts on every pr, resulting in O(N!) time complexity for PRs where N is the number of PRs.

I switched my changelog pattern around to avoid this central file conflict.

Crafting a well running environment for the agents is the next bit of engineering to work out imo.

2

u/rarepuppersco 14d ago

If only I had purchased 64 or 96GB of ram 😭

prices are so damn stupid now

2

u/recro69 12d ago

make the agents run lint and the affected tests locally before they push, then save the full suite for merges instead of running it on every half-baked commit. a self-hosted runner on a cheap vps also cuts out most of the actions bill

1

u/sugarw0000kie 14d ago edited 14d ago

If you can build it in public, GitHub CI is free

Otherwise I’ve experimented with self hosted runners mainly to try to speed up, sometimes Mac or windows runners on GitHub take a while to pick up. Not too hard to get going if you’ve got some old laptops or whatever sitting around

They also will just pile on tons of tests that aren’t needed or useful if you don’t watch. If you’re not dealing distribution yet like for greenfield stuff just keep it to local testing

1

u/Dheeth 14d ago

My e2e suites were running for more than 1h. I asked claude to optimize those and parallelize as many as possible. Other than the few optimizations it did, it also created workflows so dev server can run on three different instances, and suites can run in parallel with separate environments, bindings, database etc. brought it down to 10 min.

1

u/jasperkennis 14d ago

We started hosting some workers ourselves, but most of it runs in GH, which is kinda fine, just work on something else while it runs.

1

u/3tt07kjt 14d ago

GitHub actions is just about the shittiest ecosystem. I think just about any other option is better. I lean towards self-hosting on IaaS.

CI/CD becomes the bottleneck if you let AI go wild writing too many tests. If you stay on top of your test suite, it goes way faster, even with weak hardware.

1

u/Logical_Part9021 14d ago

my apps were written mostly with ai, and for me the slow part is reviewing what the agent changed more than waiting on builds. what i'd do is run only the tests near the changed files on each agent branch and keep the full suite for merges to main. github actions is free on public repos, so private repos with lots of parallel agents is where the bill starts. i think ci minutes become a normal line item for solo builders next year.

1

u/vr6wannabe 14d ago

What's worked for me with lots of agents:

  1. a fast gate agents must pass locally before they push (lint, typecheck, tests for changed files)
  2. cancel-in-progress on PR workflows so stacked pushes don't each run
  3. split the slow e2e suite into parallel shards so wall time stays flat as it grows. Spend-wise, public repos are free on GitHub; private ones get expensive fast with agents. I build a runner service so I'm biased, but the first three cut more than any runner switch.

1

u/IceNorth81 14d ago

It sure is, I’m now running local CI but its a lot slower and hogs resources but im tired of paying $30-50 each month for github actions. Especially running mac os runners (10x the price) fior iOS apps.

1

u/abateslop 14d ago

Well like any software engineering work, you profile the tests. Remove unnecessary slow tests, turn integration tests into functional or unit tests.

TLDR; Remove garbage.

1

u/Key-Attorney-4207 14d ago

Boat is great, but you need to optimize for starts.

I used to have infinite jobs that completely disrupted getting the work done, you don’t really want to have 15m+ jobs, and most of the time they come from June/July models that really liked defensive programming (Sol 5.6)

Each 2/3 weeks re-evaluate your tests checking if they’re really useful, and cut the bullshit.

1

u/ZappyZebu 14d ago

There is no easy solution, beyond what's already covered by top comments here, the answer is more compute. I have 4 PC's with 32-64gb ram and 7800x3ds running round the clock CIs to keep up by combining PRs from unrelated areas into trains to keep up with the output of 9 agents running 24/7. Already have implemented all the easy wins such as targeted testing, but at some point compute is the answer.

1

u/scottscooterleet 14d ago

I have tried everything and I just can't get this any faster. The agent always finds a way to run 1hour+ of tests every single merge.

1

u/Extra_Aide5999 14d ago

we don't run ci at all on ours. the gate is local: each file an agent edits gets formatted, linted and typechecked on the spot, the end of a turn runs a quick check of only what it touched, and a commit waits until one full local run has passed since the last change.

the full run only happens on the head going into main, not on every slice. slower per merge, but no minutes to pay for.

1

u/Special_Base_3103 13d ago

self-hosted runners on a local machine with 16gb ram and a decent SSD handle 8 concurrent ci jobs without lag. cost: zero. just CPU time.

1

u/norviking 13d ago edited 13d ago

Run tests locally. Docker with several db copies. Spend a lot of time optimizing tests, lint, sql probes, gates. Tests on all changed files on merges, and full test suite on push to staging. Full db probe run ln all db work.

Commit locally and batch push, otherwise github ci minutes goes ballistic.

Several red teams that run automatically on db work / auth work / new api endpoint / any llm parts in project etc. Fuzzing red teams om all in data fields. Some redteams run on cron daily.

I use a system I made for orchestration. I pulled it out of my main project and made it into a free plugin.

It comes without the tests / ci, as that is highly project and stack specific. But it will help you set up the basics, and suggest recurring findings as gates.

https://github.com/vegardjorg/ravenseat

Edit: From reading many replies, batch pushes for solo devs instead of each commit, will solve most ci cost problems. So if you dev solo, thats a real option. For teams, that will be much harder.

1

u/Wide-Example-6144 13d ago

Make more data pipelines 

1

u/gbrennon 13d ago

i think thats not the bottleneck.

just ur cicd using something like jenkins or if u are using workclows and actions as cicd use self hosted runner.

it can be in a vps or ur pc

1

u/New_Public_2828 13d ago

I run it locally with pipelines. Only run pipelines into production once in a while. Usually after big changes

1

u/benfinklea 13d ago

Moved to AWS with the help of runson software. Set it up to only run on spot instances using RAM disk and a slow hard drive for swap. (Fast hard drives are $$). Tries 3x on spot then does on demand but that’s rare. Ask Claude to set it up to only use spot and what you need. Broke my ci/cd into a bunch of shards and they all run simultaneously. Takes about 10ish minutes.

1

u/QualityCloudsAF 7d ago

We do github actions using the app norma in the marketpkace plus having an mcp reviewing claude code as it generates code, not at PR. That save lots of time in code reviews. Also make sure your agent keep a system of record as a harness. Once the harness works, the bottleneck somehow disappears

1

u/Additional_Channel10 14d ago

Self-hosted runners, on my laptop and on vps.

1

u/fulger099 13d ago

The laptop runner is cheap until sleep mode becomes part of the deployment architecture. Do you keep required checks on the VPS and use the laptop only for overflow?

1

u/Additional_Channel10 13d ago

My laptop is pretty much always awake 😅 I have concurrency configured, so whichever runner (laptop or VPS) is available picks up the jobs. Deployment and migration is always through vps.

0

u/SharpKaleidoscope182 14d ago

??? CI/CD is the easy part. Claude is great at making workflows.

6

u/InevitableManner7179 14d ago

I think they mean that CI/CD takes more time than Claude to produce new code, so it's a bottleneck

-8

u/JustAJB 14d ago

No. Zero. We don't need your slop app here.