Last reviewed:
Running Claude Code autonomously: delegate the loop, keep control
In autonomous mode, you no longer drive every step of Claude Code: you set a stop condition once, and a check (an evaluator model or a script) verifies it after each turn until the work is genuinely finished. Four levers make this loop automatic: /goal, /loop, /schedule and Stop hooks.
Claude Code can work two ways: as an assistant you watch at every step, or as an autonomous agent you delegate a "work, check, repeat" loop to until a stop condition is met. This dossier details the four mechanisms that make that autonomy operational, and where to keep control. Edition verified on October 2, 2026 against the official documentation (Claude Code 2.1.287).
WYP.agency, practical guide, edition 2.0 verified on October 2, 2026
01From assistant to autonomous agent
Most developers use Claude Code as an assistant they have to prompt at every step. There is another way to work: you set a condition once, and Claude keeps going until it is met.
In the usual flow, you are the loop: you write a prompt, Claude replies, you review, you re-run, twenty times. In the autonomous flow, you set a stop condition, a check runs after each turn, and if the work is not done, Claude goes again. You define the goal once.
This is not a convenience setting. It is a different relationship to the tool: instead of driving every step, you delegate the "work, check, repeat" loop. The question is no longer "how do I do this", but "what am I willing to delegate".
02The four levers
Four mechanisms make the loop automatic. Each is defined by what triggers the next turn and by its stop condition, what decides the work is done.
/goal: run until a condition is true
You describe the target and Claude starts right away. After each turn, a small fast model reads the conversation and returns one of three verdicts: not yet met (Claude goes again), met, or impossible (the goal ends and control comes back to you). Best when "done" can be proven in the conversation: the tests pass, npm test exits 0.
/loop: re-run on an interval
Claude re-runs a prompt at a fixed cadence (/loop 5m) or at a pace it chooses, between 1 minute and 1 hour, until you stop it; a recurring task expires after 7 days. Available since version 2.1.71 (March 2026). Useful to watch a changing state: a deployment, CI, a pull request.
/schedule: a routine in the cloud
/schedule creates a routine that runs on Anthropic-managed infrastructure on a schedule, even with your computer off. It works on a fresh clone of the repository, with no access to your local files, and a minimum interval of one hour. Routines are in research preview, on Pro, Max, Team and Enterprise plans. For a task that must touch your machine, the desktop app offers local routines (Code tab, Routines, New routine, Local), at intervals down to one minute, while the app is open.
Stop hooks: programmable control of a turn's end
A script or a prompt decides whether Claude may stop. For a script, the exit code rule is strict: 0 allows the stop, 2 blocks it and passes your message to Claude, which keeps going. Any other code, 1 included, is a non-blocking error: Claude stops anyway. To enforce a rule, end with exit 2.
03Choosing the right lever
04Keeping control
Delegating the loop does not mean letting go. Useful autonomy is bounded: a provable stop condition, a turn or time limit, a protected scope, and a point where a human signs off on what commits.
/goal does not change your permission mode. In Manual mode, Claude still asks before tools you have not allowed; auto mode removes those prompts, with background safety checks. Increase autonomy in steps: /goal alone, then auto mode, and finally a script-based Stop hook.
Reference points as of October 2, 2026: Claude Code 2.1.287, default model Opus 5.5 since version 2.1.280, /goal available since version 2.1.139.
The right question is not "does it work?" but "which decision am I willing to delegate, and which requires my signature?" Autonomy is framed before it is launched.
Get the guide as a PDF
The four levers to run Claude Code autonomously — /goal, /loop, /schedule, Stop hooks — each command cross-checked against the official documentation.
PDF · 16 pages · October 2026 edition · FR / EN / ES · delivered in under a minute
See also
Further reading
Sources
- WYP.agency, guide "Running Claude Code autonomously", verified edition 2.0, October 2, 2026. https://wyp.agency/en/glossary/claude-code-autonomous/
- Keep Claude working toward a goal (/goal), Claude Code documentation. https://code.claude.com/docs/en/goal
- Run prompts on a schedule (/loop), Claude Code documentation. https://code.claude.com/docs/en/scheduled-tasks
- Automate work with routines (/schedule), Claude Code documentation. https://code.claude.com/docs/en/routines
- Schedule recurring tasks in Claude Code Desktop (local routines), Claude Code documentation. https://code.claude.com/docs/en/desktop-scheduled-tasks
- Hooks reference (Stop, exit codes), Claude Code documentation. https://code.claude.com/docs/en/hooks
- Choose a permission mode (Manual, auto), Claude Code documentation. https://code.claude.com/docs/en/permission-modes
- Model configuration (default model Opus 5.5), Claude Code documentation. https://code.claude.com/docs/en/model-config
- Claude Code changelog (versions 2.1.71, 2.1.139, 2.1.280, 2.1.287). https://code.claude.com/docs/en/changelog