Skip to main content

turnstile

A machine-wide, memory-aware gate for builds and tests on macOS.

Run three coding agents across a few worktrees and they'll happily start three swift tests, two npm run builds, and a Playwright suite at once. Each agent's limits are sensible on their own. Together they swap your Mac into the ground.

turnstile sits underneath the shell, so it works the same for Claude Code, Codex, any other agent, and you. Heavy commands queue for a slot and for free memory, then run in place with the same output, exit code, working directory, environment, and Ctrl-C. Everything else passes straight through.

$ swift test
turnstile: waiting for memory, needs ~4 GB, ~1.2 GB spare (running: api swift test, ~3 GB; web npm run build, ~2 GB)
turnstile: starting after 41s
...

There's no project setup. Once it's installed, every repo, agent, and terminal on the machine is covered.

Turnstile in action​

Memory47% of 16 GB
1/31/31/3
Other 5.5 GB3 jobs 2.1 GBNext ~3.6 GB3.3 GB spare

Next needs ~3.6 GB, only 3.3 GB spare

Running3
kiln-desktop1.1 GB · 5m33s
swift build
46% of ~2.4 GB
turnstile620 MB · 2m25s
swift test
39% of ~1.6 GB
northstar410 MB · 1m04s
playwright test
23% of ~1.8 GB
Queued3
atlas-web1m33s
npm run build
Waiting for memory~3.6 GB
relay51s
vitest run
Waiting~900 MB
workbench12s
npm run test:e2e
Waiting~2.2 GB
Recent
atlas-webnpm run buildexit 13m48s3.7 GB
signal-apinpm run typecheck42s1 GB
SettingsQuit

Hover a job for its controls, or move a queued one to the front.

From the terminal​

Two agents start builds at once; the second waits for memory until the first finishes, then runs

Turnstile status in a terminal with two running jobs and recent command history

turnstile status gives the same queue a more detailed view, including current memory use, learned estimates, and recent runs.

Caught in the wild​

A real intercept. npm publish isn't gated, but its prepublishOnly hook runs npm run build, which is. That nested build waited for a slot behind two Swift builds, then ran as normal:

$ npm publish --access public

> docusaurus-plugin-share-selection@0.1.0 prepublishOnly
> npm run build && npm test && npm run check:exports

turnstile: waiting for a compile slot (running: turnstile swift build -c release, ~865 MB; saggar-desktop-fix546 swift build, ~2.4 GB; +1 more)
turnstile: starting after 27s

> docusaurus-plugin-share-selection@0.1.0 build
> tsup

CLI Building entry: {"index":"src/index.ts"}
...

Nobody had to tell the publish script about turnstile. It caught the heavy step wherever it ran.

Your Mac as CI​

The same gate makes it safe to run CI on the machine you work on. A self-hosted runner on your Mac gets Xcode, simulators, and warm caches for free, but on its own it has no idea your agents are compiling. Behind turnstile, a push queues for memory like everything else, runs at background priority, and yields to you. See your Mac as a CI runner.

Watch the walkthrough​

Where to go next​