@0xTrackmind: https://x.com/0xTrackmind/status/2066583810213650461
Summary
A comprehensive 12-step guide to automating Claude workflows using /loop, desktop scheduled tasks, and cloud routines, covering token budgeting, permission configuration, and auto-mode for efficient unattended operations.
View Cached Full Text
Cached at: 06/16/26, 01:36 PM
The full Claude automation stack: /loop → Desktop → Cloud Routines. A 12-step breakdown
You’re paying 20-200/month for Claude and using it like a search engine with better grammar.
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.
Here’s the 12-step breakdown of the full automation stack - and the hours back in your week.
Tier 1 - The Manual Loop
Steps 01-04. Works inside a session. Dies when you close the terminal. Start here.
01. /loop is one command away.
Inside any Claude Code session:
That’s it. Claude schedules a recurring task using CronCreate under the hood. Runs every 5 minutes until you kill it or the session closes.
Natural language works too:
Minimum interval: 1 minute. Times use your local machine timezone, not UTC.
02. Real cron expressions when you need precision.
Standard 5-field syntax. Wildcards, ranges, steps - all work. What doesn’t: L, W, ?, MON/JAN aliases.
03. Four hard limits. Memorize them.
-
7-day auto-expire. Every loop deletes itself after 7 days. Forgot about it? It’s already gone.
-
50 tasks max per session. You won’t get a warning until you hit the wall.
-
No catch-up firing. Miss a run during a long task? You get one fire after - not one per missed interval.
-
Session-scoped. Close terminal - everything cancels. Full stop.
To disable scheduling entirely in CI environments: CLAUDE_CODE_DISABLE_CRON=1
04. Pair /loop with /goal or it quits early.
A loop without /goal stops when Claude decides it’s “done enough.” A loop with /goal runs until the condition is actually met:
Three patterns where this pairing earns its keep:
-
Flaky test debugging - reproduce, form theories, test, repeat
-
Long migrations - process items, save progress, continue until queue empty
-
Inbox triage - process pending items until nothing new arrives in a full cycle
Tier 2 - The Persistent Layer
Steps 05-08. Survives restarts. Requires your machine to be awake.
05. Desktop scheduled tasks outlive your terminal.
Claude Desktop - Schedule - New task - New local task. Each fire starts a fresh Claude Code session. No shared context. Pre-configured permissions, model, and working folder - locked per task.
What you gain over /loop:
-
Survives reboots and terminal closes
-
Runs on a real schedule even when you’re not there
-
Permissions scoped per task, not global
What you still need: your machine awake. Task due while laptop is asleep? Run is skipped. On wake, Desktop checks the last 7 days, runs one catch-up, sends a notification. Enable Keep computer awake in Desktop Settings - General.
macOS and Windows only. Linux: use /loop or system cron + claude -p
06. Every scheduled fire costs tokens. Count them.
A 5-minute loop running 24 hours = 288 sessions. Each session loads context, calls tools, possibly spawns subagents. Three habits that keep it affordable:
-
Set explicit token budgets in the prompt: “Use at most 5k tokens. If you can’t complete in that budget, save partial progress and exit cleanly.”
-
Match the model to the task. Most automation runs fine on Sonnet. Exploration runs on Haiku.
-
Set the model explicitly per task - the config defaults to your panel default, which is probably Opus.
Heavy automation on Pro hits rate limits by Tuesday afternoon. Max gives 5x the headroom. The upgrade pays for itself fast.
07. Configure permissions before any unattended run.
Default Claude Code asks approval before every bash command, file write, and API call. Fine when you’re watching. A disaster when you’re not.
The test for every entry: if this turns out wrong, what does it cost to undo? Cheap to undo - auto-approve. Expensive to undo - never.
08. Auto Mode handles the 93% you’d approve anyway.
Anthropic measured that users approve 93% of permission prompts. Auto Mode automates those and keeps humans in the loop for the 7% that matter. Three tiers: Permissive, Balanced, Restrictive. Pick by project risk.
Two layers of defense: a server-side prompt-injection probe scans tool outputs, then a classifier evaluates each action. Every decision is logged. Review it the next morning instead of trusting the run blind.
Available on Max, Team, Enterprise, and API plans. Not on Pro, Bedrock, or Vertex as of June 2026.
Tier 3 - The Cloud Layer
Steps 09-12. Anthropic-hosted. Your laptop can be off.
09. Cloud Routines run without your hardware.
Released April 14, 2026. A Routine is a saved Claude Code config - prompt, repos, connectors, permissions - that runs on Anthropic infrastructure on a trigger. Create at claude.ai/code/routines or with /schedule in the CLI.
What a Routine contains:
-
A self-contained prompt - ambiguity produces coin-flip behavior on every fire
-
One or more repositories, cloned at run start
-
Connectors: Slack, Linear, GitHub, Drive
-
Environment: Trusted by default - package registries allowed, arbitrary outbound blocked
-
Triggers: Schedule, API, GitHub event, or any combination
By default, Routines push only to branches prefixed claude/. Keep this default until your downstream review process is actually solid.
10. Schedule-triggered Routines: set it and walk away.
Three patterns that pay for themselves immediately:
-
Morning briefing - metrics, incidents, new issues - Slack digest by 8am. You know what happened overnight without opening anything.
-
PR review pass - every weekday at 9am, scan open PRs, leave first-pass security and style flags. Human review starts pre-cleaned.
-
Docs drift detection - weekly, scan code changes, flag docs not updated, open draft PR with corrections.
11. API-triggered Routines: Claude as a callable service.
An API trigger gives a Routine a unique HTTP endpoint and bearer token. POST from anywhere.
Two things that will burn you: token is shown once at creation - store it immediately. And watch the beta header - migrate during the deprecation window.
What this unlocks: CI fails - fire a Routine. PagerDuty alert - fire a Routine. Stripe webhook - fire a Routine.
12. GitHub-triggered Routines close the last manual loop.
Hook a Routine into the Claude GitHub App webhook. Supported events: pull request, push, issue, check run, workflow run, discussion, release, merge queue.
Where this earns its place:
-
PR opened - code review pass, security and style flags before human reviewers arrive
-
Issue created - triage, label, link related code, draft first response
-
Workflow failed - investigate CI failure, identify root cause, open draft fix PR
-
Release published - draft release notes, post to changelog, notify stakeholders
The mistakes that waste money on Claude automation
-
Never trying /loop. The easiest tier costs nothing and you’ve been ignoring it.
-
Forgetting the 7-day auto-expire. Set up a critical loop, walk away, wonder why nothing runs.
-
Using /loop for tasks that need to outlast your terminal. That’s what Tier 2 and 3 are for.
-
Defaulting to Opus on every automated fire. Check the model picker per task.
-
No /goal on loops that should run until done. They stop at “handled enough.”
-
Blanket –dangerously-skip-permissions. One bad prompt from a force-push to main.
-
Vague Routine prompts. Ambiguity becomes coin-flip behavior on every fire.
-
No audit logs. Silent failures become loud incidents.
-
Disabling the claude/ branch prefix before your review process is solid.
Claude doesn’t stop working when you stop typing.
The stack shipped in 90 days. /loop in March. Auto Mode two weeks later. Routines in April. All of it is live, documented, and on plans you’re already paying for.
The only thing between “Claude as expensive chatbot” and “Claude as infrastructure” is twelve steps of configuration.
Pick one step you weren’t doing. Probably your first /loop in the terminal. Add it today.
Similar Articles
@EXM7777: https://x.com/EXM7777/status/2073432521954697653
A guide to using Fable 5 and Claude Code to create automated workflows (loops and goals) for AI agents, including 25 workflow examples with prompts and tool integration.
@mvanhorn: https://x.com/mvanhorn/status/2068426104088748331
An article explaining the differences between goal, loop, and schedule commands in AI coding tools like Claude Code and Codex, and providing 15 practical loop examples for running automated tasks.
@PrajwalTomar_: https://x.com/PrajwalTomar_/status/2063238968125333581
A detailed playbook for optimizing Claude Code setup, based on Boris Cherny's video, covering persistent context via CLAUDE.md, reusable workflows, hooks, git worktrees, and discipline.
@zodchiii: https://x.com/zodchiii/status/2069366611371241944
A guide on building a reusable Claude Code Agent loop that can be pointed at different tasks like bug fixing, speed optimization, or cost reduction by swapping check scripts.
@ClaudeDevs: https://x.com/ClaudeDevs/status/2074208949205881033
A practical guide explaining different types of loops (turn-based, goal-based, time-based) for configuring coding agents in Claude Code, including how to define stop conditions and improve self-verification.