Stop Babysitting AI Agents: The /goal Command for Hands-Off Claude Code Workflows
Use Claude Code's /goal command to make an AI agent work autonomously until a task is provably finished, with a second AI checking the output against your criteria, cutting down on check-ins and interruptions.
Practical Summary
This workflow lets you set a clear finish-line definition for an AI coding agent, which then works, prints proof, and gets graded by a second AI checker. If the output fails the grade, the agent automatically takes another turn, allowing you to step away while the task completes.
Why It Matters
For developers and teams, this method directly reduces the human-in-the-loop bottleneck, saving time and mental overhead. The evidence shows a practical task (trip-planning) completed from start to finish without human intervention, demonstrating potential for cost savings through increased automation and developer focus.
How to Set Up the /goal Autonomous Workflow in Claude Code
1. **Define Your Finish Line**: Before starting, write down specific, verifiable completion criteria. Avoid vague goals like 'make it good.' Instead, use concrete requirements such as 'Every claim has a source link, zero placeholders, all six sections present.' The checker AI is literal and only reads what's printed in the conversation.
2. **Initiate the Agent**: In Claude Code, type the /goal command followed by your detailed task prompt and finish-line criteria. This tells the primary agent to begin working.
3. **The Autonomous Loop**: The agent will work, print proof of its progress or output into the chat, and then pause for evaluation. A second AI (the checker) will grade the output against your predefined criteria.
4. **Automatic Retry**: If the checker's grade indicates the output fails to meet the criteria, the primary agent automatically takes another turn to improve its work. This loop continues until the output passes the grade.
5. **Walk Away**: Once you type /goal with clear criteria, you can leave the task. The system is designed to handle the iteration loop without further input, eliminating the need to check in every few minutes.
