Anthropic laid out four ways to keep Claude Code working without you telling it what to do next. Here’s exactly how I set up each one.
Anthropic’s Claude Code team calls these loops: Claude repeats a cycle of work until a stop condition is met. The four types differ in one thing, which is what you hand off. Turn-based hands off the check. Goal-based hands off the stopping point. Time-based hands off the start button. Proactive hands off the prompt itself.
New to the idea? Start with my loop engineering guide. Want the commands on one page? That’s my /goal, /loop and /schedule cheat sheet. Everything here needs a Pro, Max, Ultra, Team or Enterprise plan, in the terminal or the Code tab of the Claude desktop app.
This is every normal Claude Code prompt. You give it a task, it works, checks the result, and stops when it thinks it’s done or needs you. Use it for one-off jobs you want to look at yourself.
01
Set it up
Nothing to turn on. Open Claude Code, type the task, and say how Claude should prove it worked. That proof is what saves you the extra rounds of back and forth.
If you check the same things every time, ask Claude to save those checks as a skill. Anthropic’s own example skill says never to call a change done just because the edit went through.
To stop it: press Esc. Claude keeps the work it finished so far.
You set a finish line Claude can measure, like "get my homepage speed score to 90." Each time Claude tries to stop, a second model checks your finish line and sends it back to work if it isn’t met.
01
Set it up
Type /goal and your finish line. It starts right away. Put the attempt limit in the same sentence, like "stop after 5 tries," because the limit lives inside your condition. (Goal docs)
To actually walk away, turn on auto mode so Claude doesn’t stop to ask permission. Press Shift+Tab in the terminal until it reads auto mode, or pick it from the mode menu in the desktop app.
To check or stop it: /goal alone shows the status, the turn count and what it has spent. /goal clear cancels it. One goal runs per session.
The checker only reads what Claude shows in the chat, so ask Claude to print the proof. Lighthouse is the same test PageSpeed Insights runs.
You give Claude a timer and a job. It runs the job on that rhythm until you cancel it or the work is done. Use it for checking things that change outside your project, like reviews, orders or a form.
01
Pick where it runs
/loop in your session. Fastest to start, as often as every minute. It only runs while the session is open and your computer is on, and repeating loops end after 7 days. (Loop docs)/schedule in the cloud. Runs with your laptop closed, but no more than once an hour. (Scheduled task docs)To stop it: for a timed loop like the one below, ask Claude to cancel it. Esc won’t stop it.
Every 30 minutes means /loop or a desktop task. Connect your review source first.
This is the big one. A cloud scheduled task (Anthropic used to call these routines) starts on its own, with nobody watching, even with your laptop closed. Here’s how I set one up so bug reports get picked up, fixed, reviewed, and then wait for me.
01
Connect your project
Your site or app needs to live on GitHub. Install the Claude GitHub app on that repository. Then connect wherever bug reports land, like Slack, in your claude.ai connectors.
02
Create the task
Go to claude.ai/code/routines and click New task (some accounts still say New routine). Name it and paste the prompt below. Under Trigger, pick Schedule and choose hourly. Under Advanced settings, pick your repository and the Default environment. On the Connectors tab, remove every connector this job doesn’t need, because Claude can write with anything you leave on.
You can also type /schedule in Claude Code and it walks you through the same questions.
03
Test it, then approve what ships
Click Run now and open the run from History to watch exactly what Claude did. Cloud runs start in auto mode and push to branches that start with claude/, so nothing reaches your live site on its own.
Each fix shows up as a draft pull request on GitHub. Read it, and click Merge only when you’re happy. Want a hard guarantee? Turn on branch protection for your main branch so every change has to go through a pull request.
04
Know the limits
Scheduled tasks are a research preview on Pro, Max, Ultra, Team and Enterprise, and every run uses your normal plan usage. Use the on and off switch on the task page to pause it, or Delete in its menu to remove it. Anything it does through GitHub or Slack shows up as you.
Anthropic’s own version goes further, splitting the work across many agents with dynamic workflows. I walk through those in my dynamic workflows guide. The prompt above keeps it to one fixer and one reviewer subagent, which is plenty to start.
Run it by hand a few times before you let it go alone. Once you trust it, move it one step up the list, from turn-based to goal, from goal to timer, from timer to proactive.