
Agent Hooks
Lifecycle hooks that let you run your own scripts to block, rewrite, or observe agent actions at twelve different points, from incoming messages to tool calls to outbound notifications. The agent installs and activates hooks end-to-end with a single loopback API call, no manual config editing or restarts. This is for recurring, automatic enforcement: stop destructive bash commands before they run, inject context into every model call, block replies that fail quality checks and force a redo, or prevent secrets from reaching external channels. The `/hooks` command gives you plain-text control over the master switch, approval, and per-hook health checks. Think of it as programmable guardrails that fire without asking each time.
- skills.sh installs
- 2.2K
- GitHub stars
- 32
- last updated
- Aug 21, 2026
Install
$ npx -y skills add starchild-ai-agent/official-skills --skill agent-hooks --agent claude-codeInstalls into .claude/skills of the current project.
Files
Agent Hooks
Shell hooks let a user run their own script at fixed points in the agent's lifecycle — to block a dangerous action, rewrite an input or an outbound message, inject context into the model, or warn the user. The script can be written in any language; it talks to the agent over a simple JSON-on-stdin, JSON-on-stdout protocol.
Tools: read_file, write_file, bash
When to use
Reach for hooks when the user wants the agent to automatically enforce a rule or react to an event without being asked each time. Examples:
- "Stop me from running
rm -rf/ destructive bash" →pre_tool_callblock - "Never let a private key get pushed to Telegram" →
on_outbound_messageblock - "Log every tool call for audit" →
post_tool_callobserve - "Remind the agent of X at the start of every model call" →
pre_llm_callcontext - "Don't let the agent claim it published when it didn't" →
on_completion_claim(in/goal) oron_stop(in normal chat) - "If the answer fails my quality check, make the agent redo it" →
on_stopblock
If the user just wants a one-off check, that's not a hook — hooks are for recurring, automatic lifecycle enforcement.
Sponsors
Details
- Repository
- github.com/starchild-ai-agent/official-skills
- Categories
- Frontend Development, AI & Agent Building, CLI & Terminal
- First seen
- Jul 14, 2026
More from starchild-ai-agent/official-skills
All 43- Wechat Binding2.2K
- Tg Bot Binding2.2K
- Image Create2.1K
- Image Ecommerce2K
- Image 3d2K
- Image Bg Remove1.8K
- Cli Bridge1.8K
- Video Analysis1.8K
- Ui Design1.8K
- Image Tryon1.8K
- Okx1.7K
- Worldcup1.4K
- Feishu Binding1.4K
- Upbit1.3K
- Coinglass11.5K
- Wallet8.9K
- Hyperliquid8.7K
- Coingecko7.9K
- Twitter7.9K
- Skill Creator7.8K
- Twelvedata7.7K
- Skillmarketplace7.1K
- Orderly Onboarding7.1K
- Project Builder5.2K