Follow Discord
Sweep 22 Oct 2026 · 21:04Z Build v2.1.309 528 read Stable v2.1.308 Latest v2.1.309 Next v2.1.309 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.78 ·

StopFailure Hook Event

Entry
JSON All of v2.1.78
EntryKind: in v2.1.78,
ChangesSection of the release
What

A new hook event type that fires when a turn ends due to an API error (rate limit, auth failure, billing error, etc.), distinct from the normal Stop event.

Usage
{
  "hooks": {
    "StopFailure": [
      {
        "type": "command",
        "command": "echo 'API error: $CLAUDE_HOOK_ERROR'"
      }
    ]
  }
}
Details
  • Fires instead of Stop when an API error ended the turn
  • Fire-and-forget — hook output and exit codes are ignored
  • Supports matching on error type: rate_limit, authentication_failed, billing_error, invalid_request, server_error, max_output_tokens, unknown
Evidence

Hook event definition (search for "StopFailure") — added to the hook event schema with matcherMetadata on "error" field

Strings lifted out of the shipped bundle, so the claim above can be checked against them.

How sure we are
One source agreesOne thing we can check says the same as this entry.
Anthropic's release notes agreeAdded StopFailure hook event that fires when the turn ends due to an API error (rate limit, auth failure, etc.)

See this entry in the whole of v2.1.78 →

Feedback