Agent Hooks
Manage shell hooks that block, rewrite, or warn on agent actions at fixed lifecycle points.
- CCM score
- 58 of 100
- skills.sh installs
- 2.2K
- GitHub stars
- 34
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers user-written scripts that run at 12 agent lifecycle events, from user message through session end
- Includes
/hookssubcommands for list, on, off, doctor, approve, and revoke, plus a self-approve API - Enforces safety boundaries such as blocking
rm -rfinpre_tool_calland stopping secrets inon_outbound_message - Designed for users who want recurring, automatic rules enforced without asking the agent each time
Install
$ npx -y skills add starchild-ai-agent/official-skills --skill agent-hooks -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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.
Details
- Repository
- github.com/starchild-ai-agent/official-skills
- Categories
- Agent Workflow & Planning, Skill & Plugin Building
- First seen
- Jul 14, 2026
Questions
What does the agent-hooks skill do?
The agent-hooks skill lets a user run their own shell scripts at fixed points in the agent lifecycle, to block, rewrite, or warn on actions. Scripts can be written in any language and talk to the agent over JSON on stdin and stdout.
How do I install the agent-hooks skill?
Run npx -y skills add starchild-ai-agent/official-skills --skill agent-hooks -y in a project to install it. Once installed, the agent sets up and activates hooks itself, so the user only needs to test them afterward.
Which skills lead the category next to agent-hooks?
agent-hooks sits in the Agent Workflow & Planning category, where grill-me, grill-with-docs, setup-matt-pocock-skills, grilling and prototype are listed among the other top skills. This skill covers lifecycle enforcement that runs automatically, such as blocking destructive bash commands or logging every tool call.
Does agent-hooks need any tools or runtimes?
The skill requires bash and python3 as binaries. It works through the /hooks command and a loopback approval API on the local agent server.
More from starchild-ai-agent/official-skills
All 40- Wechat Binding2.2K
- Tg Bot Binding2.2K
- Image Create2.1K
- Image Ecommerce2K
- Image 3d2K
- Video Analysis1.9K
- Image Bg Remove1.8K
- Cli Bridge1.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.8K
- Orderly Onboarding7.1K
- Project Builder5.2K
- Browser Preview4.6K
Similar to Agent Hooks
More Agent Workflow & Planningagent-governanceSkillgithub/awesome-copilot9.7K installsGovernance patterns for AI agents: policy checks, intent screening, and audit trails around tool calls.
llm-gateSkillrohitg00/pro-workflow167 installsPrompt-hook quality gates that use a small LLM to block risky commits, shell commands, and file writes.
self-improving-agentSkillzhaono1/agent-playbook36.2K installsTurns completed-work evidence into candidate, validated, or applied behavior changes with executable evals and rollback.
langchain-middlewareSkilllangchain-ai/langchain-skills17.2K installsAgent skill for human approval gates, custom middleware hooks, and structured output in LangChain.
safety-hooksPluginpchalasani/claude-code-tools2K starsProvides safety guards to block or require confirmation for risky CLI operations (e.g., rm, destructive git actions, .env access, large file operations)
soul-guardianSkillprompt-security/clawsec258 installsDrift detection and baseline restore that guards agent workspace files like SOUL.md and AGENTS.md against unapproved changes.