A powerful tool interception framework to inject custom logic before and after AI tool execution.
The fastest way to install a skill directly from the registry.
npx clawhub@latest install hook-system
Copy the skill folder to one of these locations
~/.openclaw/skills/ <project>/skills/ Priority: Workspace > Local > Bundled
Copy this prompt to OpenClaw to install it automatically.
Help me install hook-system using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).
Get the raw skill files in a ZIP archive.
The Hook System is a specialized framework designed to provide granular control over the lifecycle of AI tool calls. By integrating this skill, developers can inject custom scripts into the execution flow, allowing for real-time monitoring, input validation, and output modification. It serves as a middleware layer that enhances the reliability and security of Openclaw Skills by ensuring every tool interaction follows predefined logic.
This system is essential for developers who need to build guardrails around their AI agents. It allows for the interruption of potentially harmful commands before they run (PreToolUse) and the sanitization of results before they are returned to the model (PostToolUse), making it a cornerstone for production-grade agentic workflows.
To get started with the Hook System, ensure you have Node.js 18 or higher installed. You can initialize the runner within your local Openclaw Skills environment using the following structure:
# Navigate to your skill directory
cd hook-system
# Configure your hooks in a JSON format
# { "hooks": { "preToolUse": ["node ./hooks/validate.mjs"] } }
To programmatically invoke the runner in your JavaScript environment:
const { HookRunner } = require('./scripts/hook-runner.mjs');
const runner = new HookRunner({
preToolUse: ['echo "Validating $HOOK_TOOL_NAME"'],
postToolUse: ['node ./hooks/filter-secrets.mjs']
});
The Hook System leverages standard environment variables to communicate context to your scripts. This allows for language-agnostic hook implementation using Openclaw Skills.
| Environment Variable | Description |
|---|---|
HOOK_EVENT |
Specifies the hook type: PreToolUse or PostToolUse. |
HOOK_TOOL_NAME |
The name of the tool being intercepted. |
HOOK_TOOL_INPUT |
The raw JSON string of the tool arguments. |
HOOK_TOOL_OUTPUT |
The result of the tool execution (available in PostToolUse). |
HOOK_TOOL_IS_ERROR |
A flag (0 or 1) indicating if the tool execution failed. |
Loading
DeepRead Insurance is a high-accuracy AI skill designed to extract structured data from complex insurance documents and redact sensitive PII.

A strategic framework for publishing content on high-authority platforms to leverage their domain strength for immediate search rankings and AI citations.

An automated context management tool that prevents token overflows by summarizing long conversation histories into concise, structured snapshots.

A professional framework for automating the generation of high-quality, data-driven landing pages at scale using AI-enhanced templates.

A sophisticated tool discovery and registration system featuring token-based routing, granular permissions, and sub-agent whitelisting.

A comprehensive token monitoring and budget management system designed to track AI agent consumption and operational costs.








































