| [ Web Proxy ] |
| Viewing: https://commandcode.ai/docs/goal | [Back] [Original] |
The /goal slash command gives Command Code a standing objective to work toward across many turns, instead of a single request. Once you set a goal, Command Code starts working immediately and keeps going, step after step, until the objective is genuinely met and an independent check confirms it from the evidence.
Use it for end-to-end work you'd otherwise drive turn by turn: "get the test suite green", "migrate this module to the new API", "ship the release".
/goal <objective> # Set an objective and start working toward it
/goal status # Output the current goal status
/goal clear # Stop and clear the active goal
A goal persists with your session. It shows up in your session list and is restored when you reopen the conversation with --resume. On resume its loop is not running. An unfinished goal shows as idle; restart it with /goal <objective>.
A goal runs with a budget of model turns so an autonomous loop can't run indefinitely and use up all available credits.
| Setting | Value |
|---|---|
| Default budget | 100 turns |
| Maximum budget | 1000 turns |
| Override at launch | --max-turns <number> |
Pass --max-turns when you start Command Code to raise or lower the budget for goals set this session. Values are clamped to the 1000 turn ceiling.
If the budget runs out before the objective is met, the goal pauses rather than stopping silently. Run /goal <objective> again to start a fresh attempt.
Run /goal or /goal status at any time to see where a goal stands:
| State | Example headline | Meaning |
|---|---|---|
| Active | Goal active turn 7/100 2m | The loop is running; shows the in-flight turn, budget, and elapsed time. |
| Achieved | Goal achieved 4m 9 turns | The objective was completed and verified. |
| Paused | Goal paused out of turns | The turn budget was exhausted before completion. |
| Paused | Goal paused couldn't verify completion | Completion claims were repeatedly rejected by the check. |
| Idle | Goal idle turn 7/100 2m | A goal exists (e.g. after --resume) but the loop isn't running. |
While a goal is active, the status line also surfaces the latest verification result when a completion claim was turned down.
Run /goal clear to stop and remove the active goal:
Goal cleared finishing current step). You can also press Ctrl + C to interrupt and clear the goal.Unlike setting a goal, /goal status and /goal clear both work mid-turn.
/goal get the entire test suite passing
Command Code starts working immediately, runs and re-runs the tests, fixes failures, and only declares the goal complete once the suite passes and the evidence is verified.
cmd --max-turns 20
/goal remove all unused exports in src/
The goal runs for at most 20 turns before pausing.
/loop| Web Proxy Viewer | New URL | Original Page |