creating-claude-hooks
Build Secure Claude Code Hooks
Claude Code hooks are easy to misconfigure or expose to unsafe input. This skill provides practical patterns for hook structure, validation, testing, and PRPM publishing.
Stop for confirmation before installing.
Review the plan and obtain explicit user consent before changing files.
Install with my Agent
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Review the Skillstore skill "creating-claude-hooks" from https://skillstore.io/skills/agentworkforce-creating-claude-hooks.md and its manifest at https://skillstore.io/api/skills/agentworkforce-creating-claude-hooks/manifest. Verify the artifact. Stop and obtain explicit user consent before installing or changing files.Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Test it
Using "creating-claude-hooks". Create a project hook that blocks edits to secret files.
Expected outcome:
- A hook design with a clear event, input contract, and blocking behavior.
- A security review covering canonical paths, nested secret files, symlinks, and safe error messages.
- A test checklist for allowed files, blocked files, malformed input, and missing dependencies.
Using "creating-claude-hooks". Prepare my tested hook for PRPM publication.
Expected outcome:
A package checklist covering metadata, documentation, dependencies, local tests, security notes, publication steps, and semantic version selection.
Security Audit
High RiskAll 115 static alerts are false positives caused by Markdown formatting, documented commands, reference links, or defensive examples; SKILL.md does not execute them. Semantic review found bypassable path and sensitive-file checks that may guide users toward insecure hooks.
Confirmed security concerns (1)
Risk Factors
โ๏ธ External commands (50)
๐ Network access (3)
๐ Filesystem access (18)
๐ Env variables (1)
Share & cite this report
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
Copy report link
https://skillstore.io/skills/agentworkforce-creating-claude-hooks/audits/9?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown badge
[](https://skillstore.io/skills/agentworkforce-creating-claude-hooks?utm_source=security_passport_badge)HTML badge
<a href="https://skillstore.io/skills/agentworkforce-creating-claude-hooks?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/agentworkforce-creating-claude-hooks/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Embed card
<iframe src="https://skillstore.io/embed/skills/agentworkforce-creating-claude-hooks.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Academic citations (APA ยท BibTeX ยท CFF)
APA citation
AgentWorkforce. (2026). creating-claude-hooks security audit report (audit version 9) [Author version unspecified]. Skillstore. https://skillstore.io/skills/agentworkforce-creating-claude-hooks/audits/9BibTeX citation
@techreport{agentworkforce-agentworkforce-creating-claude-hooks-2026,
author = {AgentWorkforce},
title = {creating-claude-hooks security audit report (audit version 9)},
institution = {Skillstore},
year = {2026},
number = {9},
url = {https://skillstore.io/skills/agentworkforce-creating-claude-hooks/audits/9},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "creating-claude-hooks security audit report (audit version 9)"
version: "unspecified"
type: report
authors:
- name: "AgentWorkforce"
date-released: "2026-07-23"
url: "https://skillstore.io/skills/agentworkforce-creating-claude-hooks/audits/9"
identifiers:
- type: other
value: "skillstore:agentworkforce-creating-claude-hooks:audit:9"
description: "Skillstore immutable audit report identifier"
Skillstore Score
Why this score Evidence Confidence: MediumWhat You Can Build
Create a project hook
Build a focused hook for validation, formatting, logging, or environment checks within one repository.
Standardize team automation
Define consistent hook structure, failure behavior, dependency checks, and security controls across projects.
Publish a reusable hook
Prepare hook documentation, package metadata, tests, and semantic version updates for PRPM distribution.
Try These Prompts
Create a Claude Code session-start hook that prints a short status message. Explain its location, permissions, input, output, and exit code.
Build a tool-call hook that reads JSON input, validates the file path, handles missing jq, and reports failures through stderr.
Design a hook that blocks sensitive files and paths outside the project. Canonicalize paths, handle symlinks, and explain every security decision.
Review my hook for security, performance, schema compliance, packaging, and versioning. Produce a release checklist and identify any remaining risks.
Best Practices
- Treat every hook payload field as untrusted and validate it before use.
- Resolve and compare canonical paths before allowing file operations.
- Test hooks locally with missing fields, spaces, Unicode, symlinks, and dependency failures.
Avoid
- Do not interpolate untrusted input into shell commands or evaluate it as code.
- Do not rely on raw string prefixes or basename-only checks for path security.
- Do not log prompts, secrets, or sensitive file contents without explicit need and consent.
Frequently Asked Questions
Which hook events does this skill cover?
Does this skill install hooks automatically?
Which languages can I use?
Can it help publish a PRPM package?
How should a hook protect sensitive files?
Does it guarantee current Claude Code compatibility?
Developer Details
Author
AgentWorkforceLicense
MIT
Skillstore revision
r2
Version notice
The author did not declare a version.
Repository
https://github.com/AgentWorkforce/relay/tree/main/.claude/skills/creating-claude-hooks-skillRef
31bc7611b504c197d3e993aef7943461c871616f
Maintenance freshness
7/26/2026
Usage
7 downloads ยท 182 views
File structure
๐ SKILL.md