Prevent continuation stop hook messaging

From ychampion/cskill-agents · View interactive version

Prevent continuation stop hook messaging is an AI agent skill from the GitHub repository ychampion/cskill-agents. Collect stop-hook progress/errors, emit a structured prevented-continuation attachment, and summarize the block for users and logs.

How to use this skill

Skill file

SKILL: Prevent Continuation Stop Hook Messaging

Domain: tool-orchestration

Trigger: Use when stop hooks prevent continuation so you can surface a consistent attachment plus a summary notification that downstream UI/logging consumes.

Source Pattern: Distilled from reviewed tool-loop and result-shaping patterns.

Core Method

Capture every hook progress update while the stop-hook generator runs, track how many hooks fired, preserve per-hook command and prompt details, then attach later timing/error data to the matching hook entries. When a hook asks to prevent continuation, emit a machine-readable hook_stopped_continuation attachment with the hook name, tool use ID, and stop reason, then synthesize the concise StopHookSummary message that surfaces counts, errors, and whether the turn was blocked. This keeps UI banners, transcript log notifications, and verbose hooks in sync, with a single reusable pattern that works whenever any hook stops the turn.

Key Rules

Example Application

When the Stop hook intercepts a red team command that would delete infrastructure, emit the hook_stopped_continuation attachment with hookEvent: 'Stop', then send the summary message so the REPL banner shows “Stop hook prevented continuation: <reason>” while telemetry records how many hooks fired and what errors occurred.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.