# /goal Command

> It keeps Claude working until a goal you set is met.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** /goal, Completion condition, /goal clear

## Think of it like

It is like a race with a finish line. You keep going until you cross it.

## Definition

/goal sets a finish line for the session, and Claude keeps working turn after turn until it is reached. After each turn, a separate model checks whether the goal holds. If not, Claude starts another turn instead of handing back to you. The goal ends when it is met, when the checker thinks it cannot be met, when an error needs you, or when you run /goal clear. A session has one goal at a time.

## Example

Lucy moves a module to a new API. She sets /goal every call site builds and the tests pass, then goes to a meeting. Claude works through four turns and stops when both are true.

## Example code

```console
/goal all tests in test/auth pass and lint is clean
```

Keep going until the tests pass and lint is clean.

## Why it matters

A long task no longer stops each turn to wait for you to say keep going.

## Common mistake

Setting a goal no one can check, such as make the code better. The checker needs an end you can test, like tests that pass.

## Three principles

- **A finish line.** You set it.
- **Checked each turn.** By a separate model.
- **Ends on its own.** Or with /goal clear.

## Related terms

- [Auto Mode](https://learn.benibix.com/term/ai/auto-mode)
- [Cron Tools](https://learn.benibix.com/term/ai/cron-tools)
- [Non-Interactive Mode](https://learn.benibix.com/term/ai/non-interactive-mode)
- [/batch Command](https://learn.benibix.com/term/ai/batch-command)
- [Hermes Persistent Goals](https://learn.benibix.com/term/ai/hermes-goals)

## Taught in

- [Models, Goals and Folders](https://learn.benibix.com/learn/ai-claude-code-commands/models-goals-and-folders): Claude Code Commands, 6/17

![A loop: Claude takes a turn, a separate model checks the goal, and if it is not met yet, Claude takes another turn. When it is met, the loop stops.](https://learn.benibix.com/diagrams/cmd-goal.svg)

---

Source: https://learn.benibix.com/term/ai/goal-command
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
