A collection of plug-and-play bash hook scripts for Claude Code to manage agent persistence, tool failure recovery, and output verification.
The fastest way to install a skill directly from the registry.
npx clawhub@latest install agent-hooks
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 agent-hooks using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).
Get the raw skill files in a ZIP archive.
Agent Hooks is a comprehensive suite of lifecycle scripts designed specifically for the Claude Code CLI environment. These scripts solve three critical problems in autonomous agent workflows: premature stopping during complex tasks, infinite loops caused by repeated tool failures, and speculative completion claims where the agent assumes a task is done without sufficient evidence. As a part of the Openclaw Skills ecosystem, these hooks allow developers to inject custom logic into the Stop, PreToolUse, and PostToolUse phases of an agent's lifecycle.
By utilizing these hooks, you can ensure that your AI agent remains persistent on long-running tasks while maintaining safety valves to prevent resource waste. The toolkit includes the Ralph engine for execution management, a doubt gate for linguistic verification, and automated diagnostic triggers that run immediately after code edits.
To install these Openclaw Skills, you must map the script paths in your Claude configuration file:
# Edit your ~/.claude/settings.json
# Example for adding the Ralph stop hook and tool tracker:
{
"hooks": {
"Stop": [{
"hooks": [{"type": "command", "command": "bash /path/to/scripts/ralph-stop-hook.sh"}]
}],
"PostToolUseFailure": [{
"hooks": [{"type": "command", "command": "bash /path/to/scripts/tool-error-tracker.sh", "async": true}]
}]
}
}
Ensure that the NC_SESSION environment variable is set to allow the scripts to track state across sessions.
The skill manages state using a structured file hierarchy within the user's home directory. This organization allows for crash recovery and session persistence.
| Data Type | Location / Format | Description |
|---|---|---|
| Session State | $HOME/.../shared-context/sessions/<id>/ |
Stores iteration counts, error logs, and cancel signals. |
| Input Schema | Standard JSON (stdin) | Contains tool_name, tool_input, and session_id. |
| Output Schema | Standard JSON (stdout) | Decisions like {"continue": true} or {"decision": "block", "reason": "..."}. |
| Diagnostic Logs | Script-specific logs | Captures linter and type-checker outputs for the post-edit hook. |
Loading
Automates the retrieval of Young Post Club Spark articles, converting them into professionally formatted PDF documents and syncing them to cloud storage.

A Python-based drawing utility that enables AI agents to generate and save PNG images using the Pillow library and interactive Tkinter windows.

A powerful search integration that allows AI agents to perform live web queries and research within the Openclaw Skills framework.

Report-gama is a professional market intelligence system that automates the generation of 15-chapter research reports with real-time data and PDF export capabilities.

A professional financial forecasting and valuation engine that generates comprehensive 3-statement models, DCF analysis, and comparable company benchmarks.

A specialized testing utility to verify if an AI skill remains functional when provided with minimal context or sparse instructions.








































