# Goal mode for Claude Code

> Makes Claude Code keep working until your stated goal is met.

- **What it does:** Lets you give Claude Code a finish line, like "all tests pass," and it keeps working turn after turn until that's true. You don't have to prompt it at every step.
- **Agents:** Claude Code and Codex (through orbit-connect), Claude and ChatGPT (through the Orbit connector)
- **Install:** `npx -y --loglevel=error orbit-connect@0.3.33 install skl_c6ffff83c70459e7ba820151`
- **Creator:** @orbit.builders on Instagram
- **Safety:** Checked by Orbit: nothing risky found in what it runs or reads
- **Installs:** 6
- **Last updated:** 2026-11-14
- **Page:** https://orbitinbox.app/s/goal-mode-for-claude-code

## Skill

---
name: claude-code-goal-mode
description: Use when you want to give Claude Code a finish line like "all tests pass" and have it keep working until that's true; it sets a /goal condition that Claude checks after every turn until met, impossible, or a fixable error clears it.
---

# Goal mode for Claude Code

## What it does
This is the `/goal` command built into Claude Code. You give it a completion condition, and Claude keeps taking turns toward that condition without you prompting each step. After every turn, a small fast model checks whether the condition holds and returns one of three verdicts:

- **Not yet met** — Claude keeps working, using the evaluator's reason as guidance for the next turn.
- **Met** — Claude Code clears the goal and records it as achieved.
- **Impossible** — Claude Code clears the goal and records why, with no action needed from you.

`/goal` is a session-scoped shortcut around a prompt-based Stop hook: it only applies to the current session. The docs also describe two related ways to keep a session running, if `/goal` doesn't fit: `/loop` (re-runs on a time interval instead of toward a condition) and a Stop hook you write yourself in your settings file (for custom, deterministic or model-evaluated checks across every session). Auto mode is separate: it approves tool calls within one turn but doesn't start new turns on its own — pair it with `/goal` so goal turns run unattended.

Background work (a subagent or background shell command) defers evaluation until it finishes, and after 30 minutes of waiting Claude Code delivers a check-in that asks Claude to check on stuck or progressing work.

## What you need
- Claude Code installed and a workspace you've trusted, since `/goal` runs under the same workspace trust rule as hooks in settings files. It's unavailable if `disableAllHooks` is on, or if `allowManagedHooksOnly` is set in managed settings.
- Some behaviors require newer Claude Code versions per the docs: idle check-ins need v2.1.236+, the capped-check-in behavior needs v2.1.246+, the retry/pause status messages need v2.1.269+, and the resume-goal-from-picker fix needs v2.1.239+.
- `/goal` works in interactive mode, non-interactive mode (`-p`), the desktop app, and Remote Control.

## Setup
`/goal` is a command inside Claude Code, not a separate install. Open a Claude Code session in your project, then use it directly.

Set a goal:
```
/goal all tests in test/auth pass and the lint step is clean
```

Check the current status (run with no arguments):
```
/goal
```

Clear an active goal before it resolves:
```
/goal clear
```

Run a goal to completion in one non-interactive invocation:
```
claude -p "/goal CHANGELOG.md has an entry for every PR merged this week"
```

See each message as a long-running non-interactive goal works, instead of only the final output:
```
claude -p "/goal CHANGELOG.md has an entry for every PR merged this week" --output-format stream-json --verbose
```

Turn off automatic check-ins and retries (optional):
```
export CLAUDE_CODE_GOAL_CHECKIN_MINUTES=0
```

## How to use it with Claude
- "/goal all tests in test/auth pass and the lint step is clean" — keep Claude working until the test suite and lint are both clean.
- "/goal split this file into modules, each under 300 lines" — have Claude work toward a measurable file-size budget.
- "/goal" (no arguments) — check how long the active goal has been running, how many turns were evaluated, token spend, and the evaluator's latest reason.
- "/goal clear" — stop an active goal before it finishes.
- "/goal fix the failing build, or stop after 20 turns" — bound how long an unattended goal can run.
- `claude -p "/goal CHANGELOG.md has an entry for every PR merged this week"` — run a goal to completion from the command line for a scheduled or scripted job.

Because `/goal` can run many turns unattended, start with a bounded condition (a turn or time clause, as above) until you trust how it behaves in your project, and keep Manual permission mode on for anything that touches files or commands you haven't already allowed.

## Credits
Made by Anthropic (Claude Code Docs), packaged by Orbit.
https://code.claude.com/docs/en/goal — license: not stated.

Shared by @orbit.builders, credited on Orbit.