Skip to content

Add the /goal command #326

@allquixotic

Description

@allquixotic

Is your feature request related to a problem? Please describe.
Claude Code and Codex have recently introduced /goal. This is, finally, the surfacing of the "Ralph loop" concept from last year, into these mainstream tools. It's time for Zoo Code to follow suit.

Describe the solution you'd like
Zoo Code should support /goal similar to how Codex desktop GUI does it (imo the GUI driven mode with feedback is better).

Describe alternatives you've considered
There are many alternatives but they don't integrate natively with Zoo Code.

Additional context
In Codex CLI at https://github.com/openai/codex (Apache 2.0 license; the same as Zoo Code) -- we can probably infer an overall design from this...

  • The feature is gated by Feature::Goals. Sets/views/manages long-running task objective per thread.
  • Command surface: Enum variant + metadata: codex-rs/tui/src/slash_command.rs:38
  • Description: "set or view the goal for a long-running task" (:116)
  • supports_inline_args (:153) — accepts /goal
  • available_during_task (:213) — usable mid-run

Dispatch (subcommands)

  • codex-rs/tui/src/chatwidget/slash_dispatch.rs:
  • Bare /goal → :228-242 fires AppEvent::OpenThreadGoalMenu
  • /goal parsed at :653-749. Recognized literals:
  • clear → ClearThreadGoal
  • edit → OpenThreadGoalEditor
  • pause → status = Paused
  • resume → status = Active
  • anything else → objective text → SetThreadGoalObjective (with ConfirmIfExists mode)
  • Empty objective rejected with GOAL_USAGE hint (:35)
  • Pre-session: objective queued via QueuedInputAction::ParseSlash

UI layer

App-server protocol

TUI -> app-server transport:

Core domain + persistence

Model-facing tools (separate from slash command)

Three function tools the model calls to interact with goal state:

Goal extension (token-budget + steering)

  • codex-rs/ext/goal/ — pluggable extension wired through codex_extension_api. Tracks token spend per goal, injects steering items when budget exceeded, emits lifecycle events.
  • Entry: extension.rs
  • Tool spec: tool.rs, spec.rs
  • Budget logic: accounting.rs
    Steering injection: steering.rs
    Event emitter: events.rs
    Flow summary
    User types /goal → TUI parses in slash_dispatch → emits AppEvent::SetThreadGoalObjective → app layer (thread_goal_actions.rs) calls app-server via v2/thread protocol → thread_goal_processor mutates state via state/runtime/goals.rs → broadcasts ThreadGoalUpdatedNotification → goal extension picks it up, hooks turn lifecycle, injects steering when over budget → goal_status badge re-renders in TUI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions