PRPM Now Supports Claude Code Hooks
Install automation scripts as packages—no JSON editing required
You can now install Claude Code hooks as packages. One command replaces manual JSON configuration. No copy-pasting, no hunting through settings files.
$ prpm install @prpm/prettier-on-save
✓ Installed @prpm/prettier-on-save@1.0.0
Merged hook into .claude/settings.json
Hook will trigger on: PostToolUse (Edit, Write)What Are Claude Hooks?
Hooks are automated scripts that run during Claude Code operations. Think git hooks, but for your AI assistant. When Claude writes a file, runs a test, or starts a session, hooks let you inject custom logic.
Common use cases:
- Run prettier after Claude edits code
- Log all bash commands Claude executes
- Block writes to sensitive files like
.env - Send desktop notifications when Claude needs input
- Validate code before it gets written
Claude Code supports 9 hook events:
| Event | Trigger Point |
|---|---|
PreToolUse | Before Claude calls a tool |
PostToolUse | After a tool completes |
UserPromptSubmit | When you submit a message |
SessionStart | When Claude Code starts |
SessionEnd | When Claude Code shuts down |
The Problem: Manual Setup
Before PRPM hook support, installing a Claude hook required multiple error-prone steps:
- Find the hook code (GitHub, docs, Twitter)
- Open
~/.claude/settings.jsonor.claude/settings.json - Understand the JSON structure
- Copy-paste the hook config
- Fix syntax errors (forgot a comma? start over)
- Repeat for every project
Want to share a hook with your team? Send them JSON and hope they paste it correctly. Want to update a hook? Manually edit every project's settings file.
The Fix: Hooks as Packages
Install a hook like any other package:
$ prpm install @prpm/prettier-on-save
✓ Installed @prpm/prettier-on-save@1.0.0
Merged hook into .claude/settings.json
Hook will trigger on: PostToolUse (Edit, Write)PRPM merges the hook into your existing settings without clobbering custom config. Multiple hooks in the same event? No problem—they run in parallel.
Where Hooks Install
Hooks install to your project's .claude/settings.json file:
$ prpm install @prpm/prettier-on-save
# Installs to: .claude/settings.json (project directory)Each project gets its own hooks. Commit .claude/settings.json to git so your team shares the same automation.
Tracking and Uninstalling
Each package in .claude/settings.json includes tracking metadata:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [{
"type": "command",
"command": "prettier --write ${file}"
}],
"__prpm_hook_id": "@prpm/prettier-on-save@1.0.0"
}
]
}
}The __prpm_hook_id field tracks which package installed the hook. When you uninstall, PRPM removes only that hook's config—your other hooks stay intact.
$ prpm uninstall @prpm/prettier-on-save
✓ Removed hook from .claude/settings.json
Cleaned up PostToolUse event (now empty)Hook Collections
Want a full workflow? Install a collection:
$ prpm install @prpm/secure-coding
# Installs:
# - @prpm/block-env-writes
# - @prpm/validate-credentials
# - @prpm/audit-file-deletes
# - @prpm/sensitive-data-scanner
✓ Installed 4 hooksCollections bundle related hooks. One command sets up your entire security policy.
Publishing Hooks
Creating a hook package:
$ mkdir my-hook && cd my-hook
$ prpm init
Format: claude
Subtype: hook
Name: my-awesome-hookWrite your hook in the package file (JSON format):
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [{
"type": "command",
"command": "echo \"Running: $(echo $CLAUDE_TOOL_INPUT | jq -r .command)\""
}]
}
]
}
}Publish:
$ prpm publish
✓ Published @yourname/my-awesome-hook@1.0.0Now anyone can install it: prpm install @yourname/my-awesome-hook
Real Examples
Here are hooks you can install right now:
Auto-format on edit:
prpm install @prpm/prettier-on-saveLog all bash commands:
prpm install @prpm/command-loggerBlock sensitive file writes:
prpm install @prpm/protect-env-filesDesktop notifications:
prpm install @prpm/desktop-alertsFull security suite:
prpm install @prpm/secure-codingTry It Now
# Install PRPM
npm install -g prpm
# Install a hook
prpm install @prpm/command-logger
# See it in action
# (next time Claude runs a bash command, it logs to ~/claude-commands.log)Browse available hooks at prpm.dev/search?format=claude&subtype=hook
What's Next
- Hook templates - Starter templates for common patterns
- Hook testing tools - Test hooks before deploying
- Hook marketplace - Curated collection of verified hooks
- Hook analytics - See which hooks save you the most time
Want to write hooks? Check out Claude Code Hooks Best Practices.