From python-api
Create and register Claude Code hooks (PreToolUse, PostToolUse) as Python scripts. Use when user wants to create a hook, add a pre-edit check, post-edit formatter, block file edits, or automate responses to tool use.
How this skill is triggered — by the user, by Claude, or both
Slash command
/python-api:create-hookThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create a Claude Code hook through an interview, generate the Python script, and register it in `.claude/settings.json`.
Create a Claude Code hook through an interview, generate the Python script, and register it in .claude/settings.json.
Use AskUserQuestion to gather requirements. Batch into 2-3 calls.
Ask these together:
Edit|Write, Bash, * (all tools). See hook-conventions.md for full syntax.protect-migrations, auto-format-python). Confirm with user.After the interview, generate the hook script and register it.
.claude/hooks/<hook-name>.pytool_input fields relevant to the matchersys.exit(2) to block, print reason to stderrRead .claude/settings.json and update the hooks configuration:
hooks.<HookType> (e.g., hooks.PreToolUse)matcher value
hooks array{
"matcher": "<pattern>",
"hooks": [
{
"type": "command",
"command": "python3 .claude/hooks/<hook-name>.py"
}
]
}
Tell the user:
npx claudepluginhub cdcoonce/claude-workflow --plugin python-apiConfigures, creates, and troubleshoots Claude Code hooks like PreToolUse, PostToolUse, and UserPromptSubmit for automating tasks such as running tests before file edits or formatting outputs with jq.
Guides creation and configuration of Claude Code plugin hooks for events like PreToolUse, PostToolUse, Stop, and SessionStart using prompt-based and command types.
Guides creation of Claude Code plugin hooks for event-driven automation, including prompt-based and command hooks to validate tool use, enforce policies, and integrate external tools.