r/Xcode • • 11h ago

Our monthly CI bill went from $370 to $2,000.... we solved it by moving checks locally

1 Upvotes

When our 4 devs went from one coding agent each to five each on our iOS app, our GitHub Actions bill went from about $400 to about $2,050 a month.

20 agents × 5 pushes a day × ~15 macOS minutes per push is 33,000 minutes a month. Most of those runs failed on things a local build would have caught in a minute: a missing import, a broken test, a SwiftLint error.

The bill wasn't the only problem. Running 300 macOS jobs a day through 5 concurrent slots (capped by GH team plan). Averaged over an 8-hour day it's ~60% of our total macOS capacity, and agents don't push evenly, so we spent more watching queues.

So we moved the checks onto our Macs. That became HAR, an open-source CLI/MCP server:

- Each agent gets its own slot: a git worktree, plus its own ports and database for our local backend. Xcode keys DerivedData by project path, so parallel `xcodebuild` runs don't collide.

- Checks live in `.har/` as plain stages (ours are SwiftLint, `xcodebuild build` and unit tests). `har env verify` runs them in a fixed order inside the slot.

- A pass is tied to the tree hash that was checked, and a commit gate rejects anything unverified, so agents can't push their trial and error to CI.

Each slot acts like a local CI runner, limited by the Mac's cores and RAM instead of GitHub's job cap. Hosted CI still runs, but only on changes that already passed locally. Our bill now <$500 after two months. First month it reduced but we were tweaking the local checks and signatures.

Works with Claude Code, Cursor, Codex or any MCP agent. Apache 2.0.

github.com/os-factory/har
`npm i -g u/osfactory/har`