Tutorial: Automating with Loops
Intermediate — 10 minutes
Learn how to set up automated loops that create Pods on a schedule. Loops are perfect for recurring tasks like code reviews, dependency updates, test runs, and monitoring.
What Are Loops?
A Loop is a scheduled automation that periodically creates an AgentPod with a predefined configuration. Think of it as a cron job for AI agents — it runs your prompt on a schedule, creating a fresh Pod each time.
- Recurring code reviews — Check for code quality issues every morning
- Dependency updates — Scan and update outdated packages weekly
- Test monitoring — Run test suites and report failures daily
- Documentation — Generate or update docs when code changes
Navigate to Loops
Click Loops in the left sidebar. You will see a list of your existing loops (empty if this is your first time) and a button to create a new one.
Create a New Loop
Click New Loop and configure the automation:
Fill in the loop settings:
- Name — A descriptive name, e.g., "Daily Code Review"
- Agent — The AI agent to use (e.g., Claude Code)
- Runner — Which Runner should execute the loop
- Repository — The repository for the agent to work on
- Branch — The branch to check out (defaults to main)
- Prompt — The task for the agent, e.g., "Review recent commits for code quality issues. Check for security vulnerabilities, performance problems, and style inconsistencies. Post a summary to the channel."
- Schedule — Set the cron schedule (e.g., every day at 9 AM, every Monday)
Configure the Schedule
Loops use cron expressions for scheduling. Here are common patterns:
Every day at 9 AM — 0 9 * * *
Every Monday at 8 AM — 0 8 * * 1
Every 6 hours — 0 */6 * * *
Weekdays at 10 AM — 0 10 * * 1-5
Monitor Loop Executions
After creating a loop, you can monitor its activity:
- Loop Dashboard — See all loops with their status, last run time, and next scheduled run
- Execution History — Click a loop to see the history of Pods it has created
- Pod Results — Each execution creates a Pod that you can inspect for terminal output and git changes
- Notifications — Set up channel bindings to receive loop results in a channel
Manage Your Loops
You can manage loops from the Loops dashboard:
- Pause — Temporarily stop a loop from creating new Pods without deleting it
- Resume — Restart a paused loop
- Edit — Update the prompt, schedule, or configuration
- Run Now — Trigger an immediate execution without waiting for the next schedule
- Delete — Permanently remove a loop
Common Loop Patterns
Morning Code Review
Run daily at 9 AM to review yesterday's commits. The agent checks for code quality, security issues, and posts a summary to the team channel.
Weekly Dependency Audit
Run every Monday to scan for outdated or vulnerable dependencies. The agent creates a PR with safe updates.
Continuous Test Monitor
Run every 6 hours to execute the test suite. The agent reports any failures or regressions to the monitoring channel.
What's Next?
You have set up your first automated loop. Explore more: