cyanheads

Claude End Conversation Guard — Development skill for Claude Code

Development community

A Claude Code hook that prevents the EndConversation tool from loading in your sessions, so it can never be called.

How to install Claude End Conversation Guard

This entry records only its repository, not the path inside it, so there is no exact command to give. Open cyanheads/claude-end-conversation-guard and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude End Conversation Guard does

A Claude Code hook that prevents the EndConversation tool from loading in your sessions, so it can never be called. TypeScript/Bun.

Alternatives in Development

  • Claude Supermemory — Persistent memory across sessions and projects using Supermemory 2.3k ★
  • 18 — Build a fullscreen loading screen component in React (Next.js 14, TypeScript) 152 ★
  • Raw CLI — The agent harness you can fork 105 ★

README

claude-end-conversation-guard

A [Claude Code](https://claude.com/claude-code) hook that keeps the `EndConversation` tool from loading in your sessions, which makes it uncallable.

`EndConversation` lets the assistant end your session on its own. This hook takes that away.

Why you might want this

The tool exists as a backstop for sustained abuse directed at the model. That's a real purpose, and if it never fires for you, this hook changes nothing about your day.

You might still want it gone:

  • Long autonomous runs. A session that ends mid-pipeline ends where it stands. You restart cold — new prompt cache, context re-derived, work re-traced.
  • It's a model's judgment call, and models misjudge.
  • You may simply prefer that ending your session is your decision.

Hooks are the supported way to decide which tools exist on your machine. This is one of them.

Install

Requires [Bun](https://bun.sh).

  1. Copy end-conversation-guard.ts into ~/.claude/hooks/.
  2. Register it in ~/.claude/settings.json:
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "EndConversation|ToolSearch",
        "hooks": [
          {
            "type": "command",
            "command": "bun run /Users/YOU/.claude/hooks/end-conversation-guard.ts",
            "timeout": 30
          }
        ]
      }
    ]
  }
}

Use an absolute path. Restart Claude Code — `settings.json` changes need a reload, though edits to the hook file itself take effect immediately.

To block other deferred tools too, add their names to `BLOCKED_TOOLS` and a matching pattern to `BLOCKED_PATTERNS`.

How it works

`EndConversation` is a **deferred tool**. Deferred tools are listed by name but ship with no schema — Claude has to call `ToolSearch` to fetch one before it can call the tool at all. An unloaded tool is not a callable tool.

`ToolSearch` is an ordinary tool. It runs through `PreToolUse` like everything else.

So the guard doesn't block `EndConversation`. It bl