Most people use an AI agent like a chatbot: prompt, wait, prompt again. Claude Code has four kinds of loops — each one hands off more of the babysitting. Here's all four, with a copy-paste example for each.
(Based on Anthropic's "Loop engineering: Getting started with loops" — claude.com/blog/getting-started-with-loops)
Every prompt starts a loop: gather context → act → check → repeat → respond. YOU are the scheduler — it stops when the task is done and waits for you.
Level it up: put your verification steps in the prompt so it checks its own work before coming back to you:
Fix the failing checkout test. Before you report back: run the full test
suite, run the linter, and confirm zero regressions. If anything fails,
keep fixing until it passes.
Give it a verifiable finish line instead of a task. It keeps working — trying, checking, adjusting — until the goal is met or it hits the try limit.
/goal get the homepage Lighthouse score to 90 or above, stop after 5 tries
/goal all 47 TypeScript errors in this repo are fixed and the build passes
The trick: the goal must be CHECKABLE (a score, a passing build, a green test suite). "Make it better" is not a goal. "Score 90+" is.
For anything you'd otherwise re-check manually. It wakes up on your interval, does the work, goes back to sleep.
/loop 5m check my PR, address review comments, and fix failing CI
/loop 30m check the deploy status and alert me if anything errors
Scheduled cloud agents that trigger on their own — even while your computer is closed. Best for recurring streams of well-defined work: daily research, issue triage, dependency upgrades, monitoring.
/schedule every morning at 8am: scan for what's new in [your niche],
score the top 10 topics, and commit a report to my project
Combine with /goal + skills + auto mode and the agent handles the whole stream end to end.
| You want... | Use |
|---|---|
| One task, done right | Turn-based + verification in the prompt |
| A measurable outcome, hands-off | /goal with a checkable finish line |
| Something babysat on a timer | /loop with an interval |
| Work done while you sleep | /schedule (proactive) |
Start simple: pick ONE task where you're the bottleneck and hand off just that piece.
— Angelo (@angelotrifanoff.ai)