DEV Community

Garyvov
Garyvov

Posted on

Claude Code New Feature: /loop - Let AI Work for You 24/7

Claude Code New Feature: /loop - Let AI Work for You 24/7

1. New Feature Launched on March 7th

Claude Code now has a built-in /loop command - a session-scoped task scheduler.

What it can do:

  • Automatically repeat prompts
  • Monitor project status in background
  • Set one-time reminders

Examples:

/loop 10m check if deployment finished
/loop every morning at 9:00 summarize my Slack mentions
remind me at 3pm to push the release branch
Enter fullscreen mode Exit fullscreen mode

2. How to Use

Three Syntax Styles

Prefix interval:

/loop 5m check the build
Enter fullscreen mode Exit fullscreen mode

Suffix with "every":

/loop check the build every 2 hours
Enter fullscreen mode Exit fullscreen mode

No interval (defaults to 10 minutes):

/loop babysit all my PRs
Enter fullscreen mode Exit fullscreen mode

Time Units

  • s seconds (rounds up to minutes)
  • m minutes
  • h hours
  • d days

One-time Reminders

remind me at 3pm to push the release branch
in 45 minutes, check whether the tests passed
Enter fullscreen mode Exit fullscreen mode

3. Managing Tasks

View tasks:

what scheduled tasks do I have?
Enter fullscreen mode Exit fullscreen mode

Cancel tasks:

cancel the deploy check job
cancel task abc12345
Enter fullscreen mode Exit fullscreen mode

Maximum 50 tasks per session.


4. Real-World Use Cases

Deployment monitoring:

/loop 10m check deployment status and alert on errors
Enter fullscreen mode Exit fullscreen mode

Auto-fix PRs:

/loop babysit all my PRs. When builds fail auto-fix
Enter fullscreen mode Exit fullscreen mode

Daily morning briefing:

/loop every morning at 9:05 use Slack MCP to summarize mentions
Enter fullscreen mode Exit fullscreen mode

CI checks:

/loop 15m check main branch CI, notify if red
Enter fullscreen mode Exit fullscreen mode

Loop commands:

/loop 20m /review-pr 1234
Enter fullscreen mode Exit fullscreen mode

5. How It Works

Timezone: Uses local timezone, not UTC. 0 9 * * * means 9am local time.

Time jitter:

  • Loop tasks delayed up to 10% (max 15 minutes)
  • On-the-hour reminders may fire up to 90 seconds early

Pro tip: Use 9:07 instead of 9:00 to avoid conflicts.

Execution timing: Runs when Claude is idle, won't interrupt current responses.


6. Limitations

Session-scoped: Tasks disappear when you close the terminal, not saved to disk.

3-day expiry: Auto-deleted after 72 hours, runs one final time before deletion.

No catch-up: Missed tasks won't run retroactively, only waits for next scheduled time.

Production use: For long-term tasks, use Desktop Scheduled Tasks or GitHub Actions.


7. Getting Started

Update Claude Code: https://code.claude.com

Try it:

/loop 10m check if main branch build is green
Enter fullscreen mode Exit fullscreen mode

Check status:

what scheduled tasks do I have?
Enter fullscreen mode Exit fullscreen mode

8. Summary

/loop transforms AI from passive responder to active worker.

Good for: Short-term monitoring, development debugging, temporary tasks.

Not for: Long-term unattended operations, production environments, tasks requiring persistence.

Official docs: https://code.claude.com/docs/en/scheduled-tasks


End of article

Top comments (1)

Collapse
 
naysmith profile image
Gleno

Amazing. Was just thinking this would be a great feature and boom, there it is!