Use /loop to Run Recurring Tasks Inside Your Session
Sometimes you need Claude to keep checking on something while you work — a CI build, a deploy rolling out, or a flaky test you're monitoring. Instead of manually re-running the same prompt, let /loop handle it.
/loop 5m check the CI status on my latest PR and tell me when it passes
This runs the prompt every 5 minutes until you stop it. The default interval is 10 minutes if you don't specify one, and you can use shorthand like 5m, 1h, or 30s.
You can also loop slash commands. If you have a custom command that checks something specific, just pass it directly:
/loop 2m /check-deploy
A few things to keep in mind:
- The loop only runs while your Claude Code session is active — it's not a background daemon.
- Each iteration uses your context window, so keep the prompt focused to avoid bloating the conversation.
- Use
/compactbetween long-running loops if the context starts getting heavy. - Press
Escapeto interrupt the current iteration, or close the session to stop the loop entirely.
This pairs well with MCP servers — for example, loop a Nightwatch issue check or a database query to watch a value converge.
/loop 10m check Nightwatch for any new exceptions in the last 10 minutes
Think of /loop as a lightweight cron that lives inside your conversation — no hooks, no config, just set it and forget it.
via Claude Code
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.