Skip to main content
Task automation

Working Toward a Goal

Overview

Goal is one of Qoder CLI CN's autonomous execution styles. When you have a clear completion condition and want Qoder to keep working until it is met, Goal is the best fit. After you set a goal, Qoder breaks it into steps and keeps executing with minimal interruptions, until the goal is achieved or you stop it. Goal suits tasks with a clear finish line, like "get all the tests green," "finish a refactor until the build passes," or "implement a feature per the requirements and verify it."

Setting a goal

In an interactive session, create a goal with /goal:
/goal <goal description>
For example:
/goal Fix all failing unit tests until npm test passes completely
After setting a goal:
  • Qoder starts working continuously toward the goal, breaking it into multiple steps when necessary.
  • The goal does not change your permission mode; tool approvals during execution follow the current mode. For uninterrupted execution, switch to auto or yolo beforehand.
  • The interface shows a goal status indicator.

Limiting the maximum turns

Use the --turns parameter to limit the maximum number of conversation turns for the goal. When the limit is reached, the goal pauses automatically and waits for your instruction; use /goal resume to continue:
/goal Refactor the payment module and keep the tests passing --turns 30
The value of --turns must be a positive integer; otherwise the parameter is ignored.

Checking goal status

Use /goal status to see the current goal's progress:
/goal status
It shows:
  • Goal: the goal description.
  • Status: Active (in progress) or Paused (paused, including the automatic pause after reaching the turn limit).
  • Turns: turns used; shown as "used / limit" if a limit is set.
  • Time: time spent on the goal.
When a goal is completed it is cleared automatically; running /goal status afterward reports that there is no active goal.

Pausing and resuming

When you need to interrupt the goal temporarily to handle something else, pause it with /goal pause:
/goal pause
While paused, the goal loop is stopped and your permission mode is unaffected. Continue later with /goal resume:
/goal resume
On resume, Qoder continues working toward the goal. If the goal was in the Plan state before pausing, that is restored on resume as well.

Clearing a goal

When a goal is done, or you no longer need it, clear it with /goal clear:
/goal clear
When Qoder judges that the goal has been achieved, it also marks the goal complete and clears it automatically — no manual clearing needed.

Pairing with Plan

Goal works well with Plan: analyze the problem and confirm the approach with Plan first, then enter Goal and let Qoder execute autonomously to completion. If Plan was active before entering Goal, Qoder re-enters the Plan state when resuming the goal, keeping the way of working consistent. For details on Plan, see Plan Before Executing.

Command cheat sheet

CommandPurpose
/goal <description> [--turns <n>]Create or update a goal, optionally limiting maximum turns
/goal statusCheck the current goal's status
/goal pausePause the current goal
/goal resumeResume a paused goal
/goal clearClear the current goal
For the full command and parameter reference, see Goal Command Reference.