Claude Code /loop Command: Recurring Prompts and In-Session Cron Scheduling
Claude Code 2.1.71 introduces the /loop command, enabling developers to schedule recurring prompts or slash commands at fixed intervals within an active session β for example, /loop 5m check the deploy polls a deployment every five minutes without requiring manual re-invocation. The feature is backed by a full cron scheduling engine that accepts standard five-field cron expressions and respects the local timezone. Recurring tasks automatically expire after three days to prevent abandoned jobs from accumulating. The release also resolves a cluster of high-impact stability issues, including a startup freeze tied to CoreAudio initialization and a stdin hang in long-running sessions.
Sources & Mentions
5 external resources covering this update
Anthropic turns Claude Code into a background worker with local scheduled tasks
The Decoder
Show HN: Continuous Claude β run Claude Code in a loop
Hacker News
Claude Code just quietly shipped something most people scrolled past. /loop
X (Twitter)
Scheduled tasks are now also coming to Claude Code CLI 2.1.71 via /loop command
X (Twitter)
Claude Code v2.1.71 changelog thread
X (Twitter)
The /loop Command: Automated In-Session Scheduling for Claude Code
Claude Code 2.1.71, released on March 7, 2026, adds native scheduling to the CLI with the introduction of the /loop command and a full cron scheduling subsystem. The feature transforms Claude Code from a purely interactive tool into one capable of acting as a persistent background worker for repetitive developer workflows.
How /loop Works
The /loop command accepts an interval and a prompt (or another slash command), then schedules the job to fire repeatedly for the duration of the active session. The syntax is straightforward:
/loop 5m check if the deployment finished and tell me what happened
/loop 15m scan my error logs for new exceptions
/loop 1h /review-pr 1234
Supported interval units are seconds (s), minutes (m), hours (h), and days (d). Claude Code parses the interval, converts it into a cron expression, schedules the job, and confirms the cadence and job ID back to the developer. Each session supports up to 50 scheduled tasks. Recurring tasks automatically expire after three days β firing one final time before deleting themselves β which prevents forgotten loops from accumulating indefinitely.
Cron Scheduling Tools
Behind the /loop command, Claude Code exposes lower-level cron scheduling tools that accept standard five-field cron expressions: minute hour day-of-month month day-of-week. All fields support the full cron syntax β wildcards (*), single values, steps (*/15), ranges (1-5), and comma-separated lists (1,15,30). All times are interpreted in the local timezone, not UTC.
This lower-level interface gives developers precise control for scenarios where simple interval syntax is insufficient β for instance, triggering a build check at specific times each day (0 9,13,17 * * *) or scheduling a task on weekdays only (0 9 * * 1-5).
Practical Use Cases
The /loop command covers a class of developer workflows that previously required external tooling or manual re-invocation:
- Deployment monitoring β poll a pipeline every few minutes and receive a summarized status update
- Log scanning β check error logs at regular intervals and automatically open pull requests for fixable bugs
- Build tracking β monitor long-running CI jobs without context-switching away from the terminal
- Timed reminders β set one-time or recurring in-session reminders (
/loop 30m remind me to push the release branch)
Developer Thariq Shihipar demonstrated the capability by scanning error logs every few hours and having Claude Code automatically create pull requests for fixable bugs β a fully automated background workflow requiring no tooling beyond the CLI itself.
Session Lifecycle and Limitations
Scheduled tasks are scoped to the active CLI session. Closing the terminal or allowing the session to exit cancels all pending jobs. This distinguishes the CLI-based /loop and cron tools from the Claude Code Desktop app's persistent scheduled tasks, which survive restarts. The CLI approach is designed for in-session polling and short-lived automation rather than always-on background agents.
Additional Changes in 2.1.71
Voice Keybinding
The release adds a voice:pushToTalk keybinding that makes the voice activation key fully configurable in keybindings.json. The default remains the spacebar, but modifier combinations such as meta+k are now supported, eliminating typing interference for users who frequently type while voice mode is active.
Stability Fixes
A notable cluster of stability issues is resolved alongside the scheduling feature:
- A 5β8 second startup freeze caused by CoreAudio initialization blocking the main thread after system wake from sleep is patched.
- A stdin freeze in long-running sessions β where keystrokes stop being processed but the process remains alive β is resolved.
- The startup freeze triggered when many claude.ai proxy connectors simultaneously refresh an expired OAuth token is fixed.
- Forked conversations created with
/forkno longer share a plan file, preventing plan edits in one fork from silently overwriting the other. - Background agent completion notifications now include the output file path, making it easier for parent agents to recover results after context compaction.
Plugin and Permission Improvements
Plugin installations are no longer lost when running multiple Claude Code instances simultaneously. The /plugin uninstall command now writes changes to .claude/settings.local.json instead of the shared .claude/settings.json, so uninstalls do not affect teammates' configurations. Plugin-provided MCP servers that duplicate a manually-configured server are automatically skipped, preventing duplicate connections and tool sets.
Performance
Startup time improves by deferring native image processor loading to first use. Bridge session reconnection now completes within seconds after laptop wake from sleep, down from a previous delay of up to 10 minutes.