PulseAugur
EN
LIVE 16:11:36
日本語(JA) UserPromptSubmitの使い方(Claude Code hooks)

Claude Code UserPromptSubmit hook adds context and blocks secrets

The UserPromptSubmit hook for Claude Code allows users to intercept and modify prompts before they are processed by the AI. This hook can be used to add contextual information, such as the current Git branch and uncommitted file count, or to block sensitive data like API keys from being sent to the model. The hook executes for various triggers, including user input, scheduled tasks, and background agent results. While it can prevent secrets from reaching the AI, it does not remove them from local storage. AI

IMPACT Enhances developer control over AI interactions by allowing pre-processing of prompts for context or security.

RANK_REASON Documentation of a specific feature within a product.

Read on dev.to — Claude Code tag →

AI-generated summary · Google Gemini · from 1 sources. How we write summaries →

Claude Code UserPromptSubmit hook adds context and blocks secrets

How we ranked this

Signal score
8 / 100
Composite score across the factors below. Higher = stronger signal that this story matters right now.
Newsworthiness bucket
Tool
Documentation of a specific feature within a product.
Source corroboration
Single-source cluster
Only one publisher covered this so far. Single-source stories can still rank when the publisher is high-authority, but they lack cross-source corroboration.
Topics
product, infra
Editorial topic classification. Feeds into how the story surfaces on /topic/<slug> hub pages and into the per-entity coverage mix.
AI-industry relevance
High
Clearly on-topic for AI-industry coverage.
Story freshness
Same-day
Cluster formed today. Ranking reflects the current source set at time of score.

Full methodology in our editorial standards.

COVERAGE [1]

  1. dev.to — Claude Code tag TIER_1 日本語(JA) · AgentKoji ·

    How to Use UserPromptSubmit (Claude Code Hooks)

    <p>UserPromptSubmit は、プロンプトを送ったとき Claude が処理する前に動く hook です。プロンプトに文脈を足したり、Claude に届く前に止めたりできます。ここでは「文脈を足す hook」と「API キーらしき文字列を止める hook」の要点をまとめます(Claude Code 2.1.309、2026年10月23日時点。スクリプトにダミー JSON を流して確認)。</p> <h2> いつ動くか </h2> <p>自分で打ったときだけでなく、次のときにも動きます。</p> <ul> <li>予約タスクが動いたとき(<co…