Keep parallel agents from hogging your memory
If you run lots of agents in parallel, sooner or later they all start a build or a test suite at the same moment, and your Mac grinds to a halt. turnstile might help.
turnstile is a machine-wide gate that sits underneath the shell. Heavy commands wait for a free slot and enough spare memory, then run in place with the same output and exit code. Quick commands pass straight through, and commands you type go ahead of your agents'. It works for every agent and every project, with no per-project setup.
brew install mcclowes/turnstile/turnstile
turnstile init
Read the turnstile docs or see the code on GitHub.
For more on running many agents at once, including when they collide and how to isolate bigger work in worktrees, see Work with agents in parallel locally.