In Claude code there is a special command called /goal. What does it do? It enables autonomous, multi-turn work.
What does that mean? Let’s explore….
Researching /goal
First for the
documentation. You can find the Claude
Code /goal documentation at https://code.claude.com/docs/en/goal [1]
Rather than setting a
command you set a goal. Claude will
attempt to reach this goal. After each
turn a small fast model checks to see if the goal is met, it not Claude starts
another turn, instead of returning to you.
The goal clears when the condition is met.
- Only one /goal can be active per session.
- While the goal is active an indicator on screen shows its active
- After each run it returns why the goal is or isn’t met
- To stop it run /goal clear
- To see which turn and tokens spent thus far run /goal
So what is the difference between just a prompt and a /goal?
Example 1:
Prompt
|
> Fix the bug in the login function |
/goal
|
> /goal The login function works
correctly and all tests pass. |
Example 1:
Prompt
|
> Add a button that says
"Save" to the form. |
/goal
|
> /goal The form has a working
"Save" button that saves the data when clicked. |
Demo
OK now for a demo
|
> /goal Create a simple HTML file called
index.html with a heading "Hello World", a paragraph, and a button
that shows an alert "Hello from Claude!" when clicked. Also create
a basic README.md that explains the project. |
You can see its active
and how long it has been running
It did require one interaction
And it completed
And it made this very simple web page.
More Complex Demo
How about something a little more complex
|
> /goal Build a complete "Task
Manager" web app in a single index.html file using HTML, CSS, and
JavaScript with these features: |
Much fancier but it only took 1 turn to get done…
Maybe I should dumb it down and try it?
|
> /clear
|
And try it again
|
> /goal Build a complete "Task
Manager" web app in a single index.html file using HTML, CSS, and
JavaScript with these features: |
Still just one turn
Maybe dumb it down more…
|
> /clear
|
And try it again
|
> /goal Build a complete "Task
Manager" web app in a single index.html file using HTML, CSS, and
JavaScript with these features: |
Still 1 turn
Let me try a harder one…
Back to 4.8
|
> /clear
|
|
> /goal Create a fully functional
"Movie Watchlist" web app with these requirements: |
Still 1 shotted
Final Thoughts
This is a good way to go in Claude. Define what done means and let Claude do the
rest.
This tool is fairly new in Claude it came out in v2.1.139,
which came out on May 11, 2026.
References
[1] Claude Code:
/goal
https://code.claude.com/docs/en/goal
Accessed 07/2026
No comments:
Post a Comment