{"slug": "claude-code-goal", "title": "claude code: /goal", "summary": "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.", "body_md": "♠ **Problem statement**: a coding agent stops when it thinks it is done, not when\nthe thing is actually done.\n\n[ /goal](https://code.claude.com/docs/en/goal.md) sets a condition that\noutlives the turn. The docs call it a wrapper around a session-scoped,\nprompt-based Stop hook: every time the agent tries to end its turn, an evaluator\nchecks the condition and pushes back if it does not hold.\n\n```\n/goal argocd, prometheus and external secrets should all be healthy and synced in cluster #26\n```\n\nI 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:\n\n```\nStop hook feedback:\n[argocd, prometheus and external secrets should all be healthy and synced in cluster #26]:\nPRs #3064 and #3062 have been opened but not yet merged. The latest status check\nin the transcript confirms external-secrets = 'OutOfSync', argocd = 'OutOfSync',\nprometheus = 'Unknown' — none are both 'healthy and synced'.\n```\n\nOpening 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.\n\n`/goal`\n\nwith no arguments shows the condition, elapsed time, turn count, token\nspend, and the evaluator’s last reason. `/goal clear`\n\nends it.\n\nThe 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”.\n\n🤖 *Drafted with * ∎\n\n`/bloggify`\n\n.— § —\n\nReply via [email](mailto:serendipity@perrotta.dev?subject=Reply to: claude code: /goal)", "url": "https://wpnews.pro/news/claude-code-goal", "canonical_source": "https://perrotta.dev/2026/08/claude-code-/goal/", "published_at": "2026-08-26 15:45:34+00:00", "updated_at": "2026-08-26 16:44:32.588147+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "artificial-intelligence"], "entities": ["Anthropic", "Claude Code", "Argo CD", "Prometheus", "external-secrets"], "alternates": {"html": "https://wpnews.pro/news/claude-code-goal", "markdown": "https://wpnews.pro/news/claude-code-goal.md", "text": "https://wpnews.pro/news/claude-code-goal.txt", "jsonld": "https://wpnews.pro/news/claude-code-goal.jsonld"}}