<- all tokdocs

Claude Code /loop: How It Paces Itself and When It Stops

By , founder of Mavric and Apso

View on TikTok ->

/loop is a real Claude Code command that runs a prompt or slash command on a recurring interval while your session stays open. It shipped in version 2.1.71 in March 2026. If you type it without an interval, as a popular TikTok does, Claude chooses each wait between one minute and one hour and can end the loop by itself once it judges the task done.

What the TikTok shows

A TikTok from @itsjakethewizard ("Jake | The Marketing Wizard") pitches /loop as an SEO automation. The on-screen prompt reads:

/loop SEO-analyze a page of my website. Everything to change: technical, text, tracking. Write a changelog, save it as a PDF. Mark the page done. Go to the next one.

The narration says Claude will "wait a few minutes and then do it again until I tell you to stop." The command is real. The cadence and the stop condition work differently from that description.

What is /loop in Claude Code?

The Claude Code changelog records it under version 2.1.71: "Added /loop command to run a prompt or slash command on a recurring interval (e.g. /loop 5m check the deploy)." The npm registry dates that release to 2026-03-06, about seven months before the video. Many later changelog entries fix how loops survive backgrounding, resume and restarts.

Anthropic documents it on the scheduled tasks page as a bundled skill and calls it "the quickest way to run a prompt on repeat while the session stays open."

How does /loop decide how long to wait?

It depends on whether you give an interval.

With a prompt and no interval, as in the video, "Your prompt runs at an interval Claude chooses each iteration." The docs explain: "After each iteration it picks a delay between one minute and one hour based on what it observed: short waits while a build is finishing or a PR is active, longer waits when nothing is pending. The chosen delay and the reason for it are printed at the end of each iteration."

With an interval, such as /loop 10m followed by the prompt, the loop runs on a fixed schedule. Claude Code adds jitter to spread API load. A /loop 5m job starts each run "4 minutes 45 seconds after the previous run," and other intervals can run late "by up to half the gap to the next run, and by at most 30 minutes."

If you want a predictable cadence, include the interval.

When does /loop stop?

Not only when you tell it to. The docs list several ways a loop ends:

  • In self-paced mode, "Claude can also end the loop on its own once the task is complete" by calling ScheduleWakeup with stop: true.
  • If an iteration ends without rescheduling or stopping, Claude Code "schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn't reschedule either."
  • Every recurring task expires 7 days after creation.
  • Tasks "only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing."
  • A self-paced loop "isn't restored" when you use --resume, so you have to type /loop again.

For an SEO pass that could take hours, a closed laptop ends the run.

/loop vs /goal

For a job that should finish when every page is done, the docs point to /goal. It re-runs turns until a separate model judges a stated condition met. In the docs' comparison table, /loop is the option whose next turn starts when "A time interval elapses." The docs' own example goal, "Working through a labeled issue backlog until the queue is empty," has the same shape as a page-by-page site audit.

Can Claude Code save a changelog as a PDF?

Not with a built-in tool. The tools reference lists every built-in tool, and none writes PDFs. Write "Creates or overwrites files." The only PDF handling on that page is for reading, where long PDFs "render pages with pdftoppm from poppler-utils."

To get a PDF, Claude has to run a converter through Bash, and the converter must already be installed. Bash requires permission, so each conversion prompts you unless the session is in auto mode or the command is allowlisted.

The terminal in the video is an illustration. It prints changelog-home.pdf, an hourglass and "✻ looping until you say stop," but never shows a reply from Claude. A real fixed-interval loop confirms "the cadence and job ID," and the changelog shows a self-paced iteration as "Claude resuming /loop wakeup."

How does /loop remember which pages are done?

Only through the conversation. Scheduled prompts fire "between your turns" in the same session, so "Mark the page done" lasts as long as that context does. Nothing in the docs saves that state across a closed terminal. A sturdier setup has Claude keep a checklist file in the project, so a restarted loop can read where it left off.

Where your site lives also matters. The video's terminal is titled my-website, which implies Claude has the site's source files. For a site on a hosted CMS, Claude reads pages with WebFetch, which the docs call "lossy by design" because Claude receives an extraction of the page rather than the raw HTML.

The prompt also asks for a list of "everything to change" and a changelog, not the changes themselves. The video says applying them belongs in "a whole nother conversation."

Bottom line

/loop exists and suits recurring checks inside an open session. Typed without an interval, it self-paces between one minute and one hour and may stop on its own, so add an interval such as /loop 10m for a fixed cadence. For work that should continue until every page is done, /goal and a checklist file in the project fit better.

Sources

Published October 15, 2026. Based on a TikTok by @itsjakethewizard. Full video notes (markdown)