Claude Code 루프 시작하기
Hada URL: https://news.hada.io/topic?id=31225
Canonical URL: https://claude.com/blog/getting-started-with-loops
Captured: 2026-07-10 06:36 KST
Fetch method: ultimate-fetcher --json via Jina for both Hada summary and canonical Claude blog.
Summary
Claude Code team defines a loop as an agent repeating cycles of work until a stop condition is met. The article organizes agentic loops into four types: turn-based, goal-based, time-based, and proactive. The taxonomy is useful because it does not treat all automation as one thing. Each loop type delegates a different piece of the work: the check, the stop condition, the trigger, or the prompt itself.
The practical advice is to start simple. Not every task needs a complex loop. A developer should first identify where they are the bottleneck, then choose the smallest loop pattern that removes that bottleneck without wasting tokens or losing control.
Four loop types
1. Turn-based loop
A turn-based loop starts with a user prompt and stops when Claude judges the task complete or asks for more context. This is the default agentic loop: gather context, act, check, repeat if needed, and respond.
The main improvement is to encode manual verification steps into a SKILL.md. For UI changes, a skill can require the agent to start the dev server, open the page, interact with the changed control, capture before and after screenshots, check the browser console, and run performance checks. The more quantitative the verification is, the easier it is for the agent to self-check.
2. Goal-based loop
A goal-based loop uses /goal. It starts from a manual prompt and stops when a goal is achieved or a maximum number of turns is reached.
The important design move is that Claude does not decide for itself what is “good enough.” Each time it tries to stop, an evaluator model checks the goal condition and sends Claude back to work if the condition is not met. Deterministic criteria work best: all tests passing, Lighthouse score above a threshold, zero console errors, empty queue, or a specified benchmark score.
Example: /goal get the homepage Lighthouse score to 90 or above, stop after 5 tries.
3. Time-based loop
A time-based loop uses /loop or /schedule. It is triggered by a specified interval and stops when the user cancels it or the work completes. It fits recurring work or external systems that change on their own schedule: checking a pull request, responding to code review comments, fixing failed CI, or summarizing messages every morning.
/loop runs locally and depends on the user’s machine. /schedule moves the routine to the cloud, making it more durable.
4. Proactive loop
A proactive loop is triggered by an event or schedule with no human present in real time. Each task exits when its goal is met, while the routine continues until disabled.
This pattern composes multiple Claude Code primitives: /schedule for trigger, /goal for the done condition, skills for verification, dynamic workflows for multi-agent orchestration, and auto mode for running without repeated permission prompts. Suitable tasks include bug reports, issue triage, migrations, dependency upgrades, and recurring feedback processing.
Code quality principles
Loop output quality depends on the surrounding system. The article highlights several practices:
- Keep the codebase clean because Claude follows existing patterns and conventions.
- Provide self-verification tools and skills so the agent can check team-specific quality criteria.
- Make current framework and library documentation easy to access.
- Use a second agent for code review because a fresh context is less biased by the main agent’s reasoning.
- When a result fails quality standards, improve the system itself rather than only patching the individual issue.
Token and cost management
Loops need boundaries. The article recommends:
- Pick the right primitive and model for the task.
- Define clear success and stop criteria.
- Pilot large dynamic workflows on a small scope first.
- Use scripts for deterministic work instead of forcing the model to reason through repeatable steps.
- Do not run routines more often than the monitored system changes.
- Review usage with tools such as
/usage,/goal, and/workflows.
Operational takeaway
The article reframes agentic work as a delegation ladder:
- Turn-based: hand off the check.
- Goal-based: hand off the stop condition.
- Time-based: hand off the trigger.
- Proactive: hand off the prompt and routine.
The question to ask is not “which loop is most powerful?” but “which specific piece am I currently doing manually, and can it be safely delegated?”