If you've ever wanted Claude Code to do something more than once without babysitting it, you've probably hacked together a shell loop or a cron job wrapping claude -p. That worked. Barely. Claude Code now has a first-class Loop feature that handles recurring prompts natively - scheduling, intervals, expiry, and session scoping built in.
This is the evolution of the "Ralph Wiggins technique" (yes, that was its name) into something you'd actually ship a workflow around.
The core problem with wrapping Claude Code in external schedulers: context evaporates between runs. Each invocation is a cold start. No memory of the last run. No awareness of what changed. No ability to pick up where it left off.
Loops solve this by keeping the session alive. The prompt runs on a schedule within a persistent Claude Code session. Same context window, same tool access, same MCP connections. The agent remembers what it did last iteration and can build on it.

Two entry points. Natural language or the /loop command.
Natural language works exactly how you'd expect:
Every 5 minutes, check if my PR build is passing. If it fails,
read the error log, fix the issue, and push a new commit.
Claude Code parses the schedule, sets the interval, and starts executing. You can also be explicit with the command:
/loop "Summarize any new posts tagged #announcements in the team Slack channel" --interval 30m --expires 8h
The minimum interval is one minute. Maximum window is three days. After the expiry, the loop stops automatically - no orphaned processes, no runaway API bills.
Each loop gets a scheduled prompt, optional notes for context, and the auto-expiry timer. Clean and predictable.
Three new commands handle lifecycle management:
cron create # Create a new scheduled loop
cron list # See all active loops in the current session
cron delete # Kill a specific loop by ID
cron list shows you every active loop with its interval, next run time, and expiry. cron delete takes the loop ID and stops it immediately.
Fixing builds on repeat. Point a loop at your CI pipeline. Every few minutes, check the build status. If it's red, read the logs, identify the failure, fix it, commit, push. Keep going until green. This is the "leave it running overnight" play - wake up to a passing build instead of a Slack notification graveyard.
Slack channel summaries via MCP. If you've connected Slack through MCP, loop a prompt that pulls new messages from a channel, summarizes them, and writes the summary to a local file or posts it back to a different channel. Daily standup notes that write themselves.
Daily git recaps. Schedule a loop that runs once a day, pulls git log for the last 24 hours across your repos, formats a summary, and saves it to your desktop. Context on what your team shipped without opening GitHub.
Every day at 9am, run git log --since="24 hours ago" --oneline
across all repos in ~/Developer, summarize the changes by project,
and save to ~/Desktop/daily-recap.md

Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
This is where it gets interesting. Loops compose with everything Claude Code already has - skills, MCP tools, CLI access. Chain them together.
The Hacker News automation is a good example of this in practice:
Every day at 7am, use Firecrawl to scrape the Hacker News front page.
Summarize the top 10 posts most relevant to AI agents and developer tools.
Email me the summary using the Gmail CLI skill.
One prompt. Four tools. Runs daily until the session closes or the expiry hits. No glue code.
Loops are scoped to the active session. Close the terminal, close the session, loops stop. This is by design - it keeps the feature safe and predictable. No background daemons, no orphaned processes eating your API quota at 3am.
But it means loops aren't durable. If you need something that survives a reboot or runs when your laptop is closed, you need a different approach:
For anything that needs to run reliably for more than a working session, use those instead. Loops are for "I'm working and I want this thing happening in the background while I focus on something else."
A subtle but smart detail: Claude Code adds up to a 10% random offset to your scheduled interval. If you set a 10-minute loop, it might fire at 9:12, then 10:48, then 9:36.
Why? If a thousand developers all schedule a "every 10 minutes" loop, you don't want all of them hitting the API at exactly :00, :10, :20. The jitter spreads the load. Same principle as exponential backoff in distributed systems, applied preemptively.
You can disable this with a flag if you need precise timing, but for most use cases the offset is invisible and helpful.

Loops - ephemeral, session-scoped, great for "while I'm working" background tasks. Zero setup.
System cron / LaunchAgents - durable, survives reboots, but you lose Claude Code's session context. Each run is a cold start.
GitHub Actions - cloud-durable, runs when your machine is off, integrates with repos natively. Best for CI/CD-adjacent automation.
Pick based on durability requirements. Most developers will use loops for the ad-hoc stuff and Actions for anything that needs to be reliable.
Official docs:
This article is based on a Developers Digest video. All feature behavior is based on direct testing with Claude Code at time of publication.
Further Reading:
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Anthropic's agentic coding CLI. Runs in your terminal, edits files autonomously, spawns sub-agents, and maintains memory...
View ToolOpenAI's cloud coding agent. Runs in a sandboxed container, reads your repo, executes tasks, and submits PRs. Uses GPT-5...
View ToolCodeium's AI-native IDE. Cascade agent mode handles multi-file edits autonomously. Free tier with generous limits. Stron...
View ToolNew tutorials, open-source projects, and deep dives on coding agents - delivered weekly.
Cognition Labs' autonomous software engineer. Handles full tasks end-to-end - reads docs, writes code, runs tests, and...
View ToolConfigure Claude Code for maximum productivity -- CLAUDE.md, sub-agents, MCP servers, and autonomous workflows.
AI AgentsWhat MCP servers are, how they work, and how to build your own in 5 minutes.
AI AgentsInstall the dd CLI and scaffold your first AI-powered app in under a minute.
Getting Started
Check out Trae here! https://tinyurl.com/2f8rw4vm In this video, we dive into @Trae_ai a newly launched AI IDE packed with innovative features. I provide a comprehensive demonstration...

Claude Code “Loop” Scheduling: Recurring AI Tasks in Your Session The script explains Claude Code’s new “Loop” feature (an evolution of the Ralph Wiggins technique) for running recurring...

Leveraging Anthropic's Subagent for Claude Code: A Step-by-Step Guide In this video, we explore Anthropic's newly released subagent feature for Cloud Code, which allows developers to create...

Anthropic dropped a batch of updates across Claude Code and Cowork - remote control from your phone, scheduled tasks,...

Anthropic brought git worktrees to Claude Code. Spawn multiple agents working on the same repo simultaneously - no mer...

Claude Opus 4.5 ran autonomously for 4 hours 49 minutes using stop hooks and the Ralph Loop pattern. Walk away, come bac...