Freeive

claude-code·Published 2026.06.01·Views 1

Asked Once but It Didn't Finish? Make It Work "On Its Own Until Done" with /goal

/goal makes Claude repeat work on its own across multiple turns until a condition is met. Learn how to auto-fix until tests pass and how to clear the goal.

Have you ever told Claude "make the tests pass," only for it to fix things once and stop? You probably had to sit by, repeating "it failed again," "try once more." It would be nice if, once told, it kept working on its own until done. That is exactly /goal. Set just one condition, and it keeps working on its own until that condition is met.

Definition

/goal is a command that sets a goal of "keep working until this condition is met." Normally Claude responds once and stops, but when you set /goal, it repeats on its own across multiple turns until the condition is satisfied.

Put simply, you define the end point and hand it off, like "fix it on your own until all the tests pass." There is no need for a human to type "again," "more" every time.

How to Use (by difficulty)

Basics — Setting a Goal

Type the condition into the chat box.

/goal 테스트가 모두 통과할 때까지

Once you enter it, Claude starts the work, and if a single attempt does not succeed, it looks at the result and fixes it again on its own. On screen, attempt → fail → fix → retry repeats and the progress scrolls by. When the condition is met, it stops and wraps up with a message like "Goal achieved."

Advanced — Clearing the Goal

/goal clear

When the work drags on too long, or it gets stuck circling the same spot, use this to cancel the active goal. Once you enter it, the goal in progress is released, and you return to the usual state of conversing one turn at a time.

Common Pitfall — It Can Loop Forever When Stuck

Because /goal keeps trying until the condition is met, setting a condition that cannot be solved in the first place can make it circle the same spot endlessly. For example, if you set "until it passes" for a test that can never pass because an external server is down, Claude retries endlessly.

So remember two things.

  • Set a condition that can be finished. Clear, reachable goals like "tests pass" or "build succeeds" are good.
  • If something seems off, stop with /goal clear. If there is no progress and the same failure repeats, it is faster to release it right away and look into it yourself.

Real-World Example

When 3 of 10 tests broke after a refactor, instead of typing "fix this," "this too" one by one, I set it like this.

/goal 테스트가 모두 통과할 때까지

After that, I could step away. Claude looked at the failing tests, fixed the code, ran it again, and when it failed again, fixed it a different way, repeating until everything finally turned green. The task of sitting by typing "again" 30 times was done in one line.

Using It Further

  • The "until X" pattern: Clearly write the end condition, like "until lint errors are zero" or "until the build succeeds."
  • Ideal for automatic iterative fixing: It fixes and tries again on its own without a human giving retry commands one by one.
  • Release when stuck: You can stop anytime with /goal clear, so set it without worry and release it if something seems off.
  • A habit for iterative work: For work that "probably will not finish in one go," setting a goal from the start saves effort.

Tip: For your first use, try setting it on work with a clear outcome, like "until the tests pass." Seeing the AI look at its own failures and fix them again firsthand gives you a feel for which tasks benefit from setting a goal.

Summary

The core fits in one sentence. For "do it on your own until done," set a /goal. The work where you asked once and kept repeating "again" from the side is filled in by Claude on its own once you define the end condition. Just remember: an unsolvable condition loops forever, so set a goal that can be finished, and if something seems off, stop with /goal clear.

Based on: Claude Code v2.1.154 (2026.05)

#ClaudeCode#goal#automation#AI-coding#vibe-coding#developer

Comments

Comments 0

Checking sign-in status…

Loading comments…

Recent

More notes.