Claude Code Stop hook tip: Use exit code 2 to trigger automatic retries when checks fail.
Automated summary · Based on collected summaries; not individually verified
Prepared by HotAI
What happened
Lydia Hallie shares a Claude Code tip: Use a Stop hook to enable automatic retries after check failures. The key is ensuring the hook exits with code 2. Exit code 2 sends the hook's stderr back to Claude to trigger a retry, while exit code 1 is non-blocking and causes Claude to end immediately even if the check fails.
Background
What is Claude Code? How Claude models participate in project development
Claude Code is Anthropic’s coding agent product using Claude models for development tasks in codebases. It organizes file reading, editing and tool feedback into ongoing work rather than only chat advice. For a failed test, it can inspect implementation and run relevant commands. Actual execution depends on environment, authorization and task state.
What Is Claude? The Model Family and Its Coding Tools
Claude is a family of generative models developed by Anthropic for tasks such as text analysis and coding, with image understanding available in vision-capable versions. “Using Claude” may mean the chat app, a model API call or Claude Code. The model generates responses and tool requests; the application supplies files and an execution environment. These layers under the same brand determine how much of a task can actually be completed.
Reading notes
The event summary comes from collected excerpts. Background passages quote existing HotAI articles to explain terms and do not establish new facts about this event. Check the original sources for product results, conditions and subsequent updates.
Original source
Sources and collection timeline
| Source | Report title | Original publication time | Collected by HotAI |
|---|---|---|---|
| x.com | Claude Code Stop hook tip: Use exit code 2 to trigger automatic retries when checks fail. | 2026-11-14 02:43 | 2026-11-14 02:57 |