Skip to main content
Task Automation

Continuously Achieve Goals

Overview

Goal is an autonomous execution mode in Qoder CLI. It is best suited for scenarios where you have a clear completion condition and want Qoder to work continuously until it is achieved. Once a goal is set, Qoder breaks it down into steps and executes them continuously, minimizing interruptions until the goal is completed or you manually stop it. Goal is ideal for tasks with clear endpoints, such as "fixing all failing tests," "completing a refactoring until the build passes," or "implementing a feature according to requirements and passing self-tests."

Setting a Goal

In an interactive session, use /goal set to create a goal:
/goal set <goal description>
For example:
/goal set Fix all failing unit tests until all npm tests pass
After setting a goal:
  • Qoder will start working continuously towards the goal, breaking it down into multiple steps if necessary.
  • The permission mode will automatically switch to auto and lock the Shift+Tab toggle to minimize confirmation interruptions during execution. The previous permission mode is recorded and automatically restored when you clear or pause the goal.
  • The interface will display a goal status indicator.

Limiting Maximum Turns

Use the --turns parameter to limit the maximum number of conversation turns for goal execution. Once the limit is reached, Qoder will stop and wait for your instructions:
/goal set Refactor the payment module and ensure tests pass --turns 30
The value of --turns must be a positive integer; otherwise, the parameter will be ignored.

Checking Goal Status

Use /goal status to check the progress of the current goal:
/goal status
It displays:
  • Goal: The goal description.
  • Status: Active, Paused, or TurnLimited.
  • Turns: The number of turns used. If a limit is set, it is displayed as "used / limit".
  • Time: The time consumed by the goal.
A goal is automatically cleared upon completion. Running /goal status afterward will prompt that there is no active goal. If the goal is held by another session, the status will indicate this, and you can use /goal take to take over.

Pausing and Resuming

When you need to temporarily interrupt the goal to handle something else, use /goal pause to pause:
/goal pause
When paused, Qoder reverts to the permission mode used before the goal was set. Use /goal resume to continue later:
/goal resume
Upon resuming, Qoder re-enters the autonomous execution state and continues working towards the goal. If the goal was in the Plan state before pausing, it will also be restored to that state.

Taking Over a Goal

Goals can be persisted across sessions. If a goal was created and is held by another session, the current session cannot directly update it by default. Use /goal take to claim ownership of the goal for the current session:
/goal take
After taking over, the current session becomes the holder of the goal and can continue to advance and update it.

Clearing a Goal

When a goal is completed or you no longer need it, use /goal clear to clear it:
/goal clear
When clearing a goal, Qoder reverts to the permission mode used before the goal was set.
When Qoder determines that the goal has been achieved, it will also automatically mark the goal as completed and clear it, without requiring manual intervention.

Working with Plan

Goal can be used in conjunction with Plan: use Plan first to analyze the problem and confirm the approach, then enter Goal to let Qoder execute autonomously until completion. If Plan is active before entering Goal, Qoder will re-enter the Plan state when resuming the goal, maintaining a consistent workflow. For detailed information on Plan, see Plan Before Execution (Plan).

Command Summary

CommandDescription
/goal set <描述> [--turns <n>]Create or update a goal, with an optional limit on maximum turns
/goal statusView the current goal status
/goal pausePause the current goal
/goal resumeResume a paused goal
/goal takeTake over goal ownership for the current session
/goal clearClear the current goal
For complete command parameter descriptions, see Goal Command Reference.