Intercept user prompts to run custom actions without an API call: either echo back a message or execute a shell script conditionally based on prompt content, enabling prompt-driven automation.
A Claude Code plugin that demonstrates hook-intercepted commands — slash commands that run code without consuming an API turn.

Normal slash commands send their content to Claude as a prompt. This pattern short-circuits that: a UserPromptSubmit hook intercepts the prompt, runs your code, and blocks the API call. Claude never sees it.
Three pieces:
commands/prompt-intercept-pattern.md) — registers the command in /help with autocomplete. disable-model-invocation: true prevents programmatic invocation. The file body is never sent to Claude.hooks/hooks.json) — wires UserPromptSubmit to the bash script.hooks/user_prompt_submit.sh) — matches the command, does work, outputs {"decision":"block","reason":"message for user"}.prompt-intercept-pattern/
├── .claude-plugin/
│ └── plugin.json
├── commands/
│ └── prompt-intercept-pattern.md # stub for /help
└── hooks/
├── hooks.json # wires the hook
└── user_prompt_submit.sh # does the work
claude --plugin-dir /path/to/prompt-intercept-pattern
Then type /prompt-intercept-pattern hello world. You'll see "Echoed: hello world" with no API call.
Open hooks/user_prompt_submit.sh and find the Side effects section. Replace the echo logic with your own: clipboard copy, file writes, notifications, whatever. The message variable is displayed to the user.
To rename the command, update three places:
name: field in commands/case match in user_prompt_submit.shargs parameter strip in user_prompt_submit.shAny command where the work is a side effect and sending a prompt to Claude is waste:
jq for JSON handlingMIT
No model invocation
Executes directly as bash, bypassing the AI model
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub kylesnowschwartz/prompt-intercept-patternCore SimpleClaude framework with intent-based commands and specialized agents
Unified review, refactoring, and cleanup workflows with specialized analysis agents
Skills and agents for diagrams, codebase patterns, hypothesis testing, Socratic thinking, file querying, frontend design, image generation, and command creation
Learn Claude Code by building real things, one level at a time
Enforces git diff thresholds to promote disciplined code review during AI agent sessions
Easily create hooks to prevent unwanted behaviors by analyzing conversation patterns
Quickly scaffold Claude Code hooks with templates, validation, and conflict analysis
Forces skill evaluation before every response
UserPromptSubmit hook to activate relevant skills via intent matching
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.