Claude Code

Routines and /loop scheduling

Cloud routines, /schedule, /loop, Cron tools, Desktop tasks, GitHub/API triggers, network permissions and cache strategy.

Claude Code offers local-session scheduling and hosted scheduling:

MethodRuns inSuitable for
/loop and Cron toolsCurrent local sessionWaiting for CI, polling deployments and temporary reminders
Routines and /scheduleAnthropic cloudSchedules while your computer is off, API/GitHub triggers
Desktop scheduled tasksLocal DesktopLocal files/tools without an open CLI session
GitHub ActionsCIRepository events, standardized auditing and team workflows

Local /loop is the straightforward choice with Passion8. Routines and /schedule are claude.ai cloud features, generally requiring subscription authentication and the official cloud environment.

#/loop

Each trigger is an ordinary prompt turn, inheriting the session's context, permissions, MCP, model and Passion8 configuration.

/loop 5m check whether the deployment finished
/loop check CI and address any review comments
SyntaxBehavior
/loop 5m <prompt>Fixed interval
/loop <prompt>Claude chooses the next interval based on findings
/loopBuilt-in maintenance prompt or .claude/loop.md
/loop 20m /review-pr 1234Periodically invokes an automatically callable skill

Units include s, m, h and d. Cron rounds seconds up to minutes and adjusts intervals that do not divide evenly to an approximate cadence.

#loop.md

Customize the prompt for bare /loop:

PathScope
.claude/loop.mdProject, higher priority
~/.claude/loop.mdUser default
.claude/loop.md
Check the current PR. If CI failed, retrieve the failure logs and fix the issue.
Address and reply to review comments. If everything is quiet, output one status line.

Keep it short. Overlong content may be truncated, and adding it every turn increases fixed context cost.

#Cron tools

Ask for session-scoped scheduled tasks:

in 45 minutes, check whether the integration tests passed
remind me at 3pm to push the release branch
ToolPurpose
CronCreateCreate one-shot or recurring tasks
CronListList this session's scheduled tasks
CronDeleteCancel by task ID
LimitDetails
Current session requiredClosing the terminal or starting another session stops execution
ResumeUnexpired recurring tasks or future one-shots can resume
Seven-day expiryRecurring tasks are deleted seven days after creation
No catch-up runsMultiple missed triggers are not all replayed
Per-session capOfficial documentation specifies at most 50 scheduled tasks

#Cache strategy

IntervalFive-minute TTLOne-hour TTL
1–4 minutesLikely warmWarm
5–10 minutesBorderline or coldUsually warm
15–60 minutesUsually coldUsually warm
Over one hourColdCold
  1. Each /loop trigger is a normal turn and can refresh the cache.
  2. Waiting beyond TTL requires reading history again.
  3. Dynamic loops choosing long waits should not assume a continuously warm five-minute cache.
  4. Background sessions remain the same session, but paused time does not refresh TTL.
  5. Cloud routines use separate sessions and do not share local Passion8 caches.

#Routines

A routine saves its prompt, repository, environment, connectors and triggers. It runs in Anthropic's cloud, even when your computer is off.

TriggerUse
ScheduleHourly, daily, weekly or at a future time
APIPOST to a routine endpoint
GitHub eventPR or release events
ScenarioExample
Backlog maintenanceOrganize issues, label them and synchronize Slack
Alert triageAnalyze logs and draft a PR after an alert
Custom reviewComment on new PRs using a team checklist
Deployment verificationRun smoke checks and report after deployment
Documentation driftScan changes weekly and draft documentation PRs

#/schedule

Create/manage routines conversationally from the CLI:

/schedule daily PR review at 9am
/schedule tomorrow at 9am, summarize yesterday's merged PRs
CommandPurpose
/schedule listList routines
/schedule updateModify a routine
/schedule runTrigger immediately
/schedule <description>Create a scheduled routine

CLI creation primarily uses schedule triggers. Configure API/GitHub triggers at claude.ai/code/routines.

#Routine permissions and networking

Cloud routines run autonomously rather than requesting approval for every tool call. Limit their access:

ItemControl
RepositoriesSelect only required repositories
Branch pushesDefault claude/ prefix; avoid unrestricted access without need
ConnectorsRemove unrelated connected services
VariablesSupply only necessary secrets
NetworkTrusted allowlist by default; explicitly add required domains
Setup scriptInstalls dependencies/tools with environment caching

MCP connector traffic uses Anthropic-hosted connections; this does not guarantee the cloud VM can access the same domain. Use local /loop or Desktop tasks for local databases, LAN services or files.

#API triggers

An API trigger provides a dedicated URL and bearer token. POST to /fire starts a new session and returns its ID/URL. An optional text field carries alert, log or deployment details.

curl -X POST https://api.anthropic.com/v1/claude_code/routines/trig_xxx/fire \
  -H "Authorization: Bearer sk-ant-oat01-xxxxx" \
  -H "anthropic-beta: experimental-cc-routine-2026-04-01" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"text": "prod deploy failed, check alert SEN-4521"}'

This research-preview API may change headers, limits and response shape. Keep tokens out of repositories.

#Choosing with Passion8

NeedRecommendation
Periodic local checks using Passion8Local /loop
Interval over five minutes but under one hourSupported one-hour TTL, or accept cold starts
Run while the computer is offOfficial routines or GitHub Actions
Local files, databases or LANLocal /loop or Desktop tasks
API-triggered Claude workOfficial Routine API, or your own CI wrapper around claude -p
Fewer tokensShort prompts, stable rules in CLAUDE.md, no large repeated logs

#Troubleshooting

ProblemCommon cause
/schedule unknownNo subscription login, old version, nonessential traffic disabled, or invocation inside a web session
Routine does not runOrganization disabled it, daily cap reached, or insufficient usage credits
Cloud private-service 403Domain missing from environment network permissions
GitHub trigger does not fireMissing GitHub App or unmatched filter
/loop does not continueSession closed, task expired, or Esc stopped waiting

#Official references

Support

Need help?

For setup, billing, or model issues, email us. Check the status page for uptime.

WeChat / QQ support is available at the bottom right.