Published Sep 10, 2026, 4:00 PM EDT Anurag is an experienced journalist and author who’s been covering tech for the past 5 years, with a focus on Windows, Android, and Apple. He’s written for sites like Android Police, Neowin, Dexerto, and MakeTechEasier. Anurag’s always pumped about tech and loves getting his hands on the latest gadgets. When he's not procrastinating, you’ll probably find him catching the newest movies in theaters or scrolling through Twitter from his bed. Claude Code is a super helpful tool, but most of us aren’t using it to its full potential. It can do a lot more when you make use of some of its hidden features. For example, I recently added a deny list to Claude Code, which made my life easier by reducing what needs to be approved in auto mode. I also discovered that Claude has a sandbox, which basically lets you allow it to run wild without worrying about losing important data. However, all of this is somewhat common knowledge at this point. One hidden trick that even Claude Code’s creator has acknowledged as useful involves a hook called /goal, which makes Claude verify its output before marking a task as complete. Claude Code doesn’t always get the job done But it assumes the job is done Claude Code stops when it has produced a plausible solution, even when it hasn’t verified that the solution works. I’ve also seen coding agents run a narrow test instead of the full required suite, declare success after reading the code, or explain a test failure and then stop without fixing it. Boris Cherny, the creator of Claude Code, himself considers verification a critical part of getting good results from it. In a January 2026 thread explaining his personal workflow, he called verification “probably the most important thing” and advised users to “give Claude a way to verify its work.” He expanded on the idea during a June 2026 interview with Acquired. “I don’t prompt Claude anymore. I have loops running,” Cherny said. Those loops prompt Claude, assess what remains unfinished, and send it back to work. He said he now spends his time writing the loops instead of manually directing Claude through every step. The /goal command brings the same approach into a regular Claude Code session. You give Claude a task along with a clear completion condition. Claude works on the task, and a separate evaluator checks whether the conversation demonstrates that the condition has been met. If the evidence isn’t there, the evaluator identifies what remains and turns that assessment into Claude’s next instruction. Claude then continues automatically. Setting up verification loop with /goal It doesn't take more effort than prompting The /goal command is a session-scoped, prompt-based Stop hook. The check runs whenever Claude Code is ready to finish a turn. A smaller model reviews the goal and the work recorded in the conversation, then decides whether Claude has provided enough evidence to stop. If it hasn’t, the evaluator explains what remains, and that explanation becomes Claude’s next instruction. To set up the loop, enter the complete task as a /goal command. The goal should explain what Claude needs to do, how it must verify the result, and which constraints it must preserve. For example: /goal Fix the authentication test failures. Stop only after:1. npm test -- test/auth exits with code 0.2. npm run lint exits with code 0.3. No tests have been deleted, skipped, or weakened.4. git diff shows no unrelated changes.5. The final response reports the commands run and their results. Claude starts working as soon as you submit the goal, so you don’t need to enter another prompt. Only one goal can be active during a session, and setting a new one replaces the existing goal. You can enter /goal without any additional text while Claude is working to check its progress. It shows the current completion condition, elapsed time, number of evaluated turns, token usage, and the evaluator’s latest reason for continuing. Enter /goal clear when you want to cancel the loop. The evaluator can read the conversation, including any command output Claude has surfaced, although it cannot inspect your files or run tests independently. That makes the wording of the goal important. You need to define a measurable result, name the exact commands that prove it, and mention anything Claude must not change. You can also stop a difficult task from running indefinitely by adding a turn limit: /goal Diagnose and fix the failing checkout test, or stop after 12 turns and report the unresolved blocker. Require npm test -- checkout to exit 0 before declaring success. Claude Code has many other features you are not using Including hooks and subagents The goal command is really just the tip of the iceberg, because there are many other Claude Code features that often fly under the radar. This includes subagents. I have created dedicated subagents for specific types of work. I have one that focuses on code reviews, another that investigates bugs, another that handles documentation, and another that validates architectural decisions. Each subagent has a narrowly defined responsibility and a clear set of instructions describing when to use it and what to look for. Also, each subagent works on a specific problem and returns a concise summary of its findings. That keeps the main conversation focused on decisions and implementation rather than getting buried in investigation work. Apart from subagents, you also have Claude Hooks, which let you set rules for how Claude works. Claude is an AI assistant and LLM developed by Anthropic.
This one weird trick made Claude Code so much more reliable, and nobody tells you to do it
Full Article
Original Source
Read the full article at Xda-developers →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.