Skip to content

[FEATURE]: Add Codex / Claude Code style /goal autonomous loop command #49205

Closed as duplicate

Description

@lorenzozanee

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Request a native /goal command for opencode with the same semantics as OpenAI Codex and Claude Code, for long-horizon autonomous work.

Reference behavior:

  1. Codex /goal (experimental, goals = true under [features]):
  • /goal <objective> sets one durable objective, /goal shows status, /goal pause / /goal resume / /goal clear controls the run.
  • Stays active across turns for multiple hours until achieved, paused/cleared, blocked, or budget-limited (pursuing, paused, achieved, unmet, budget-limited).
  • Intended for code migration, large refactors, prototypes where the contract defines objective, non-goals, validation commands, and stop condition.
  • Docs: https://developers.openai.com/codex/use-cases/follow-goals
  1. Claude Code /goal (native since v2.1.139):
  • /goal <condition> / /goal / /goal clear (aliases: stop, off, reset, none, cancel). One goal per session, ◎ /goal active indicator, restored on --continue / --resume, cleared on /clear.
  • After each turn a small fast model (Haiku by default) judges the condition against the conversation transcript only (no independent tool calls). Not yet met -> continue with reason as guidance; Met -> clear + achieved entry; Impossible -> clear + failed entry.
  • Does not change permission mode; use auto-accept for unattended runs. Works in interactive, -p, and remote control.
  • Docs: https://code.claude.com/docs/en/goal , https://code.claude.com/docs/en/commands

Current gap in opencode:

Today a 200-file migration or full test-suite fix requires typing "keep going" every few minutes. Custom slash-command templates cannot do persistence, runtime continuation after turn end, token/time accounting, evaluator loop, or TUI/desktop status sync.

I am aware of #27167 (native session goals, open, 200+ reactions). This request explicitly asks for parity with the Codex/Claude evaluator-loop semantics above, not just goal text storage:

  • /goal <objective> / /goal / /goal pause / /goal resume / /goal clear
  • session-scoped single active goal with status projection (turns elapsed, tokens spent, last evaluator reason)
  • per-turn evaluator using a configurable small/fast model against transcript, with met / not-yet-met / impossible handling
  • idle continuation in TUI + opencode run non-interactive parity, human input always wins, /clear clears goal
  • optional per-goal token budget + wall-clock cap and budget-limited state (cf. Codex token_budget discussion)
  • model-visible goal tools with restricted mutation (complete only after verification), shared server API so TUI/desktop stay in sync

Benefits:

  • Removes the human-enter bottleneck for long runs.
  • Verifiable "done" contract instead of model claiming done.
  • Competitive parity: users coming from Codex / Claude Code expect /goal to work the same way.

Activity

  1. github-actions commented on Sep 15, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • [FEATURE]: Add native session goals with /goal #27167: Native session goals with /goal — covers the same feature including persistent goal per session, /goal command variants (set/status/pause/resume/clear), server API for TUI/desktop sync, token budgets, runtime continuation, and model-visible goal tools with restricted mutation semantics. The scope described there appears to encompass the evaluator-loop semantics requested here as well.

    If you believe this request adds something meaningfully distinct from #27167, please clarify in a comment there rather than opening a new issue, so discussion stays consolidated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions