Most agent sessions end for a surprisingly weak reason: the model answered once.
That is fine for “explain this function.” It is not fine for “make the checkout suite pass,” “finish this migration,” or “trace this production bug until the cause is proved.” Those are outcomes, not prompts. They often need several turns of investigation, implementation, testing, and correction.
Aii CLI now has a primitive for that difference: goals.
One objective, one continuing conversation
Inside an interactive Aii session, set a goal like this:
/goal Make the checkout suite pass, verified by `npm test -w checkout`,
without changing the public APIThe goal becomes part of the session. When one turn ends but the objective is still open, Aii can continue from the same conversation instead of waiting for another “keep going.” It retains what it learned, what it changed, and what still needs proof.
That makes a goal different from /loop:
- A loop repeats a fixed prompt with fresh context each iteration.
- A goal keeps one conversation converging on an outcome.
Use a loop for repetitive batch work. Use a goal when the path depends on what the agent discovers along the way.
Completion needs evidence
The useful part is not that the agent can continue. It is that continuation has a finish line.
Add one or more verification commands and Aii will not accept completion until they pass:
/goal edit --verify "npm test -w checkout" --verify "npm run typecheck"If a check fails, its failure comes back into the conversation and the agent gets another chance to fix the actual problem. A polished paragraph claiming success is not enough.
You can inspect the contract at any time with /goal: objective, status, verification, limits, and usage are all visible. In a local Aii Server session, /goal draft <plain description> asks the model to propose a stronger contract for you to edit before the run begins.
Long-running does not mean unbounded
By default, Aii auto-approves mutating tools on goal-driven continuation turns within the declared workspace; your own prompts keep their normal approval posture. A goal does not widen the workspace or override an explicit denial. If you want per-tool prompts on goal turns too, add --no-auto when setting the goal, or use /goal edit --no-auto afterward.
You also control the budget:
/goal edit --max-time 2h --max-tokens 500000
/goal pause
/goal resumeYou can set time, token, spend, and auto-turn limits; a goal otherwise continues until it is achieved or paused. Errors pause loudly instead of sending the agent into a hidden retry spiral. You can redirect an active run with /note, pause it with Escape, or clear it entirely.
Leave, come back, keep the goal
The goal is stored with the session, not trapped in the current terminal screen. Aii shows the session's short ID on the goal card, status bar, and exit summary.
aii goals
aii --continue
aii --continue <full-session-id>aii goals lists the goals saved for the current project. --continue restores the latest conversation, or a specific one by its full session ID, with the goal intact. Paused goals receive a longer retention window so an unfinished objective is not silently cleaned up as an ordinary old session.
The agent that finishes the job
Planning made an agent's intended steps visible. Goals make the desired result durable.
That changes the working relationship. You no longer have to supervise the boundary between every turn. State the outcome, define how to prove it, choose the limits, and let the conversation keep moving until the work is actually complete—or until it honestly tells you why it cannot be.
Install or update Aii CLI:
npm i -g @aiiware/aiiThen start aii and set a goal with /goal <objective> for the next job that is too large for a single answer.
Aii is the AI assistant for everything—terminal, editor, and browser. Goals are available in Aii CLI.