Work Towards an Objective With /goal
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".
Basic usage
- You set an objective: Command Code pursues the goal step by step, working from fresh context, built up from the filesystem, command output, and test results.
- It works across turns: Each model round-trip (one step in the agent's loop) counts as one turn against the goal's budget.
- It signals completion only when done: When the agent believes every part of the objective is satisfied, it ends its turn with a completion marker and states the evidence (files changed, commands run, tests passing).
- An independent check verifies the claim: A separate completion check inspects the evidence and rejects unproven or partial claims. If the claim is rejected, Command Code keeps working to close the specific gap rather than declaring victory.
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 | 500 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 500 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:
- If nothing is running, the goal is cleared immediately.
- If a turn is in flight, Command Code finishes the current step and then stops (
Goal cleared 路 finishing current step). You can also pressCtrl + Cto interrupt and clear the goal.
Unlike setting a goal, /goal status and /goal clear both work mid-turn.
Set a goal and let it run
Set a goal
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.
Run with a smaller budget
Lower the budget
The goal runs for at most 20 turns before pausing.
- Switch to Auto-Accept Mode so a goal can run unattended
- Use checkpoints to rewind a goal run
- Join our Discord community for feedback, requests, and support.