PromptMake
2026-08-29·16 min read

Claude Loop Prompt Guide: /goal and /loop Patterns

Claude loop command patterns for /goal and /loop: goals, verify criteria, turn caps, and paste-ready examples. Text only, no runtime execution.

claude loopclaude codeloop promptsgoal commandverify criteriaturn capsprompt engineering

Generate Claude Code loop commands

Goals, verify criteria, and turn caps — copy-paste text only.

Try Loop Prompt Generator →

Claude loop commands let Claude Code repeat a bounded task until checks pass or a turn cap stops the run. The patterns people call /goal and /loop share one idea: state the outcome, list verifiable checks, and cap iterations so cost and scope stay under control. This guide teaches those patterns as copy-paste text. It does not execute loops. PromptMake at https://promptmake.net/loop-prompt-generator outputs command text only. You paste into Claude Code and run locally. This page complements loop-engineering-explained, which defines goals and verify criteria in the abstract. Here the focus is Claude-specific wording, field order, and examples you can adapt today. Agent Skills stay separate: Skills are reusable SKILL.md packages; loops are one session, one finish line.

What claude loop means in Claude Code

A claude loop is a structured brief the Claude Code runtime reads across multiple agent turns. Each turn may read files, edit code, run shell commands, and report status. The loop stops when verify criteria pass or when the turn cap triggers.

Slash labels vary by Claude Code version. Treat /goal and /loop as patterns, not magic spells. Anthropic release notes rename fields sometimes. The durable parts are goal, verify list, and cap.

Loops are not open-ended autonomy. Without verify lines the agent declares victory after partial work. Without a cap a stuck task burns tokens on repeated failures.

PromptMake generates loop text. It does not bill Anthropic tokens, run tools on your machine, or host a loop runtime. Copy output, open Claude Code, paste, supervise.

The /goal pattern: outcome first

The /goal pattern leads with a falsifiable outcome. A human reviewer who was not in the chat should read the goal and say pass or fail without guessing.

Good goals name scope: directories in bounds, files read-only, behaviors that must not change. They name deliverables: green tests, synced doc section, zero type errors in src/api.

Weak goals invite drift: improve the module, clean up code, make it faster. The agent picks its own definition.

Write one short paragraph. Stack unrelated goals in separate loops with separate caps.

Goal field examples that survive review

"Make npm test pass for packages/web without changing exported component props." Observable. Scoped.

"Update CHANGELOG.md so every commit since v2.4.0 appears under Unreleased with conventional commit prefixes." Deliverable named.

"Remove all TODO comments in src/payments/ and open a summary list of removed items." Scope fenced to one directory.

Goal anti-patterns to delete

"Refactor the entire frontend for best practices." No verify bar. No directory fence.

"Fix bugs." No test named. No file list.

"Improve docs and tests and CI." Three jobs. Split into three loops.

The /loop pattern: verify and cap bundled

The /loop pattern (or equivalent block in your Claude Code version) bundles verify criteria with a turn cap near the goal. Some teams paste one monolithic block; others use separate /goal then /loop sections. Both work when verify and cap are explicit.

Verify criteria are commands or checks the agent can run: test exit codes, grep results, file diffs, linter output. Order cheap checks before expensive ones.

Turn cap is the maximum agent iterations allowed. Typical small fixes start at 8 to 12 turns. Multi-file refactors with tests may need 15 to 20 with narrow per-turn scope.

Add an escalation line: if cap hit, output blocker summary and stop. That line prevents silent burn.

Verify block structure

One imperative line per check: Run, Assert, List, Compare, Grep.

Example sequence: run eslint on src/; run npm test --workspace api; assert no new files under migrations/ without approval.

Include negative checks when regressions are common: do not delete file X; do not bump dependency versions.

Turn cap lines that teams actually use

TURN_CAP: 10 for single-file test fixes.

TURN_CAP: 15 for doc sync across two repos.

TURN_CAP: 20 only when verify is strict and scope is multi-file with tests already present.

Log cap hits. Frequent hits mean verify is too strict, goal is too vague, or cap is too low.

Paste-ready claude loop templates

Templates are starting points. Replace paths, commands, and caps before you run. Save winning blocks in your team doc with project name and date.

Claude Code sessions commonly use Claude Fable 5 for doc-heavy loops, Claude Opus 5 for hard refactors, and Claude Sonnet 5 for balanced speed. Haiku 4.5 suits verify-heavy tight loops with small edits. Model choice is session config, not loop text.

Commit or stash before destructive loops. Git discipline is outside the prompt but inside safe practice.

Template: fix failing unit tests

GOAL: Make jest pass for src/services/user.service.spec.ts without changing public method signatures on UserService.

VERIFY: Run npm test -- user.service.spec.ts; exit code 0. Run eslint src/services/user.service.ts; zero errors.

TURN_CAP: 12. If cap hit, list failing assertions and stop.

Template: sync CLI flags to docs

GOAL: Every flag in bin/cli.ts must appear in docs/cli.md with one example each.

VERIFY: Script or manual diff lists flags in bin/cli.ts minus headings in docs/cli.md; missing list empty.

TURN_CAP: 8. Prefer grep over full rewrites.

Template: type error cleanup

GOAL: Reduce tsc errors in src/ to zero without any any casts in new code.

VERIFY: Run npm run typecheck; exit code 0. Grep src/ for "as any" added in this session; count 0.

TURN_CAP: 15. Scope src/ only; do not edit node_modules or generated paths.

Step-by-step: write your first claude loop block

Pick a task you did manually twice this month. Manual repeat signals a loop candidate.

Step 1: Write the goal as one falsifiable sentence. If a reviewer cannot audit it, rewrite.

Step 2: List verify checks the agent runs without asking you. Prefer shell commands and paths over judgment.

Step 3: Set turn cap from task size. Add escalation on cap hit.

Step 4: Open https://promptmake.net/loop-prompt-generator if you want scaffold wording. Edit paths to match your repo.

Step 5: Paste into Claude Code. Watch the first two turns. Tighten verify order if the agent skips cheap checks.

Step 6: Save the winning block when verify passes under cap.

Drafting from a plain-language brief

Plain brief: "Fix flaky test in checkout.spec.ts, cap 10, verify jest green." Generator expands to GOAL / VERIFY / TURN_CAP ordering consistent with Claude Code habits.

You still must edit repo-specific paths. Generator text is not a substitute for reading your tree.

Supervising the first run

If turn one reads unrelated directories, add directory fences to the goal.

If the agent edits tests to match wrong code, add negative verify: do not weaken assertions.

If cap hits with one failing check, raise cap only after you confirm verify is reachable, not after you hope harder.

Claude loop vs Agent Skills

Agent Skills package reusable expertise in SKILL.md with description triggers and imperative body. Claude loads them when tasks match.

Claude loop blocks are session-scoped. One ticket, one verify bar, one cap. They finish today’s job.

Use a Skill when many tasks share tools and patterns: release checklist, security review, migration playbook.

Use a claude loop when the verify bar is concrete: tests green, doc synced, linter clean.

PromptMake generates Skills config on /skills and loop command text on /loop-prompt-generator. Match the product to reuse horizon.

Do not embed a full Skill inside a loop block. Cross-link in docs instead.

Common claude loop mistakes

Mistake 1: Vague goals without scope fences.

Mistake 2: Verify criteria the agent cannot run, such as ensure UX feels polished.

Mistake 3: Omitting turn cap because the task feels small.

Mistake 4: Mega-loops bundling refactor, tests, docs, and deploy.

Mistake 5: Confusing loop text generation with execution. PromptMake outputs copy-paste commands only.

Mistake 6: Skipping git checkpoint before risky edits.

Mistake 7: Using loops for one-line typos. Human keystrokes are cheaper.

Model and host notes for mid-2026

Claude Code targets Anthropic models including Claude Fable 5, Claude Opus 5, and Claude Sonnet 5. OpenAI Codex-class tools and Cursor agents use different loop metaphors. Principles transfer: goal, verify, cap. Syntax does not.

Gemini 3.1 Pro and GPT-5.6 Sol can draft loop-shaped briefs in chat, but execution stays on your host. Use the loop generator when you want Claude-oriented field order without manual templating.

Guest users on PromptMake get about three generations per day per path. Registered free users get about five. Quotas are separate from /text and /skills paths.

Read Anthropic Claude Code docs when slash spellings change. This guide stays pattern-first so renames hurt less.

When to use PromptMake loop-prompt-generator

Use it when you know the task but not the block shape. Paste a plain brief with goal hints, verify commands, and desired cap.

Use it when onboarding juniors. They learn field order from output before writing from scratch.

Use it when verify lists grow long. The tool keeps ordering consistent.

Do not use it expecting autonomous runs. Copy output, open Claude Code, paste, supervise.

Open https://promptmake.net/loop-prompt-generator after you draft goal and verify on paper. Generate once, edit paths, run locally.

FAQ

What is a claude loop?

A claude loop is a structured Claude Code command pattern that repeats agent turns until verify criteria pass or a turn cap stops the run. It combines a clear goal, checkable verify lines, and a maximum iteration count. The pattern is not open-ended autonomy. Without verify and cap, agents declare victory early or burn tokens on stuck tasks.

What is the difference between /goal and /loop?

Both names appear in Claude Code workflows for bounded iteration. /goal often emphasizes the outcome statement. /loop bundles verify and turn cap with the task. Exact slash spelling varies by version; treat them as one pattern: goal plus verify plus cap.

Does PromptMake run claude loops for me?

No. PromptMake generates loop command text at https://promptmake.net/loop-prompt-generator. You copy the output into Claude Code, which executes agent turns on your machine. PromptMake has no loop runtime.

How is this guide different from loop-engineering-explained?

Loop-engineering-explained defines loop engineering as a design discipline with definitions and mistakes. This claude loop guide focuses on /goal and /loop paste patterns, templates, and Claude Code wording. Read loop-engineering-explained for theory and vocabulary. Stay here when you need copy-paste blocks and field order for today's ticket.

What are good verify criteria for a claude loop?

Good verify criteria are commands or checks the agent can run: test exit codes, eslint output, grep for forbidden strings, diffs against a spec section. Weak criteria ask for subjective quality without a command. Order checks from cheap to expensive. Include negative checks when regressions are common, such as asserting a config file was not deleted.

What turn cap should I start with?

For small fixes, start with 8 to 12 turns. For multi-file refactors with tests, 15 to 20 with narrow scope. Log cap hits and adjust verify before you raise caps. Omitting a cap is not recommended.

Can I use claude loop patterns with GPT-5.6 Sol or Cursor agents?

The goal-verify-cap structure transfers to any agentic coding host. Claude-specific slash labels and field order target Claude Code. Adapt command verbs if you run another tool.

How do I try the loop prompt generator free?

Open https://promptmake.net/loop-prompt-generator. Guests get about three generations per day per path without signup. Registered free accounts get about five per day. Paste your task brief, generate command text, edit repo paths, run in Claude Code.

Ready to generate your own prompts?

Free. No sign-up required. Works with all major AI models.

Related articles