Re-checked 2026-11-23 (Curator Pass B)

Core loop mechanics (CronCreate/List/Delete, limits, /goal, /schedule) still match the docs. Updated: Routines renamed to cloud scheduled tasks, auto-mode availability and rule lists, claude/ branch default, webhook token. Desktop scheduled-task OS support was not confirmed.

How to make Claude Code run without you typing — the three-tier ladder from an in-session loop to a cloud-hosted routine that fires while your laptop is off. The whole point: stop using a 200/month agent like a paid chatbot. Most users never set up anything that runs without a button click.

Source

@0xcodez’s 14-step roadmap (Twitter/X, June 2026): The 14-Step Roadmap to the Claude Code Automation Stack. Dates, limits, and plan availability are the author’s as-of-June-2026 snapshot — verify against code.claude.com/docs before depending on a specific number, since these features are mostly in research preview and shift between releases.

The ladder — three tiers, one rule

The arc is simple: get the manual loop right → make it survive a restart → push it to the cloud where your hardware doesn’t matter. Each tier removes a different reason to babysit.

TierMechanismPersists across…Needs machine awake?Where it runs
1. In-session/loop + cron toolsnothing (session-scoped)yesyour terminal
2. DesktopDesktop scheduled tasksrestartsyesyour machine
3. CloudRoutineseverythingnoAnthropic cloud

The compounding pattern: start with /loop to find what works, promote to a Desktop task for daily use, promote to a Routine when you want it independent of your hardware. The decision rule for which tier is one question: where does this need to run, and who needs to be awake for it?

Tier 1 — the manual loop

/loop <interval> <prompt> inside any session. Under the hood it calls three native tools — CronCreate, CronList, CronDelete. Intervals are number + unit (m/h/d), minimum 1 minute. Natural language works too (“every weekday at 7am, summarize the overnight commits”); times use the local machine’s zone. Any slash command can live inside a loop, even another /loop.

CronCreate takes standard 5-field cron (minute hour day month weekday) with *, steps (*/15), ranges (1-5), and lists. Not supported: L, W, ?, or name aliases (MON, JAN).

Four hard constraints — memorize or burn time later:

  • 7-day auto-expire — every recurring task self-deletes 7 days after creation.
  • 50 tasks max per session — no warning until you hit it.
  • No catch-up firing — if due while Claude is busy, it fires once when idle, not per missed interval.
  • Session-scoped — closing the terminal cancels everything. (Set CLAUDE_CODE_DISABLE_CRON=1 on CI/shared servers.)

Pair /loop with /goal to fix agentic laziness: a loop alone repeats a task; /loop + /goal repeats until a specific condition is met and refuses to stop at “done enough.” Good for flaky-test debugging, long-running migrations, and inbox-style triage.

Tier 2 — Desktop scheduled tasks

The Claude Desktop app has its own scheduler (Schedule → New task → New local task), separate from the CLI’s /loop. Each fire starts a fresh session with pre-configured permissions, model, and working folder. It survives restarts but still needs the machine awake — a task due while asleep is skipped, then one catch-up run fires on wake. macOS/Windows only; Linux uses /loop, system cron running claude -p, or Routines.

Two operational truths at this tier:

  • Every scheduled fire is a full session counting toward usage limits — a 5-minute loop for 24h is 288 sessions. Set explicit token budgets in the prompt, and match the model to the task (Sonnet for most work, not Opus by default — see Model Tier Routing).
  • Configure permissions for unattended runs. Pre-approve safe tools and deny dangerous ones in settings.json, block secrets with .claudeignore, and enable audit logging you actually read. The test for auto-approval: if this is wrong, what does it cost to undo? Cheap (a draft-PR comment) → auto-approve; expensive (force-push to main) → never.

Auto Mode is the safer alternative to --dangerously-skip-permissions: an AI classifier judges each tool call against the active policy (auto-approve / prompt / block). Anthropic found users approve 93% of prompts; Auto Mode automates the 93% and keeps the human for the 7%. Built-in rule lists you can print with claude auto-mode defaults, a server-side prompt-injection probe on tool outputs, and a full audit trail. (Research preview; available on all plans as of November 2026, with model requirements that vary by provider.)

Tier 3 — Cloud Routines

A cloud scheduled task (formerly a Routine) is a saved Claude Code configuration (prompt + repos + connectors + permissions) that runs on Anthropic-managed cloud infrastructure on a trigger. Your laptop can be off. Create at claude.ai/code/routines or with /schedule in the CLI. A routine bundles a self-contained prompt (no follow-up questions — ambiguity becomes a coin flip every run), repositories cloned per run, connectors (Slack, Linear, Drive, GitHub), an environment controlling network/secrets, and one or more triggers. By default Claude pushes to a claude/-prefixed branch unless the prompt says otherwise. The prefix is a default, not a lock: to protect main, use GitHub branch protection or rulesets.

Three trigger types — and this is the load-bearing idea:

  1. Schedule — a cadence (the one to start with). Morning briefing, daily PR review pass, weekly doc-drift detection.
  2. API — a unique HTTP endpoint that takes a bearer token in the Authorization header. POST from anywhere (CI failure, PagerDuty, a Stripe webhook); the JSON body becomes one-shot context. Claude becomes a callable workflow from any system in your stack.
  3. GitHub — hooks into the Claude GitHub App webhook (PR, push, issue, check run, workflow run, release, …). Each event starts an independent session.

The deep connection

The three trigger types are exactly the “one execution pipeline, many triggers” pattern from Cloud Agent Infrastructure — a human click, a scheduler, an HTTP call, and another agent all flow through the same agent. Routines are Anthropic’s productized version of cloud agent infrastructure: the frozen environment, host-side credentials/connectors, and the single pipeline are all there. This article is the user-facing surface of what that article describes at the platform-engineering level.

Composition — the stack at peak

Step 14 closes the loop with the rest of Claude Code:

  • Skills inside Routines — a reusable instruction file in ~/.claude/skills/ is the recipe; the routine is the trigger that runs it. (See Skillify - Meta-Skill Pattern for building skills that compound.)
  • Dynamic Workflows inside Routines — for parallel subagents (deep verification, tournaments, fan-out research): routines provide scheduling, workflows provide structure. Maps to the orchestrator-worker pattern.
  • Routines triggered by other Routines — one routine’s output (a PR, a Slack message, a label) is another’s trigger.
  • Permissions per routine, not global — each routine’s permission file is part of its security boundary.

The full picture: Skills as recipes, Dynamic Workflows as orchestration, Routines as the trigger layer, Auto Mode as the permission classifier, audit logs as your morning review.

The waste list (anti-patterns)

Never trying /loop; forgetting the 7-day expire; using /loop for work that should outlast the terminal (promote it); letting tasks default to Opus; no /goal on loops that should run to completion; blanket --dangerously-skip-permissions; vague routine prompts; no audit logs; disabling the claude/ branch prefix prematurely; running heavy automation on Pro and hitting rate limits.

  • Role, Tools, Trigger, Output — the non-coder counterpart to this page: the same trigger ladder (schedule vs event) framed for the consumer Claude app (Cowork scheduled tasks), with the role/tools/trigger/output anatomy and a recipe catalogue. Send a non-engineer there first; send them here once they outgrow Cowork.
  • Loop Engineering — the concept above this page: why you assemble these five pieces (automations, worktrees, skills, connectors, sub-agents + memory) into a self-feeding loop. This page is the Claude Code mechanics; that one is Osmani’s philosophy, the cross-tool (Codex) mapping, and the “stay the engineer” warning.
  • Cloud Agent Infrastructure — the platform-engineering view of exactly this “one pipeline, many triggers” model
  • Five Patterns for Long-Running Agents in Production — ambient processing and fleet orchestration, which Routines implement
  • Model Tier Routing — why not to default every scheduled fire to Opus
  • Skillify - Meta-Skill Pattern — building the Skills that Routines invoke
  • Slash Commands — this vault’s own custom commands (a different layer from Claude Code’s native automation)
  • Long-Running Agents — why unattended, persistent execution is hard in the first place