How do you keep coding agents on task without babysitting every step?
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
Recommended for you
- WorkflowHerdr
How do you supervise coding agents without watching every window?
I run Claude and opencode side by side in one terminal. Three herdr habits replaced window-polling with state-waiting: persistent sessions, the agent loop, a setup script.
- WorkflowSuperpowersClaude Code
Why does your multi-agent workflow keep colliding?
Two agents in two threads share files but not context. Both decide on stale state. Fix: one fresh agent per task, with isolated context.
- WorkflowSuperpowersClaude Code
What makes agent output trustworthy when the model is not the problem?
The reliability problem is not the model. It is the missing disciplines around it. Brainstorm, plan, test, verify, review: each gate before the next step.
- WorkflowSuperpowersClaude Code
Why does your agent forget step 5 by step 12?
A ten-task plan drifts by task four. The model is not forgetful. The plan is too coarse. Fix: smaller tasks with sharper edges.
Enjoyed this article?
Subscribe for new articles. No spam. Unsubscribe anytime.