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-code

Installs 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_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.

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
1hyf0 avatarvue-options-api-best-practiceshyf0/vue-skillsvue options api best practices2.1Kskills.sh installs
2hyf0 avatarvue-testing-best-practiceshyf0/vue-skillsvue testing best practices2.1Kskills.sh installs
3onmax avatarnuxt-better-authonmax/nuxt-skillsUse when implementing auth in Nuxt apps with @onmax/nuxt-better-auth - provides useUserSession composable, server auth helpers, route protection, and Better Aut2.1Kskills.sh installs
4vercel-labs avatarzustandvercel-labs/json-renderZustand adapter for json-render's StateStore interface. Use when integrating json-render with Zustand for state management via @json-render/zustand.1.9Kskills.sh installs
5affaan-m avatarfrontend-designaffaan-m/everything-claude-codefrontend design1.8Kskills.sh installs
6everyinc avatarce-frontend-designeveryinc/compound-engineering-pluginBuild web interfaces with genuine design quality, not AI slop. Use for any frontend work - landing pages, web apps, dashboards, admin panels, components, intera1.8Kskills.sh installs