Skip to main content
Reference

Goal Command Reference

The complete reference for /goal subcommands, parameters, state, and behavior

/goal sets a persistent goal for the current session, letting the Agent keep executing autonomously around it. This page lists all subcommands, parameters, and state behavior. For the usage guide to Goal mode, see Working Toward a Goal. Running /goal directly (without a subcommand) is equivalent to /goal status, showing the current goal status.

Subcommands

SubcommandParametersDescription
/goal<description> [--turns <N>]Create or update a goal; without arguments, shows the current goal status. Does not change the permission mode.
/goal statusnoneShow the current goal's description, status, turns used, and time used.
/goal clearnoneRemove the current goal.
/goal pausenonePause the current goal.
/goal resumenoneResume a paused goal.

/goal parameters

/goal <description> [--turns <N>]
  • <description> (optional): a natural-language description of the goal. Omitting it shows the current goal status (equivalent to /goal status).
  • --turns <N> (optional): the maximum number of interaction turns. N must be a positive integer; invalid values are ignored. When the limit is reached, the goal pauses automatically and can be continued with /goal resume.
Examples:
/goal Fix all failing unit tests and commit
/goal Finish the login module refactor --turns 20

State fields

Goal state is persisted and includes the following fields:
FieldDescription
idThe goal's unique identifier.
objectiveThe goal description.
statusStatus: active / paused / complete.
maxTurnsThe maximum turn limit (optional).
turnsUsedTurns used.
timeUsedSecondsTime used (seconds).
createdAt / updatedAtCreation and last-update timestamps.
planWasActiveWhether Plan mode was active before the goal was activated (used to restore after resume).

Key behaviors

  • Permission mode is independent: Goal never changes the permission mode; tool approvals during execution follow the current mode. For uninterrupted execution, switch to auto or yolo beforehand.
  • Cross-session persistence: goals persist with the session. If the process is terminated unexpectedly while a goal is active, the next launch automatically downgrades it to paused, and it can be reactivated with /goal resume.
  • Plan state restoration: if Plan mode was active before the goal, /goal resume also restores the Plan state after a process restart.
  • Turn limit: when turnsUsed reaches maxTurns, the goal pauses automatically (a built-in default limit applies when --turns is not set). Resuming with /goal resume grants a fresh turn budget to continue.

Next steps