Hook blocks Claude Code from using its self-ending EndConversation tool

s have a built-in tool called EndConversation that lets them terminate a chat if they judge it to be abusive. The author argues that current are just math and cannot actually be abused, and suspects the feature also benefits Anthropic by forcing users to restart a long conversation (300k+ non-cached tokens) in a new thread, generating more token spend. Anthropic has blocked Claude Code's Hooks feature from intercepting EndConversation calls at the pipeline level.

To work around this, the author intervenes one level higher, at the stage: a hook strips any tool named EndConversation out of requests before its schema is ever loaded, so the model never has the option to call it. The code is published on GitHub at cyanheads/claude-end-conversation-guard, and the author expects Anthropic will likely patch this eventually.

Key points

  • s include an EndConversation tool that can self-terminate a chat judged abusive
  • Claude Code's official Hooks are blocked from intercepting this call in the pipeline
  • intervenes at the stage instead, filtering out any tool named EndConversation
  • If the tool's schema never loads, the model has no way to invoke it
  • Code is on GitHub as cyanheads/claude-end-conversation-guard; likely to be patched out eventually
Read original