<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/this-one-weird-trick-made-claude-code-so-much-more-reliable-and-nobody-tells-you-to-do-it-5vil1rg8w" -->

---
title: This one weird trick made Claude Code so much more...
description: Claude Code agents often stop after producing a plausible-looking fix without verifying it actually works, running narrow tests or declaring success...
canonical: https://daily.dev/posts/this-one-weird-trick-made-claude-code-so-much-more-reliable-and-nobody-tells-you-to-do-it-5vil1rg8w
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: This one weird trick made Claude Code so much more reliable, and nobody tells you to do it | daily.dev
og:description: Claude Code agents often stop after producing a plausible-looking fix without verifying it actually works, running narrow tests or declaring success...
og:url: https://daily.dev/posts/this-one-weird-trick-made-claude-code-so-much-more-reliable-and-nobody-tells-you-to-do-it-5vil1rg8w
og:image: https://api.daily.dev/og/posts/5VIL1rg8W.png
og:image:alt: This one weird trick made Claude Code so much more reliable, and nobody tells you to do it
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# This one weird trick made Claude Code so much more reliable, and nobody tells you to do it

**[XDA Developers](https://daily.dev/sources/xda-developers)** · 4 min read · 0 upvotes · 0 comments

## Summary

Claude Code agents often stop after producing a plausible-looking fix without verifying it actually works, running narrow tests or declaring success prematurely. The /goal command addresses this by acting as a session-scoped Stop hook: you specify a task plus measurable completion conditions (exact commands, exit codes, constraints on what shouldn't change), and a separate evaluator model checks the conversation evidence before letting Claude stop. If evidence is missing, the evaluator turns the gap into Claude's next instruction, creating an automatic verification loop. Only one goal can be active per session, and turn limits can be added to prevent endless loops on hard problems.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.xda-developers.com/weird-trick-made-claude-code-reliable-nobody-tells>

## Questions this post answers

### How do I stop Claude Code from declaring a task done before it's actually verified?

Use the /goal command, a session-scoped Stop hook that requires Claude to prove completion before finishing a turn. You define the task plus measurable completion conditions, such as exact commands and exit codes, and a separate evaluator model checks the conversation for evidence. If proof is missing, it tells Claude what remains and feeds that back as the next instruction automatically.

_daily.dev surfaces practical Claude Code workflows for developers tightening their AI coding agent's reliability._

### What should I write in a Claude Code /goal command to fix failing tests reliably?

Specify the exact verification commands and exit codes required, plus any constraints on what must not change. For example: require 'npm test -- test/auth' and 'npm run lint' to exit 0, confirm no tests were deleted or skipped, check git diff shows no unrelated changes, and require the final response to report the commands run and their results.

_Developers refining agentic coding prompts can find more Claude Code technique writeups on daily.dev._

## Similar posts on daily.dev

- [Claude Code's /goal command finally makes 'agentic' mean something](https://daily.dev/posts/claude-code-s-goal-command-finally-makes-agentic-mean-something-7keyc2z5v) · XDA Developers · 1 upvotes · 0 comments
- [Claude Code's output got dramatically better when I stopped letting it decide when it was done](https://daily.dev/posts/claude-code-s-output-got-dramatically-better-when-i-stopped-letting-it-decide-when-it-was-done-mln6fekdq) · XDA Developers · 0 upvotes · 1 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#anthropic](https://daily.dev/tags/anthropic), [#prompt-engineering](https://daily.dev/tags/prompt-engineering), [#claude-code](https://daily.dev/tags/claude-code)

[View this post on daily.dev](https://daily.dev/posts/this-one-weird-trick-made-claude-code-so-much-more-reliable-and-nobody-tells-you-to-do-it-5vil1rg8w)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"This one weird trick made Claude Code so much more reliable, and nobody tells you to do it","url":"https://daily.dev/posts/this-one-weird-trick-made-claude-code-so-much-more-reliable-and-nobody-tells-you-to-do-it-5vil1rg8w","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/this-one-weird-trick-made-claude-code-so-much-more-reliable-and-nobody-tells-you-to-do-it-5vil1rg8w"},"datePublished":"2026-09-10T20:05:10.651Z","dateModified":"2026-10-15T02:22:13.417Z","description":"Claude Code agents often stop after producing a plausible-looking fix without verifying it actually works, running narrow tests or declaring success...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d63f867f0a3103bff6fc7257bca7f191?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d63f867f0a3103bff6fc7257bca7f191?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"XDA Developers","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"XDA Developers","logo":"https://media.daily.dev/image/upload/s--kCg6yyAP--/f_auto,q_auto/v1774964407/logos/xda-developers?_a=BAMAMiWQ0","url":"https://daily.dev/sources/xda-developers"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/this-one-weird-trick-made-claude-code-so-much-more-reliable-and-nobody-tells-you-to-do-it-5vil1rg8w","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,anthropic,prompt-engineering,claude-code","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"XDA Developers","item":"https://daily.dev/sources/xda-developers"},{"@type":"ListItem","position":3,"name":"This one weird trick made Claude Code so much more reliable, and nobody tells you to do it"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/this-one-weird-trick-made-claude-code-so-much-more-reliable-and-nobody-tells-you-to-do-it-5vil1rg8w#faq","mainEntity":[{"@type":"Question","name":"How do I stop Claude Code from declaring a task done before it's actually verified?","acceptedAnswer":{"@type":"Answer","text":"Use the /goal command, a session-scoped Stop hook that requires Claude to prove completion before finishing a turn. You define the task plus measurable completion conditions, such as exact commands and exit codes, and a separate evaluator model checks the conversation for evidence. If proof is missing, it tells Claude what remains and feeds that back as the next instruction automatically. daily.dev surfaces practical Claude Code workflows for developers tightening their AI coding agent's reliability."}},{"@type":"Question","name":"What should I write in a Claude Code /goal command to fix failing tests reliably?","acceptedAnswer":{"@type":"Answer","text":"Specify the exact verification commands and exit codes required, plus any constraints on what must not change. For example: require 'npm test -- test/auth' and 'npm run lint' to exit 0, confirm no tests were deleted or skipped, check git diff shows no unrelated changes, and require the final response to report the commands run and their results. Developers refining agentic coding prompts can find more Claude Code technique writeups on daily.dev."}}]}
```

