UserPromptSubmit Hook
The UserPromptSubmit hook is a Claude Code lifecycle event that fires the moment a user hits enter on a prompt, before Claude processes it. A shell command configured in `settings.json` receives the prompt text plus `cwd`, `session_id`, and transcript path on stdin, and can inject context, block the prompt, or rename the session on exit.
Anthropic shipped it in Claude Code 1.0.54 on July 16, 2025, alongside the addition of `cwd` to every hook input. It has since become the default entry point for prompt-side automation in the Claude Code ecosystem — the community repo disler/claude-code-hooks-mastery alone has 3.5k stars teaching patterns built around it.
A common community pattern: a UserPromptSubmit hook forks a background `claude -p --model haiku` call that reads the last few transcript turns and writes a 3-6 word title, so parallel Claude Code sessions get auto-generated tab names. Another variant looks up prompt keywords in a local docs index and injects matching context.
The doorman for every prompt — checks your coat, slips a note in your pocket, decides if you get in.
Search Interest
-
Nascent0–7 days
-
Emergent8–30 days
-
Validating31–90 days
-
Rising91–180 days
-
Established ← now180 days +
Why is it emerging now?
Nine months after shipping in Claude Code 1.0.54, UserPromptSubmit is the de-facto entry point for prompt-side automation — session auto-titling, doc-index context injection, "you're right" filters — and autocomplete is full of error queries that no tutorial has cleanly answered yet.
Outlook
6-month signal projection and commercial timeline.
Core Claude Code primitive with no replacement on the roadmap; error-tail autocomplete signals sustained, confused-user search demand for at least another year.
Risk · Anthropic could merge it into a broader 'prompt pipeline' API and deprecate the name, flattening the specific-term traffic.
Analogs · pre-commit hook · git hook · webhook
-
nowError tails, zero dedicated sites
Autocomplete errors unanswered; no dominant cookbook site. Pure content-gap SEO window.
-
3-6moPlugin marketplaces land
Paid hook bundles and curated marketplaces emerge as plugin distribution matures.
-
6-12moAPI rename risk
Anthropic may generalize to prompt-pipeline hooks; long-tail traffic depends on old name persisting.
Competition & Opportunity for term “UserPromptSubmit Hook”
Three heuristic signals derived from the tracked queries, the term's monetization cards, and its cluster neighbors. Directional, not audited.
Ideas for term “UserPromptSubmit Hook”
Buildable pitches — turn this term into an article, site, product, post, newsletter, video, or course. Steal any card and run with it.
Google autocomplete's top tails are all 'error' variants. Stitch Issues #13912 / #10225 / #8810 / #17284 / #17550 into one authoritative page — there isn't one yet, and the queries are high-intent.
Evergreen disambiguation article. Each hook fires at a different boundary; devs pick the wrong one and end up on Issue #17277. High search intent, shallow existing content.
UserPromptSubmit + retrieval index is the cleanest answer. Concrete walkthrough with a real docs corpus ranks for the category's most commercial tail — context-engineering-adjacent traffic.
Everyone rewrites the same five scripts. A single install with typed config undercuts the copy-paste gist culture. OSS with optional paid SaaS dashboard for team-shared logs.
Enterprises already log every prompt for compliance; a drop-in SaaS that turns the hook payload into searchable history + PII redaction is a $20/seat pitch.
First-person, 72-hour social post. The Lucian Wischik gist has the raw material; wrap it as a two-paragraph story with before/after transcripts. HN / X-native.
New hook repos ship weekly (veteranbv, byronfichardt, johnlindquist, Blugigi in the last 90 days alone). Curation is a defensible niche; feeds the same audience buying `claude-hook-kit`.
Hooks are visual: you see the shell command fire, the context inject, the session title change. Perfect screen-recording material; shallow competition beyond a handful of creator channels.
Between July 2025 and April 2026, a single new hook — UserPromptSubmit — turned Claude Code from a chat UI into a programmable terminal with pre-processors, validators, and context injectors.
Everyone rushes to wire up MCP servers. The quieter win sits above them: a 40-line UserPromptSubmit hook that enforces your project conventions on every single prompt, automatically.
A public gist from April 2026 showed how a tiny UserPromptSubmit hook rewrites Claude's sycophancy out of existence. The surprise: it's the first example that makes the hook obviously worth configuring.
What People Search
Long-tail queries from Google Suggest + Trends. Volume and competition are heuristics — directional, not audited. Content Type comes from query shape.
SERP of term “UserPromptSubmit Hook”
What searchers see today — organic results on top, paid ads if anyone's bidding. Ad density is a real-time commercial signal.
FAQ
What is UserPromptSubmit Hook?
The UserPromptSubmit hook is a Claude Code lifecycle event that fires the moment a user hits enter on a prompt, before Claude processes it.
Why is UserPromptSubmit Hook emerging now?
Nine months after shipping in Claude Code 1.0.54, UserPromptSubmit is the de-facto entry point for prompt-side automation — session auto-titling, doc-index context injection, "you're right" filters — and autocomplete is full of error queries that no tutorial has cleanly answered yet.
When did UserPromptSubmit Hook emerge?
Publicly emerged around 2025-07-16 (about 335 days ago as of 2026-06-16). EarlyTerms first recorded a pipeline signal on 2026-04-21.
Related Terms
Other terms in the same space — aliases, subtypes, competitors, and neighbors to explore next.
- Part of claude-code Claude Code is Anthropic's official command-line coding agent — a terminal tool that reads your codebase, edits files, runs commands,… →
- Related agents-md AGENTS.md is an open, vendor-neutral markdown file placed at the root of a repository that tells AI coding agents (Claude Code, Codex… →
- Related claude-agent-sdk Claude Agent SDK is Anthropic's programmatic toolkit for building AI agents on Claude. →
- Related context-engineering Context engineering is the discipline of curating every token that enters an LLM's context window — system prompt, tools, retrieved… →
- Related mcp-server An MCP server is a small, standalone program that exposes one capability — a database, a filesystem, a security scanner, a trading API —… →
- Related agent-harness An agent harness is the middleware between a large language model and the real world — code that runs the agent loop, calls tools,… →
- Related Stop hook A Stop hook is the Claude Code lifecycle event that fires every time the agent finishes a response turn. →
- Related ···
Sources
Primary URLs this report cites — open any to verify the claim yourself.
- 01 Claude Code Hooks reference — UserPromptSubmit code.claude.com ↗
- 02 Ian Nuttall — Claude Code 1.0.54 launch tweet (Jul 16, 2025) x.com ↗
- 03 disler/claude-code-hooks-mastery (3.5k stars) github.com ↗
- 04 DataCamp — Claude Code Hooks: A Practical Guide datacamp.com ↗
- 05 GitHub Issue #13912 — stdout error despite docs github.com ↗
- 06 GitHub Issue #27365 — updatedPrompt feature request github.com ↗
- 07 Lucian Wischik gist — 'You're right' filter hook gist.github.com ↗
- 08 Anthropic Agent SDK — hooks for agents platform.claude.com ↗