Picnic
Blog

Loops: scheduled coding agents on your own machines

How Picnic loops run coding agents on a schedule on your own machines, with worked examples for dependency bumps, flaky tests, triage and stalled PRs.

Picnic · · 8 min read

Most of the jobs you give a coding agent are one-offs: fix this bug, build that screen. But a surprising amount of useful agent work is the same job again and again. Bump the dependencies. Look at the flaky tests. Read the new issues. Chase the pull requests that have gone quiet.

Picnic's loops are for that work. A loop is a job on a schedule: it starts on its own, runs on one of your machines, and lands on the board like any other job, ready for you in Needs you or already merged. This guide covers what loops are, four worked examples, how to set one up, and the limits worth knowing.

What a loop is

A loop is five things saved together:

  • A mode. How far the job goes: Plan, Plan and build or Ship. See modes.
  • A prompt. What to do, written as you would write any job.
  • A machine, or any machine, in which case Picnic picks one.
  • A repository on that machine, and optionally the branch to start from.
  • A schedule: every hour, every day, every weekday or every week, at a time you choose, in your time zone. Weekly loops also take a day.

You can also choose the engine (Claude Code or Codex), or let the default decide.

When a loop is due, Picnic's relay creates the job through the same path as the public API. From there it's an ordinary job: it gets its own git worktree and branch, a draft pull request, chat, and the same checks and merge rules as anything you start by hand. If the machine is offline when the loop fires, the job is held and starts as soon as the machine comes back, so a machine that slept through 2am still gets its job when it wakes. Full details are in the loops docs.

Note: Loops keep their prompt on Picnic's relay, because the relay has to start them when none of your apps are open. Write loop prompts with that in mind, and keep secrets out of them. Everything else about the job, including its chat and results, follows the machine's normal privacy settings. See security.

Four loops worth having

These are patterns we've found useful. Adjust the prompts to your project.

1. Nightly dependency bumps (Ship)

Mode: Ship. Schedule: every weekday at 02:00. Machine: your always-on Mac.

Update this project's dependencies to their latest compatible versions (patch and minor only, no major upgrades). Run the full test suite and the build. If something breaks, fix it if the fix is small and obvious; otherwise revert that one dependency and say why in the PR. Keep the PR to dependency changes and the fixes they need.

Ship means the job is expected to end merged. The machine checks CI itself with gh and merges with a squash only when the required checks are green; red CI goes back to the agent to fix. If your branch rules require a human review, Picnic turns on GitHub's auto-merge and waits in Needs you rather than bypassing them, so you approve with your morning coffee.

Why this works well as a loop: the job is narrow, the definition of done is clear (tests and build pass), and doing it little and often keeps each change small. Dependency updates show in the PR, so you can see exactly what moved.

If you'd rather look before anything merges, use Plan and build for UI-heavy projects (it brings back a demo and a draft PR and waits for your review) or set up branch protection that requires a review.

2. Weekly flaky test hunt (Plan)

Mode: Plan. Schedule: every week, Friday at 16:00.

Look at CI runs on the main branch from the past seven days using gh. Find tests that failed and then passed on a rerun, or failed on one run and passed on the next with no related code change. Pick the worst offender. Reproduce it locally if you can (run it in a loop), find the root cause, and write up the cause, the evidence and a proposed fix with your confidence level. Don't change code.

Plan returns a root cause, repro steps, evidence and a fix plan, without changing code. That's exactly what you want for flaky tests, where "just fix it" tends to mean adding a retry and moving on.

When the plan lands in Needs you and you agree with it, click Build it or Ship it and the same job carries on: it builds the fix, opens a PR and, for Ship, merges once CI is green, all in the same session.

Running it on your own machine matters here: the agent reproduces the flake with your real toolchain, simulators and local services, not an approximation of them.

3. Daily issue triage (Plan)

Mode: Plan. Schedule: every weekday at 08:30.

Read the GitHub issues opened or updated in the last 24 hours with gh. For each one, say what you think it is (bug, feature request, question, duplicate), how big it looks, which part of the code it touches, and what you'd do next. Flag anything that looks urgent at the top. Don't comment on or change the issues.

Plan comes back with a written recommendation, no code. You get a short brief in Needs you each morning, and from there you can start a Plan and build or Ship job for the ones worth doing.

Keep the "don't comment on or change the issues" line in the prompt. Agents are helpful, and an unattended agent that decides to label and reply to every issue is not what most teams want.

4. Monday stalled PR sweep (Plan, then Ship)

Mode: Plan. Schedule: every week, Monday at 09:00.

List the open pull requests in this repository that have had no commits or reviews for five days or more. For each, say what's blocking it (failing CI, merge conflict, waiting on review, unanswered comments) and whether it's worth finishing, and give its URL. Order them by how close they are to merging.

A Ship job given a PR's URL takes that PR over the line: fix CI, answer review comments, resolve conflicts, merge. But it works on one specific pull request that you give it, and a loop doesn't name a PR, it runs a prompt. So the sweep is two steps: the Monday loop finds and ranks the stalled PRs, and you start a Ship job with the URL for each one worth finishing, which takes a few seconds per PR from your Mac or iPhone.

Generated PRs pile up fast once agents are doing real work. A weekly sweep keeps the pile from turning into a graveyard.

How to set one up

  1. Get the job right by hand first. Run the prompt once as a normal job on the machine and repository you plan to use. Read the result. Tighten the prompt until a run gives you what you want without any chat.
  2. Put shared rules in global instructions. If several loops share instructions (for example "never touch the migrations/ folder"), put them in your account's global instructions, which are added to every job. See modes.
  3. Create the loop. In Picnic on any of your machines or your iPhone, open the Loops tab and choose +. Pick the mode, paste the prompt, choose one of your machines, the repository and the schedule, and save. Loops are yours alone: teammates don't see them.
  4. Watch the first few runs. Picnic keeps track of each loop's last and next run. Check the first few jobs on the board before you stop thinking about them.

Note: Loops are on every plan, Free included. See pricing.

Good practice

  • One clear finish line per loop. "Bump dependencies and merge if green" works. "Improve the codebase" doesn't.
  • Say what not to do. Loops run with nobody watching. A line or two of "don't" (don't change the public API, don't comment on issues, don't touch CI config) saves a lot of tidying.
  • Prefer Plan until you trust it. A written result costs nothing to ignore. Move a loop to Ship once a few runs have been right.
  • Let branch protection do its job. Picnic merges only when required checks are green and respects required reviews. If a repository matters, require the checks that matter.
  • Pick the right machine. Choose an always-on machine for overnight loops. Use "any machine" only when every machine has the repository and toolchain the job needs.
  • Space them out. Each machine runs as many jobs at once as you allow. Five loops at 02:00 on one machine will queue behind each other, and they all draw on the same Claude or ChatGPT plan's usage limits.
  • Pick the engine on purpose. Some tasks suit Claude Code and some suit Codex. See Codex and Claude Code side by side.

Limits worth knowing

  • Machines have to be on. A loop fires on time, but a job for an offline machine waits until that machine is back. If it's off all weekend, Friday's job runs on Monday.
  • Schedules are simple. Hourly, daily, weekdays or weekly, at a set time. There's no cron syntax and no event triggers (such as "on every new PR"). For events, call Picnic's public API or MCP server from your own automation.
  • The prompt lives on the relay. See the note above. A machine in metadata-only privacy mode still keeps the job's chat and results on the machine.
  • A loop can't take over a PR. Use the Plan then Ship pattern above.
  • Usage limits still apply. Loops run on your own Claude or ChatGPT subscription, under each machine's own login. A busy schedule can use up a plan's limits faster than you expect.

How this compares with hosted schedules

Hosted agents have schedules too. Claude Code has cloud scheduled tasks (formerly called routines, in research preview) that run on Anthropic's infrastructure on a schedule, by API call or on GitHub events (Claude Code docs). GitHub's Copilot cloud agent gained automations in June 2026 that run on a schedule or on repository events (GitHub changelog). Both are good choices if you don't want to keep a machine on, and both offer event triggers that Picnic loops don't.

Picnic's loops are for when the scheduled job needs your own machines: your toolchain, your simulators, your logins, your network. And they land on the same board as everything else, with a mode that says how far each run should go. For the wider picture, see why build your own agent factory.

Try it

Picnic's free plan covers up to 3 machines, loops included. Download Picnic, try the jobs behind these loops by hand, then put them on a schedule.

Sources

Get started

Put your machines to work

Install Picnic on each machine, sign in, and hand off your first job. Free for up to 3 machines.