Agent skill · Audited from source
Hooks Reference
skill · Dicklesworthstone/pi_agent_rustNOASSERTION licenceAudited 10 Oct 2026 · source 46a2537504c9
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit 46a2537504c9 and found no filesystem, network or shell access and no hard-coded secrets. What it does: Use this skill when asked about "hooks", "PreToolUse", "PostToolUse", "SessionStart", "hook events", "validate tool use", "block commands", "add context on session start", or implementing event-driven automation.
Cite
Cite this page
ModelsAtlas. “Hooks Reference (Dicklesworthstone/pi_agent_rust)”. Retrieved 10 Oct 2026. https://modelsatlas.com/skills/dicklesworthstone/hooks-reference
Trust audit
Audit 0.4.1 · source read 10 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | WARN | 1 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | PASS | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (1)
MEDIUMInventory / provenanceinv.symlink · .beads/beads.jsonl
.beads/beads.jsonl
- Why
- link not followed
- Fix
- —
Audit 0.4.1 · source sha 46a2537504c9 · 10 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- PublisherDicklesworthstone GitHub userOwner of the repository this skill is read from
- Source folderDicklesworthstone/pi_agent_rust/tests/ext_conformance/artifacts/plugins-ariff/hooks-reference/skills/hooks-referenceThe exact folder we audited
- LicenceNOASSERTIONAs the repository states it
- Commit pinned for this verdict46a2537504c9A new audit runs when the source changes
- Repository statusNot archivedPushed today
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Use this skill when asked about "hooks", "PreToolUse", "PostToolUse", "SessionStart", "hook events", "validate tool use", "block commands", "add context on session start", or implementing event-driven automation.
---
name: hooks-reference
description: >-
Use this skill when asked about "hooks", "PreToolUse", "PostToolUse",
"SessionStart", "hook events", "validate tool use", "block commands",
"add context on session start", or implementing event-driven automation.
---
# Hooks Reference Skill
This skill provides comprehensive guidance for implementing Claude Code hooks - event handlers that automate validation, context loading, and workflow enforcement.
## Hook Events Overview
| Event | When Triggered | Use Cases |
|-------|----------------|-----------|
| `PreToolUse` | Before tool executes | Validate, block, modify |
| `PostToolUse` | After tool completes | Audit, react, verify |
| `PermissionRequest` | Permission dialog shown | Auto-allow, auto-deny |
| `Stop` | Claude finishes | Force continue, verify |
| `SubagentStop` | Subagent finishes | Verify task complete |
| `SessionStart` | Session begins | Load context, setup |
| `SessionEnd` | Session ends | Cleanup, save state |
| `UserPromptSubmit` | Prompt submitted | Validate, add context |
| `PreCompact` | Before compaction | Preserve info |
| `Notification` | Notification sent | Alert, log |
## hooks.json Structure
Basic structure:
```json
{
"description": "What these hooks do",
"hooks": {
"EventName": [
{
"matcher": "Pattern",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/handler.sh",
"timeout": 30
}
]
}
]
}
}
```
## Matcher Patterns
For tool events (PreToolUse, PostToolUse, PermissionRequest):
- `"Write"` - Match exact tool name
- `"Write|Edit"` - Match multiple tools (regex)
- `"Notebook.*"` - Regex pattern
- `"*"` or `""` - Match all tools
For SessionStart:
- `"startup"` - Initial startup
- `"resume"` - From --resume, --continue, /resume
- `"clear"` - From /clear
- `"compact"` - From auto/manual compact
For Notification:
- `"permission_prompt"` - Permission requests
- `"idle_prompt"` - Claude waiting for input
## Hook Types
### Command Hooks (type: "command")
Execute a bash script:
```json
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/validate.sh",
"timeout": 30
}
```
### Prompt Hooks (type: "prompt")
LLM-based evaluation (Stop, SubagentStop only):
```json
{
"type": "prompt",
"prompt": "Evaluate if Claude should stop: $ARGUMENTS. Check if all tasks are complete.",
"timeout": 30
}
```
## Exit Codes
| Exit Code | Meaning | Behavior |
|-----------|---------|----------|
| 0 | Success | Action proceeds, stdout to user (verbose) |
| 2 | Block | Action blocked, stderr shown to Claude |
| Other | Error | Non-blocking, stderr to user (verbose) |
## Hook Input (stdin JSON)
Common fields:
```json
{
"session_id": "abc123",
"transcript_path": "/path/to/transcript.jsonl",
"cwd": "/current/working/directory",
"permission_mode": "default",
"hook_event_name": "PreToolUse"
}
```
PreToolUse specific:
```json
{
"tool_name": "Write",
"tool_input": {
"file_path": "/path/to/file.txt",
"content": "file content"
},
"tool_use_id": "toolu_01ABC..."
}
```
SessionStart specific:
```json
{
"source": "startup"
}
```
Stop specific:
```json
{
"stop_hook_active": false
}
```
## Advanced JSON Output
Return structured decisions via stdout (exit code 0):
### PreToolUse Decision Control
```json
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "allow",
"permissionDecisionReason": "Auto-approved documentation file",
"updatedInput": {
"field_to_modify": "new value"
}
}
}
```
Decision values: `"allow"`, `"deny"`, `"ask"`
### Stop Decision Control
```json
{
"decision": "block",
"reason": "Not all tasks complete - still need to run tests"
}
```
### UserPromptSubmit Context
```json
{
"hookSpecificOutput": {
"hookEventName": "UserPromptSubmit",
"additionalContext": "Current time: 2024-01-15 10:30:00"
}
}
```
### SessionStart Context
```json
{
"hookSpecificOutput": {
"hookEventName": "SessionStart",
"additionalContext": "Project context loaded..."
}
}
```
## Example Hooks
### 1. Validate File Writes (PreToolUse)
hooks/hooks.json:
```json
{
"description": "Validate file write operations",
"hooks": {
"PreToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/validate-write.sh",
"timeout": 30
}
]
}
]
}
}
```
scripts/validate-write.sh:
```bash
#!/usr/bin/env bash
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // .tool_input.filePath // empty')
# Block writes to sensitive files
if [[ "$FILE_PATH" == *.env* ]] || [[ "$FILE_PATH" == *secret* ]]; then
echo "Cannot write to sensitive files: $FILE_PATH" >&2
exit 2
fi
# Block writes outside project
if [[ ! "$FILE_PATH" == "$CLAUDE_PROJECT_DIR"* ]]; then
echo "Cannot write outside project directory" >&2
exit 2
fi
exit 0
```
### 2. Block Dangerous Commands (PreToolUse)
hooks/hooks.json:
```json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/validate-bash.sh"
}
]
}
]
}
}
```
scripts/validate-bash.sh:
```bash
#!/usr/bin/env bash
INPUT=$(cat)
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')
# Block destructive commands
DANGEROUS_PATTERNS=(
"rm -rf /"
"rm -rf ~"
":(){ :|:& };:"
"> /dev/sda"
)
for pattern in "${DANGEROUS_PATTERNS[@]}"; do
if [[ "$COMMAND" == *"$pattern"* ]]; then
echo "Blocked dangerous command pattern: $pattern" >&2
exit 2
fi
done
exit 0
```
### 3. Load Project Context (SessionStart)
hooks/hooks.json:
```json
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume",
"hooks": [
{
Excerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 46a2537
git clone https://github.com/Dicklesworthstone/pi_agent_rust git -C pi_agent_rust checkout 46a2537504c9
The author documents no install command, so this uses the repository directly. Our verdict covers commit 46a2537504c9 only.
Works in which agents?
What its own text says, not a test
| Agent | Status | More |
|---|---|---|
| Claude Code | Mentioned in its text, not tested | Skills for Claude Code · About Claude Code |
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
46a2537504c9
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/dicklesworthstone/hooks-reference/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
Dicklesworthstone/pi_agent_rust
Austrian public transport (VOR AnachB) for all of Austria. Query real-time departures, search stations/stops, plan routes between locations, and check service disruptions. Use when asking about Austrian trains, buses,…
Dicklesworthstone/pi_agent_rust
Austrian public transport (VOR AnachB) for all of Austria. Query real-time departures, search stations/stops, plan routes between locations, and check service disruptions. Use when asking about Austrian trains, buses,…
Dicklesworthstone/pi_agent_rust
Generate approval workflow generator operations. Auto-activating skill for Business Automation. Triggers on: approval workflow generator, approval workflow generator Part of the Business Automation skill category. Use…
Dicklesworthstone/pi_agent_rust
Create asana task creator operations. Auto-activating skill for Enterprise Workflows. Triggers on: asana task creator, asana task creator Part of the Enterprise Workflows skill category. Use when working with asana task…
Dicklesworthstone/pi_agent_rust
Audit Trail Helper - Auto-activating skill for Enterprise Workflows. Triggers on: audit trail helper, audit trail helper Part of the Enterprise Workflows skill category. Use when analyzing or auditing audit trail…
Dicklesworthstone/pi_agent_rust
Execute backlog grooming assistant operations. Auto-activating skill for Enterprise Workflows. Triggers on: backlog grooming assistant, backlog grooming assistant Part of the Enterprise Workflows skill category. Use…
Add this badge to your README
[](https://modelsatlas.com/skills/dicklesworthstone/hooks-reference/)
<a href="https://modelsatlas.com/skills/dicklesworthstone/hooks-reference/"><img src="https://modelsatlas.com/skills/dicklesworthstone/hooks-reference/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Hooks Reference
What does the Hooks Reference skill do?
Is Hooks Reference safe to install?
What can Hooks Reference access on my machine?
Which assistants does Hooks Reference work with?
How current is this page?
Sources
- github.com/Dicklesworthstone/pi_agent_rust/tree/main/tests/ext_c — the audited source at commit 46a2537504c9 and every finding aboveObserved · 10 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Hooks Reference skill do?
- Is Hooks Reference safe to install?
- What can Hooks Reference access on my machine?