Scheduled Tasks: /loop, Routines & the “Ralph Loop”
Instead of running once and stopping, Claude Code can keep re-running a prompt until a task is actually done — now built in, not a community trick.
The video's closing recommendation is the “Ralph loop,” described as an official plugin that repeatedly feeds Claude Code the same prompt, evaluates what's left to do against the current file state, and keeps iterating — headless mode “on steroids,” used to ship entire projects overnight.
Correction / update: that iterate-until-done pattern is now a first-class, built-in feature rather than a separately installed plugin. The /loop command repeats a prompt on a schedule you set, or lets Claude choose the interval dynamically based on what it observes (checking more often while a build is active, less often once things go quiet) — and it can stop itself once the task is actually complete. Session-scoped loops expire after seven days as a safety bound. For work that needs to survive independently of any open session or running machine, Routines run in the cloud on a schedule, on a GitHub event, or via API call — genuinely unattended, no machine required to stay on. For local, machine-dependent recurring jobs, there are also Desktop scheduled tasks. The one-off community “Ralph loop” name is worth knowing if you encounter it in older material, but the functionality it names is now a supported, documented feature rather than a third-party trick.
Real-life use cases
Babysitting a PR overnight
/loop check whether CI passed and address any review comments keeps working through a pull request's feedback loop unattended — checking, fixing, waiting, and re-checking — so it's further along by morning without anyone watching it run.
A weekly dependency audit that survives your laptop being off
Instead of a session-bound /loop, a team sets up a cloud Routine that checks for outdated dependencies every week and opens a PR with updates — it runs whether or not anyone's machine is even on.
Source
- Source video: “Claude Code Explained” — 27 concepts in 27 minutes (YouTube)https://www.youtube.com/watch?v=ZlDnsf_DOzg
- Run prompts on a schedulehttps://code.claude.com/docs/en/scheduled-tasks
- Routineshttps://code.claude.com/docs/en/routines