Freeive

claude-code·Published 2026.06.01·Views 1

Claude Code /loop: How to Auto-Repeat the Same Task

A beginner guide to the /loop command, which repeats the same prompt periodically during a session — automating "watch until it's done" tasks like deploy m

"Checking myself every 5 minutes whether the deploy finished is such a hassle — can't Claude just watch it for me?" The command for handing such repetitive checking to Claude Code is /loop. Set it once and it repeats the same task periodically on its own.

Definition (What It Is)

/loop is a command that repeatedly runs the same prompt (the instruction you give Claude) for as long as the session (the work time you've kept Claude Code open) is open. As an alias (a different name calling the same function), there's also /proactive.

Put simply, it's instructing "don't do this once and stop — keep doing it at set intervals." Instead of a person sitting beside it hitting refresh and watching, Claude checks repeatedly in your place.

How to Use It (By Difficulty)

Basic — Repeating at a Set Time Interval

/loop 5m 배포 끝났는지 확인

Typing this repeats the "check whether the deploy finished" task every 5 minutes (5m is 5 minutes). You can change the number and unit to specify any cadence you want, like 10m (10 minutes) or 30s (30 seconds).

Intermediate — Delegating Autonomous Checks Without a Time

/loop

Typing just /loop without a time or instruction after it makes Claude operate in an autonomous mode where it repeats maintenance checks on its own. It continues checks adapted to the situation, unbound by a fixed interval.

Common Pitfalls (Only When Relevant)

/loop only works while the session is open. Closing the terminal (the black window where you type commands) or quitting Claude Code stops the repetition too. So if you need long-term monitoring, you must leave the window open. Also, repeating a heavy task at too short an interval (like 10s) racks up usage quickly, so it's good to set a cadence suited to the task's nature.

Real-World Example

Picture a situation where you've started a deploy (putting your built program onto a real server) and have to wait until it finishes. Setting /loop 5m 상태 확인 checks the deploy status every 5 minutes, so you can do other things in the meantime and just watch for the "it's done" alert. No need to stare at the terminal yourself.

Taking It Further

Being able to repeat periodically means you can hand off monitoring tasks like "watch until some condition is met" entirely. For example, it fits monitoring-type tasks like "repeatedly check until the tests pass" or "let me know when a certain file is created." It frees a person from having to remember a regular checking routine.

Summary

/loop is a command that repeats the same task periodically. Write a time and a task like /loop 5m 지시 and it repeats at that interval; write just /loop and you can delegate autonomous checks. In situations needing "watch until it's done," like deploy monitoring, it saves you the effort of refreshing yourself.

Based on: Claude Code v2.1.154 (2026.05)

#ClaudeCode#claude-code#loop#AI coding#vibe coding#developer

Comments

Comments 0

Checking sign-in status…

Loading comments…

Recent

More notes.