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

/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

  1. 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.
  2. It works across turns: Each model round-trip (one step in the agent's loop) counts as one turn against the goal's budget.
  3. 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).
  4. 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.
Info

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.

SettingValue
Default budget100 turns
Maximum budget500 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:

StateExample headlineMeaning
ActiveGoal active 路 turn 7/100 路 2mThe loop is running; shows the in-flight turn, budget, and elapsed time.
AchievedGoal achieved 路 4m 路 9 turnsThe objective was completed and verified.
PausedGoal paused 路 out of turnsThe turn budget was exhausted before completion.
PausedGoal paused 路 couldn't verify completionCompletion claims were repeatedly rejected by the check.
IdleGoal idle 路 turn 7/100 路 2mA 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 press Ctrl + C to 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

/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.

Run with a smaller budget

Lower the budget

cmd --max-turns 20 /goal remove all unused exports in src/

The goal runs for at most 20 turns before pausing.