For most of Claude Code's history, every action the agent took was tethered to a human turn. You typed a prompt, Claude responded, you reviewed the output, and the cycle started again. Version 2.1.139, released May 12, 2026, breaks that pattern. The new /goal command lets developers hand Claude Code an objective, step away from the terminal, and return to a completed task. The agent loops autonomously, re-evaluating its progress after each step, until an independent validation layer confirms the work is done or a built-in safety gate intervenes. It is a modest-looking command with a large shift underneath it: from AI as a reactive tool to AI as a persistent worker.
From Prompts to Objectives
Standard Claude Code sessions are conversational by design. Each prompt narrows or redirects the agent's attention, and the developer bears the cognitive overhead of sequencing the work. The /goal command inverts that dynamic. Instead of describing what to do next, a developer describes the end state: "All failing tests in the authentication module pass and the CI pipeline is green." Claude Code then plans, executes, inspects results, and replans, repeating until the stated condition is satisfied or until it determines the goal cannot be reached and surfaces an explanation. The developer's job shifts from directing individual steps to defining outcomes and reviewing what the agent produced.
The command is available across the three main Claude Code interaction modes. In the standard terminal interface, /goal triggers the loop interactively and prints running status to the console. With the -p flag it runs non-interactively, making it composable with shell scripts and CI pipelines. And in Remote Control mode, long-running goal sessions can be handed off to a server process, freeing the developer's local machine entirely. The breadth of those options signals that Anthropic built /goal as a general-purpose automation primitive, not a narrow power-user feature. Earlier expansions of Claude Code's agentic capabilities, including the Claude Code routines and desktop redesign shipped two weeks prior, pointed in the same direction.
Claude Code /goal: Key Facts
- ReleasedMay 12, 2026 (Claude Code 2.1.139)
- Plans requiredPro, Max, Team, Enterprise, or API
- ModesInteractive, -p flag, and Remote Control
- ValidatorIndependent Claude session checks if goal was met
- TrackingElapsed time, turns, and token count
- Early receptionCalled "most underrated AI feature of 2026"
How the Validator Loop Works
The technical architecture behind /goal is where the feature becomes genuinely interesting. When the working Claude Code session believes it has completed the objective, it does not self-certify and exit. Instead, it spins up a separate Claude session whose sole function is to evaluate whether the stated goal was actually met, against the current state of the repository. That second session has no knowledge of the steps the primary agent took; it reads the codebase cold and checks the condition independently. If it returns a pass, the loop exits. If it returns a fail, the primary agent receives a structured description of what is still missing and continues working. This two-session architecture is what allows the system to run unattended for hours without drifting into false completion: the agent cannot convince itself it is done.
Anthropic has layered several safety gates on top of that loop. Token budgets are enforced per session, and the standard rate limits that apply to Claude's model family across all tiers carry over unchanged. If a goal session is consuming unusually high token counts, the agent surfaces a warning before the next iteration rather than continuing silently. Elapsed time, turn count, and cumulative token spend are all surfaced in the console status line throughout the run, giving developers a live picture of resource consumption even when they are not actively watching. The design reflects a lesson visible in the multi-agent work discussed at the Code with Claude San Francisco outcomes event earlier this month: agentic systems need observable cost boundaries, not just capability.
"I ran /goal on a legacy test suite refactor at 9 PM and came back at 7 AM to a green CI board. It is the single most underrated AI feature of 2026 and almost nobody is talking about it." Developer community post, May 2026
What Changes for Day-to-Day Development
The most immediate practical change is in how developers structure their time around Claude Code sessions. Previously, long-running tasks required supervision or careful prompt sequencing to keep the agent on track across many turns. With /goal, that supervision cost shifts to the front of the task, where the developer must write a precise, testable objective, and to the back, where they review what the agent actually produced. The middle, which in complex refactors or test-suite migrations could span dozens of back-and-forth turns, becomes asynchronous. Developers who routinely do this kind of work are reporting meaningful reductions in the elapsed wall-clock time they personally spend engaged with a task, even when the agent itself takes longer than a manual session would.
There are practical limits worth keeping in mind. The quality of a goal session is tightly coupled to the quality of the goal statement. Vague objectives produce wandering agents; objectives that can be unambiguously verified by the validator session produce reliable completions. Anthropic's own documentation recommends framing goals in terms of observable outputs: passing tests, a specific file state, a clean lint run, a successful build. Developers who treat /goal as a way to hand off ambiguous tasks will get ambiguous results. Those who invest in precise objective-setting will find the command delivers on the autonomous coding promise that has been a recurring theme at Anthropic since the company began accelerating its agentic roadmap in early 2026.