[FEATURE] Add /goal command for persistent thread-level objectives (parity with Codex CLI 0.128.0)

Resolved 💬 1 comment Opened May 4, 2026 by yaojin17 Closed May 17, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Claude Code currently lacks a first-class primitive for persistent, long-horizon objectives. When I want Claude to keep working toward a durable engineering outcome (e.g. "migrate this package from API v1 to v2 until all tests pass"), I have to either:

  1. Babysit each turn and re-prompt manually.
  2. Use the Ralph Wiggum plugin (/ralph-loop), which is session-scoped, has no pause/resume/clear lifecycle, and is lost when the session ends.
  3. Wrap claude in an external while loop with hand-rolled state in markdown files (e.g. continuous-claude).

None of these provide thread-level persistence, autonomous continuation, or a state machine the user can inspect and control.

OpenAI's Codex CLI shipped this in v0.128.0 as /goal, with pursuing | paused | achieved | unmet | budget-limited states, persistence in the thread store (survives session restarts), and a token budget to bound cost. Their implementation lives in codex-rs/state/src/runtime/goals.rs. This has become a notable capability gap between the two agents for long-running workflows like migrations, refactors, test-coverage drives, and multi-step bug hunts.

Proposed Solution

Add a /goal slash command with the following surface:

  • /goal <objective> — create or replace the active goal for the current thread, optionally with success criteria
  • /goal pause / /goal resume — pause and resume the goal without losing progress
  • /goal clear — clear the active goal
  • /goal (no args) — show current goal, state, and budget consumption

Underlying behavior:

  • Goals are persisted at the thread level (survive /resume, terminal close, and context compaction).
  • A configurable token or wall-clock budget bounds runaway cost.
  • A runtime continuation loop re-triggers the agent while the goal is pursuing and not blocked, without requiring the user to type a follow-up each turn.
  • A set_goal / update_goal model tool so the agent can reason about its own objective explicitly rather than only via prompt context.
  • TUI surface showing active goal + state in the status line.

Alternative Solutions

Ralph Wiggum plugin — closest existing primitive, but session-scoped, no lifecycle controls, no thread persistence, and depends on a model-emitted sentinel string for completion. Good for short bursts, not for true long-horizon work.

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗