Claude /goal

Posted on Friday, July 3, 2026


 


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:
- Add new tasks with title, priority (low/medium/high), and due date
- Display tasks in a clean list with checkboxes to mark complete
- Filter tasks (All / Active / Completed)
- Delete tasks
- Dark / Light mode toggle
- Data persists using localStorage
- Make it look modern and responsive
- Create a README.md with project description and how to run it

 

 

 



 


 

Much fancier but it only took 1 turn to get done…

Maybe I should dumb it down and try it?

 

 > /clear
 > /model claude-sonnet-5


 

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:
- Add new tasks with title, priority (low/medium/high), and due date
- Display tasks in a clean list with checkboxes to mark complete
- Filter tasks (All / Active / Completed)
- Delete tasks
- Dark / Light mode toggle
- Data persists using localStorage
- Make it look modern and responsive
- Create a README.md with project description and how to run it

 

 


Still just one turn


Maybe dumb it down more…

 

 > /clear
 > /model claude-haiku-4-5


 

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:
- Add new tasks with title, priority (low/medium/high), and due date
- Display tasks in a clean list with checkboxes to mark complete
- Filter tasks (All / Active / Completed)
- Delete tasks
- Dark / Light mode toggle
- Data persists using localStorage
- Make it look modern and responsive
- Create a README.md with project description and how to run it

 

 



Still 1 turn

Let me try a harder one…

Back to 4.8

 

 > /clear
 > /model claude-opus-4-8


 

 

 > /goal Create a fully functional "Movie Watchlist" web app with these requirements:
- Use a single index.html file with Tailwind CSS via CDN
- Search for movies using the free public TMDB API (include a working search bar)
- Display search results as cards with poster, title, year, and rating
- Allow adding movies to a personal watchlist
- Show separate "Watchlist" and "Search Results" sections
- Persist the watchlist using localStorage
- Add remove from watchlist and mark as "Watched" functionality
- Include dark/light mode toggle
- Make it look modern, responsive, and polished
- Create a detailed README.md with setup instructions and API notes
- Test that adding, removing, and searching all work correctly

 

 


 

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