diff --git a/docs/internal-hooks.md b/docs/internal-hooks.md index 3d5279305..81c3018dc 100644 --- a/docs/internal-hooks.md +++ b/docs/internal-hooks.md @@ -8,6 +8,18 @@ read_when: Internal hooks provide an extensible event-driven system for automating actions in response to agent commands and events. Hooks are automatically discovered from directories and can be managed via CLI commands, similar to how skills work in Clawdbot. +## Beginner-Friendly Intro + +Internal hooks are small scripts that run inside the Gateway when specific events happen (like `/new`, `/reset`, `/stop`, or other lifecycle events). Think of them as: **“When X happens, run this code.”** They let you extend Clawdbot without changing core code. + +What you can do with hooks: +- Automatically save a memory snapshot when you reset a session +- Keep an audit trail of commands for troubleshooting or compliance +- Trigger follow-up automation when an agent starts or ends a session +- Write files into the agent workspace or call external APIs when events fire + +If you can write a small TypeScript function, you can write a hook. Hooks are discovered automatically, and you enable or disable them via the CLI. + ## Overview The internal hooks system allows you to: