How to run Claude on autopilot in 14 steps: /loop, Routines, and the full automation stack.
You’re paying $20–$200/month for Claude and using it like a paid version of ChatGPT. 9 out of 10 users have never set up automation that runs without them clicking buttons.
No /loop, no scheduled tasks, no Routines, no triggers. The tool that’s supposed to work while you sleep is still waiting for you to type. This is the 14-step roadmap to the full automation stack - and the hours back in your week.
Follow my Substack to get fresh AI alpha: movez.substack.com
Claude Code has been quietly shipping an entire automation stack over the last three months. /loop launched.
Auto Mode landed March 24. Cloud Routines opened in research preview April 14. By May 2026, the picture is complete: three layers of automation that go from your terminal to Anthropic’s cloud, each one earning its place by removing a different reason for you to babysit.
This is the 14-step roadmap to all three layers - every detail verified against the official docs at code.claude.com/docs as of June 2026. The arc is simple: get the manual loop right, make it persist across restarts, push it to the cloud where your laptop doesn’t matter.
14 steps. 3 tiers. One Claude that works while you sleep.
01. The /loop command. Explicit and natural language, both work.
The fastest way to make Claude Code do anything on a schedule. Inside any session, run /loop <interval> <prompt>.
Under the hood it calls three native tools: CronCreate, CronList, CronDelete. The intervals use a number plus unit: m for minutes, h for hours, d for days. The minimum is 1 minute - 30s rounds up.
> /loop 1m say hello
▲ Claude
CronCreate(*/1 * * * * : say hello)
✓ Scheduled c21d95a0 (Every minute)
- Job: say hello
- Cadence: Every 1 minute (*/1 * * * *)
- Job ID: c21d95a0
- Duration: Recurring tasks auto-expire after 7 days
- Cancel anytime: CronDelete c21d95a0You don’t actually need to type /loop at all. Claude understands natural language schedules just as well:
Times use the local machine’s time zone, not UTC. Any slash command available in Claude Code can be placed inside a /loop - including /run, /review, even another /loop if you’re feeling adventurous.
02. Real cron expressions for real schedules.
The CronCreate tool accepts standard 5-field cron expressions: minute hour day-of-month month day-of-week. All fields support wildcards (*), single values (5), steps (*/15), ranges (1-5), and comma-separated lists (1,15,30). Day-of-week uses 0 or 7 for Sunday through 6 for Saturday.
What is NOT supported: extended syntax like L (last day), W (weekday), ?, or name aliases like MON or JAN. When both day-of-month and day-of-week are constrained, a date matches if either field matches - standard vixie-cron semantics.
Cron patterns worth memorizing:
# Cron patterns that earn their keep
# every 5 minutes (only during business hours)
*/5 9-17 * * 1-5
# every weekday at 7am
0 7 * * 1-5
# first day of the month at 9am
0 9 1 * *
# every 15 minutes
*/15 * * * *
# nightly at 2:30am
30 2 * * *
# every Friday at 4pm
0 16 * * 5
# every 6 hours, on the hour
0 */6 * * *03. Auto-expire and stop conditions
Four hard constraints that decide whether /loop is the right tool for the job. Memorize them or burn time figuring them out later:
To list and cancel tasks mid-session, just ask in natural language - Claude routes to CronList and CronDelete:
> show running cron jobs
▲ CronList()
ID JOB CADENCE
c21d95a0 say hello Every 1 minute
8f3aa412 check deploy status Every 10 minutes
bb7c0d91 morning summary 0 7 * * 1-5
> kill the deploy status check
▲ CronDelete(8f3aa412)
✓ Cancelled. 2 jobs remaining.For CI environments or shared servers where background scheduling is undesirable, set CLAUDE_CODE_DISABLE_CRON=1 in your environment. The cron tools and /loop become unavailable, and any already-scheduled tasks stop firing.
This is the right move for any environment where the user who runs Claude isn’t the user who owns the schedule.
04. Pair /loop with /goal
A /loop on its own asks Claude to do something repeatedly. A /loop paired with /goal asks Claude to do something repeatedly until a specific condition is met - and to keep looping past intermediate “done enough” declarations.
This pairing solves agentic laziness inside a recurring task. Without /goal, a loop might address 20 of the 50 items it’s meant to handle and call the rest “handled.” With /goal, the stop condition is explicit and enforced:
A /loop on its own asks Claude to do something repeatedly.
A /loop paired with /goal asks Claude to do something repeatedly until a specific condition is met — and to keep looping past intermediate “done enough” declarations.
This pairing solves agentic laziness inside a recurring task.
Without /goal, a loop might address 20 of the 50 items it’s meant to handle and call the rest “handled.” With /goal, the stop condition is explicit and enforced:The three patterns where this pairing earns its keep:
Four steps and you have a working manual loop. Now make it survive a restart.
05. Desktop scheduled tasks.
The Claude Desktop app has its own scheduler, separate from the CLI’s /loop. Create scheduled tasks from Schedule → New task → New local task.
You define a name, prompt, frequency, permissions, and working folder. Each fire starts a fresh Claude Code session - no shared context with anything else.
What this layer gives you that /loop doesn’t:
What it still requires: your machine has to be awake. If your laptop is asleep when a task is due, the run is skipped. When the machine wakes or you reopen Claude Desktop, it checks the last 7 days for missed runs, starts one catch-up run for the most recently missed time, and shows a notification.
To prevent idle-sleep, enable Keep computer awake in Desktop Settings under General. Closing the laptop lid still triggers sleep.
Desktop scheduled tasks are macOS and Windows only. Linux users have two options: (1) use the CLI’s /loop for session-scoped scheduling, or (2) set up system cron jobs running claude -p <prompt> in headless mode for persistent scheduling. Routines (step 10) work everywhere because they run in the cloud.
06. Token budgets and rate limits.
The single biggest surprise on a Pro plan: every scheduled fire starts a full Claude Code session, and each session counts toward your usage limits. A 5-minute loop running for 24 hours is 288 sessions.
They’re not tiny - each one loads context, calls tools, possibly invokes subagents. Factor this in before you set up anything ambitious.
Three habits that keep automation affordable:
07. Configure permissions for unattended runs.
By default, Claude Code asks for approval before running any bash command, writing any file, or calling any external API.
That’s fine when you’re watching. It’s a disaster when no one is. Three configuration patterns turn the default into something that can actually run unattended:
{
"permissions": {
"autoApprove": [
"Read(*)",
"Grep(*)",
"Bash(npm test)",
"Bash(pytest)",
"Bash(git status)",
"Bash(git diff*)",
"Bash(git log*)",
"WebFetch(domain:docs.python.org)"
],
"deny": [
"Bash(rm -rf*)",
"Bash(git push*)",
"Bash(*--force*)",
"Bash(curl*)",
"Edit(.env*)",
"Edit(secrets/*)"
]
},
"auditLog": true
}The right test for what to auto-approve: if this turns out wrong, what does it cost to undo? Cheap to undo (a comment on a draft PR) - auto-approve. Expensive to undo (a force-push to main) - never.
The middle ground (creating a branch, opening a PR) is fine to auto-approve if you also have audit logs you actually read.
08. Auto Mode - AI-classified permissions
Auto Mode is the alternative to --dangerously-skip-permissions. Instead of blanket approval, an AI classifier evaluates each tool call against the active permission policy and decides whether to auto-approve, prompt, or block.
Anthropic measured that users approve 93% of permission prompts; Auto Mode automates the 93% and keeps the human in the loop for the 7%.
How it works in practice:
Plan availability as of May 2026: Max, Team, Enterprise, and API plans (through the Anthropic API). Not currently available on Pro, Bedrock, Vertex, or Foundry.
Check code.claude.com/docs/en/auto-mode before planning around it. Once enabled, Auto Mode joins the Shift+Tab mode cycle alongside Accept Edits and Plan.
Auto Mode is still in research preview. The classifier’s decision logic is being refined and behavior may change between releases.
Pair it with .claudeignore and audit logs - Anthropic strongly recommends both. Don’t use it on shared team environments without additional safeguards.
09. Pick the right scheduler for the job.
Three schedulers, easy to confuse. The decision rule is one question: where does this need to run, and who needs to be awake for it?
The compounding pattern: start with /loop in a session to find what works, then promote to Desktop tasks for daily use, then promote to Routines when you want it running independent of your hardware.
Each tier earns its place by removing a different reason for you to be there.
10. Cloud Routines.
Released April 14, 2026 in research preview. Routines are saved Claude Code configurations - a prompt, repositories, connectors, permissions - that run on Anthropic-managed cloud infrastructure on a trigger.
Your laptop can be off. The run still happens.
Available on all paid plans (Pro, Max, Team, Enterprise). Create them at claude.ai/code/routines or with /schedule inside the CLI. The CLI creates schedule-triggered routines only; to add API or GitHub triggers, edit on the web.
What a routine actually contains:
By default, routines can only push to branches prefixed claude/. A poorly written routine cannot accidentally push to main. Disable this only if you have a downstream review process you actually trust. The default exists for a reason.
11. Schedule-triggered Routines
The most common trigger and the one to start with. Set a cadence - hourly, daily, weekdays, weekly, or a one-shot future time - and walk away.
> /schedule weekdays at 7am
Goal: pull yesterday’s GitHub issues, classify by severity,
draft fixes for any "P0" or "P1," open draft PRs for review.
Post a digest summary to #engineering on Slack.
▲ Claude
Creating routine: morning-briefing
- trigger: schedule (0 7 * * 1-5)
- repositories: org/api, org/web
- connectors: github, slack
- environment: Trusted
✓ Active · first run Monday 07:00 local time.
View at claude.ai/code/routinesThree patterns that pay for themselves fast:
Times are in your local zone and converted automatically. Runs may start a few minutes after the scheduled time due to stagger - consistent per routine.
12. API-triggered Routines
An API trigger gives a routine a unique HTTP endpoint and a bearer token. POST to it from anywhere - alerting systems, deploy pipelines, monitoring tools, your own apps - and the routine runs. Optional JSON body becomes one-shot context appended to the routine’s prompt.
# Fire a routine from anywhere with HTTP access
curl -X POST https://api.anthropic.com/v1/claude_code/routines/$ROUTINE_ID/fire \
-H "Authorization: Bearer $ROUTINE_TOKEN" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: experimental-cc-routine-2026-04-01" \
-H "Content-Type: application/json" \
-d '{"text": "Sentry alert SEN-4521 fired in prod. Stack trace attached."}'
# Response includes claude_code_session_id + URL to watch liveTwo operational details that matter:
What this trigger pattern actually unlocks: Claude becomes a callable workflow from any system in your stack.
CI fails → fire a routine to investigate and open a fix PR. PagerDuty alert → fire a routine to triage and post initial context.
Stripe webhook → fire a routine to update an internal dashboard.
13. GitHub-triggered Routines.
The GitHub trigger hooks a routine into the Claude GitHub App webhook. Supported events are broad: pull request, push, issue, check run, workflow run, discussion, release, merge queue.
Each matching event starts an independent session - no session reuse across events.
Where this trigger earns its place:
Pull request filters let you scope precisely: author, title, body, base branch, head branch, labels, draft state, merged state, from-fork.
A routine that only fires on PRs labeled needs-security-review against main is one filter set away.
14. Compose with Skills and Dynamic Workflows.
The last step closes the loop with everything Claude Code shipped before. Each layer of automation gets more powerful when you pair it with the rest of the stack.
The whole stack at peak looks like this: Skills as your recipes, Dynamic Workflows as the orchestration, Routines as the trigger layer, Auto Mode as the permission classifier, Audit logs as your morning review. Every step in this article configures one slice of that stack.
You don’t need all of it on day one. Start with /loop. Promote to Desktop. Promote to Routines. Pair with Skills. Add Workflows when complexity demands it.
The habits that waste money on Claude automation
Conclusion:
Claude does not stop working when you stop typing.
The automation stack has been shipping in pieces for three months. /loop in March. Auto Mode two weeks later. Routines in April. The whole thing is live, documented, and available on plans you’re already paying for.
The only thing standing between “Claude as expensive chatbot” and “Claude as workforce” is fourteen steps of configuration.
Most users will keep typing prompts manually and stop there. That’s fine for casual use and bad at everything else. The 1% running real automation have Claude triaging issues at 7am, refreshing dashboards every hour, drafting Slack replies every 10 minutes - all while they sleep. They’ve set up the manual loop, promoted it to Desktop, promoted that to Routines.
Pick one step you weren’t doing - probably your first /loop in the terminal - and add it tomorrow. Then the next. The output of Claude follows the configuration of Claude. Configure it for autopilot, and that’s what you get.









