Skip to content

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
View on GitHub

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 /hooks subcommands for list, on, off, doctor, approve, and revoke, plus a self-approve API
  • Enforces safety boundaries such as blocking rm -rf in pre_tool_call and stopping secrets in on_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 -y

Installs 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_call block
  • "Never let a private key get pushed to Telegram" → on_outbound_message block
  • "Log every tool call for audit" → post_tool_call observe
  • "Remind the agent of X at the start of every model call" → pre_llm_call context
  • "Don't let the agent claim it published when it didn't" → on_completion_claim (in /goal) or on_stop (in normal chat)
  • "If the answer fails my quality check, make the agent redo it" → on_stop block

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

Similar to Agent Hooks

More Agent Workflow & Planning