Ambient loops
Heartbeats, /loop, routines and cron. These are agents that wake themselves up, and they're what makes an agent feel "always on".
A goal loop runs until it's done. An ambient loop runs because it's time, or because something happened. This is what turns an agent from a tool you use into something that runs in the background.
The shapes
Repeat a prompt every N minutes. Claude Code's /loop is the canonical example: an often-cited setup is /loop 5m /babysit to keep PRs moving (unofficial catalogue, MindStudio). One guide uses it to check a live site every 30 minutes.
Good for: babysitting something that changes on a known rhythm.
What makes ambient loops feel alive
Claire Vo's observation about OpenClaw: it "feels alive even though it's not … this AI has a heartbeat but not a brain" (X). One analysis credits the gateway more than the heartbeat: it routes every input channel to the agent and sends output wherever it needs to go, and the heartbeat is just another input on a timer (Bibek Poudel).
The design problems
- Silence. An ambient loop that reports every cycle is noise. Write explicit silence criteria (Panaversity).
- Idle cost. 48 heartbeats a day add up even when nothing happens. Some setups skip the run entirely, with no API call, when there's nothing to check; others use cron for routine checks and keep the model call for real work (guide). Anthropic's loop guide recommends smaller, faster models for routine proactive loops (Anthropic).
- Lifetimes. One guide reports
/looptasks running unattended for up to 3 days anecdotal; Claude Code background sessions stop when the machine sleeps or shuts down, and come back withclaude respawn --all(guide). - Stale goals and injection. See Standing goals and Security.