{
  "id": 6541621,
  "title": "5 Verbal Corrections Didn't Stick, So a 46-Line Stop Hook Made the Mistake Physically Impossible",
  "url": "https://urgent.news/2026/09/10/5-verbal-corrections-didnt-stick-so-a-46-line-stop-hook-made-the",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-10T05:00:06.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/bokuwalily/5-verbal-corrections-didnt-stick-so-a-46-line-stop-hook-made-the-mistake-physically-impossible-3d4n"
  },
  "original_language": "en",
  "account": "Five attempts to correct Claude Code's mistake did not succeed. Then, a 46-line shell script was introduced, preventing the issue from recurring. Initially, I had corrected Claude Code's repeated misuse of the && operator in ! handoff commands. Despite pointing out the error multiple times, the mistake continued to appear. This issue stemmed from the nature of Claude Code sessions. Each session is independent, and corrections are context-specific. They do not carry over to subsequent sessions. Moreover, the chaining of blocking commands using && caused the entire session to freeze, making debugging a time-consuming process. The Stop hook feature in Claude Code enabled the execution of a shell script before the response was returned to the user. By crafting a 46-line script, the mistake could be rendered physically impossible. This script intercepted the transcript JSON, parsed it, and blocked the response if the last assistant message contained an ! command with &&. This architectural solution ensures that the mistake cannot occur again, regardless of how Claude Code labels the output.",
  "summary": "I corrected the same Claude Code mistake more than five times. It never stuck. Then I replaced the correction with a 46-line shell script, and the mistake has not come back once. Some background: I started freelancing in college at around ¥100,000 a month, stacked side gigs until I reached ¥600,000, got laid off and dropped to zero, and spent the next six months building an autonomous Claude Code…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}