Claude Code /goal Command: Set Completion Conditions and Let Claude Run Autonomously

Claude Code

Claude Code v2.1.139 introduced the /goal command, allowing users to define a specific completion condition and have Claude continue working autonomously across multiple turns until that condition is met. A live overlay panel tracks elapsed time, turn count, and token usage throughout the run, giving users visibility without requiring intervention. The command works in interactive mode, --print (-p) flag mode, and Remote Control.


Claude Code /goal: Define Done, Then Let Go

Claude Code v2.1.139, released on May 11, 2026, adds the /goal command β€” a new way to hand off a task to Claude with a clearly defined finish line. Instead of supervising each turn or manually re-prompting when Claude pauses, users set a natural-language completion condition and Claude continues running autonomously until that condition is satisfied.

How /goal Works

After entering /goal and describing the desired end state β€” for example, "all failing tests pass" or "the feature branch is merged and CI is green" β€” Claude Code takes over. It works through as many turns as needed, making decisions and executing actions, while a live overlay panel remains visible in the terminal showing:

  • Elapsed time since the goal was set
  • Turn count β€” how many back-and-forth exchanges have occurred
  • Token usage β€” a running tally of context consumed

This overlay gives users a lightweight view of progress without requiring them to track the session manually.

Where It Works

The /goal command is compatible across all three major Claude Code execution modes:

  • Interactive mode β€” standard terminal sessions
  • -p / --print flag β€” non-interactive, scripted runs
  • Remote Control β€” sessions managed via the Remote Control API

This broad compatibility means /goal integrates into both human-in-the-loop workflows and fully automated pipelines.

Why This Matters

The /goal command addresses a fundamental friction point in agentic coding: knowing when to let Claude keep going. Without a declared goal, users must actively monitor sessions and decide when to re-engage. With /goal, the decision logic is explicit from the start β€” Claude checks its output against the condition and keeps going until it's satisfied or until the session hits a natural stopping point.

Combined with agent view (also introduced in v2.1.139), /goal enables a powerful pattern: dispatch several sessions with explicit goals, background them via /bg, and return to agent view to see which ones have completed.