NonDev Apps

Day 18 of 21

The /loop command — set Claude to work in the background automatically

Goal: Most people use Claude Code reactively, ask, wait, review, repeat. Today you learn to set tasks running in the background on a timer so Claude Code works while you do other things entirely.

What to do

01

Open Claude Code

Start Claude Code in your project folder:

claude
02

Set up an error monitoring loop

Type:

/loop 5m check my project for any errors or broken references and list anything you find. If nothing is wrong, say "All clear."
03

Open a second session and make three changes

While the loop is running: open a second terminal window, start Claude Code, and make three small changes to your project. Use the 4-part formula. Do not close the first window.

04

Wait for the loop report

Wait 5 minutes. Watch Session 1 — it will automatically run the check again and report what it finds.

05

Stop the loop

In Session 1, type:

/loop stop

Expected result

You set up an automated error monitoring loop. It ran on a timer without you asking. You can now set monitoring running and work on other things while it watches.

Key takeaway

  • /loop [interval] [task] sets Claude Code running on a timer. Set it once, let it run, do other things. Use it to monitor for errors during long builds. Stop it with /loop stop.
The /loop command — set Claude to work in the... — NonDev Apps