Back to blog
Workflow
Opencode

How do you keep coding agents on task without babysitting every step?

Thắng Đoàn
Thắng Đoàn

When an agent drifts off objective, you pay the hidden cost of re-reading a wandered session and steering every turn by hand. opencode's /goal command keeps a session working toward a stated objective until a reviewer confirms it is met, with pause, resume, and clear controls.

What it is

/goal <objective> runs in the TUI or Desktop and keeps the session going until a reviewer confirms the objective is done. You steer it with /goal pause, /goal resume, and /goal clear.

Applied case

A developer kicks off a refactoring objective with /goal in the TUI and stops watching every turn. When they need to step away or reprioritize, /goal pause halts the loop and /goal resume picks it back up. Once the reviewer confirms the objective is met, /goal clear ends the goal and the session settles into normal use.

  • Use /goal pause and resume to control long-running sessions without killing the session

What it does not solve

The loop ends only when a reviewer confirms the objective, so it does not remove the human review step or verify quality automatically. The release notes do not describe guardrails against an agent working toward the wrong objective if the goal is stated poorly.

When to use it

Use when you want a session to persist on one objective until a reviewer signs off. Skip when the task is a one-shot question with no review loop.

Read more

opencode v2.2.1 release

PR 59437: goal command

Share:

Recommended for you

Enjoyed this article?

Subscribe for new articles. No spam. Unsubscribe anytime.

By subscribing you agree to receive the newsletter. No spam, and you can unsubscribe anytime.