cd /news/ai-agents/claude-code-goal · home topics ai-agents article
[ARTICLE · art-112046] src=perrotta.dev ↗ pub= topic=ai-agents verified=true sentiment=· neutral

claude code: /goal

Anthropic's Claude Code coding agent now includes a /goal command that sets a session-scoped condition the agent must satisfy before ending its turn, preventing it from declaring victory prematurely. In a test, the agent opened pull requests #3064 and #3062 for Argo CD apps but the evaluator rejected the turn three times because the apps were still OutOfSync or Unknown, showing that opening a PR does not count as the apps being healthy and synced.

read2 min views1 publishedAug 26, 2026

Problem statement: a coding agent stops when it thinks it is done, not when the thing is actually done.

/goal sets a condition that outlives the turn. The docs call it a wrapper around a session-scoped, prompt-based Stop hook: every time the agent tries to end its turn, an evaluator checks the condition and pushes back if it does not hold.

/goal argocd, prometheus and external secrets should all be healthy and synced in cluster #26

I set that mid-session while debugging a cluster where three Argo CD apps were stuck. What followed was the useful part. The agent wrapped up with a tidy summary and two pull requests, and got this back:

Stop hook feedback:
[argocd, prometheus and external secrets should all be healthy and synced in cluster #26]:
PRs #3064 and #3062 have been opened but not yet merged. The latest status check
in the transcript confirms external-secrets = 'OutOfSync', argocd = 'OutOfSync',
prometheus = 'Unknown' — none are both 'healthy and synced'.

Opening a PR is not the same as the apps being green, and the evaluator reads the transcript rather than the closing paragraph. It fired three times. Each time the summary was plausible and each time the condition was still false.

/goal

with no arguments shows the condition, elapsed time, turn count, token spend, and the evaluator’s last reason. /goal clear

ends it.

The failure mode it fixes is specific: an agent that declares victory one step early. It does not make the agent smarter — mine still burned several turns on wrong theories, and I had to redirect it more than once. It only refuses to let “I opened a PR” stand in for “the apps are green”.

🤖 *Drafted with * ∎

/bloggify

.— § —

Reply via [email](mailto:serendipity@perrotta.dev?subject=Reply to: claude code: /goal)

── more in #ai-agents 4 stories · sorted by recency
── more on @anthropic 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-code-goal] indexed:0 read:2min 2026-08-26 ·