Dokumentationerreichbar
Anthropic, Keep Claude working toward a goal
code.claude.com (externe Seite)
Die Dokumentation zur Zielbedingung, der zweiten der vier Härtestufen. Daran hängt ein Ratschlag zur Formulierung: Der Bewerter urteilt allein über das, was in der Unterhaltung steht, ohne selbst Befehle auszuführen oder Dateien zu lesen. Als Beispiel für eine Nebenbedingung nennt die Seite ausgerechnet den Fall, um den es beim testgetriebenen Arbeiten geht, nämlich dass keine weitere Testdatei angefasst wird.
geprüft 10.11.2026
Worauf sich diese Seite beruft, wörtlich, abgerufen am 28.08.2026:
no other test file is modified
bestätigt 10.11.2026It doesn't run commands or read files independently, so write the condition as something Claude's own output can demonstrate.
bestätigt 10.11.2026If the model judges it not yet met, Claude starts another turn instead of returning control to you.
bestätigt 10.11.2026A goal doesn't change your permission mode.
bestätigt 10.11.2026One goal can be active per session.
bestätigt 10.11.2026Setting a goal starts a turn immediately, with the condition itself as the directive.
bestätigt 10.11.2026To bound how long a goal runs, include a turn or time clause in the condition
bestätigt 10.11.2026the evaluator judged that the condition can never be satisfied
bestätigt 10.11.2026Four kinds of failure clear the goal
bestätigt 10.11.2026After any other failure the goal stays set.
bestätigt 10.11.2026After three automatic retries, the goal pauses instead.
bestätigt 10.11.2026Once background work has kept the goal waiting for 30 minutes, a check-in is due.
bestätigt 10.11.2026Claude Code starts at most three idle check-ins per goal between your prompts.
bestätigt 10.11.2026Claude Code carries the condition over but resets the turn count, timer, and token-spend baseline.
bestätigt 10.11.2026Setting a goal with -p runs the loop to completion in a single invocation
bestätigt 10.11.2026is a wrapper around a session-scoped prompt-based Stop hook
bestätigt 10.11.2026Evaluation tokens are billed on the small fast model configured for your provider and are typically negligible compared to main-turn spend.
bestätigt 10.11.2026/
bestätigt 10.11.2026goal and a Stop hook both fire after every turn. The two are complementary: auto mode removes per-tool prompts, and /
bestätigt 10.11.2026goal removes per-turn prompts. The same command sets, checks, and clears it depending on the argument.
bestätigt 10.11.2026Claude Code leaves the goal active because the host restores access on its own
bestätigt 10.11.2026Implementing a design doc until all acceptance criteria hold
bestätigt 10.11.2026One measurable end state
bestätigt 10.11.2026The condition can be up to 4,000 characters.
bestätigt 10.11.2026you can press Ctrl+O to see the reason behind it
bestätigt 10.11.2026A Stop hook lives in your settings file, applies to every session in its scope, and can run a script for deterministic checks or a prompt for model-evaluated ones.
bestätigt 10.11.2026so completion is decided by a fresh model rather than the one doing the work
bestätigt 10.11.2026
Erst der rote Test07 Prüfen statt glauben18 Hooks und Mods24 Test und Spezifikation zuerst28 Lange Läufe