claude-code - 💡(How to fix) Fix [FEATURE] Add /goal command for persistent thread-level objectives (parity with Codex CLI 0.128.0) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56085Fetched 2026-05-05 05:58:36
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • 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

extent analysis

TL;DR

Implement a /goal slash command with persistence, pause/resume functionality, and a configurable budget to support long-horizon objectives in Claude Code.

Guidance

  • Introduce a new /goal command with subcommands for creating, pausing, resuming, and clearing goals, as well as displaying the current goal state.
  • Implement thread-level persistence for goals to survive session restarts and context compaction.
  • Develop a runtime continuation loop to re-trigger the agent while a goal is being pursued, without requiring user input.
  • Create a set_goal/update_goal model tool to enable the agent to reason about its objective explicitly.

Example

/g goal migrate package from API v1 to v2 until all tests pass
/g goal pause
/g goal resume
/g goal clear

Note: This example assumes the proposed /goal command surface and underlying behavior.

Notes

The implementation details, such as the specific code changes and storage mechanisms, are not provided in the issue. The solution will require careful consideration of the existing codebase and architecture.

Recommendation

Apply the proposed solution by implementing the /goal command and its underlying functionality, as it addresses the significant productivity impact and provides a clear path forward for supporting long-horizon objectives in Claude Code.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] Add /goal command for persistent thread-level objectives (parity with Codex CLI 0.128.0) [1 participants]