[FEATURE] `PreResponse` hook event

Resolved 💬 3 comments Opened Mar 25, 2026 by Aisoga Closed Mar 26, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

The current hook lifecycle covers input validation (UserPromptSubmit, PreToolUse), tool execution (PostToolUse), and session management (Stop, SessionStart). However, there is no hook event that fires after tool use is complete but before the assistant's text response is delivered.

This creates a gap for use cases that need to inject context or enforce behavior at the moment Claude transitions from "working" to "responding."

Current lifecycle (simplified)

UserPromptSubmit -> [tool calls: PreToolUse/PostToolUse] -> ??? -> text response -> Stop

The ??? is the gap. There is no hook point between the last tool result and the assistant message.

Why existing hooks don't fill this gap

| Hook | Why it doesn't work |
|---|---|
| UserPromptSubmit | Fires too early — before any tool use or reasoning |
| PostToolUse | Fires after each tool call, not at the transition to response |
| Stop | Fires after the response is already delivered |
| Elicitation | MCP-specific, not a general-purpose response interceptor |

Proposed Solution

A new PreResponse hook event that fires once per turn, after all tool use is complete and before the assistant's text response is generated/streamed.

Suggested input

{
  "session_id": "abc123",
  "transcript_path": "/path/to/transcript.jsonl",
  "cwd": "/working/directory",
  "permission_mode": "default",
  "hook_event_name": "PreResponse",
  "tool_calls_count": 5
}

Suggested output

Support additionalContext injection (same as UserPromptSubmit), so hooks can add context that influences the response:

{
  "additionalContext": "Remember to include X before responding."
}

Optionally support decision: "block" to force another tool-use cycle before responding (e.g., if a required step was missed).

Alternative Solutions

  • TaskCompleted hook: Could gate deliberation behind task completion, but requires restructuring the protocol around tasks and adds per-prompt overhead for a workaround.
  • Stronger CLAUDE.md instructions: Works most of the time, but purely instruction-based — no system-level enforcement. We tested this and it fails predictably on the first technical prompt of a session.
  • PreToolUse as a proxy: Would fire on every tool call, requiring repeated "already done?" checks. Wasteful and can't catch the case where Claude responds without any tool calls.

Priority

High - Significant impact on productivity

Feature Category

Other

Use Case Example

We're building a "Thought Architecture Protocol" defined in CLAUDE.md that requires Claude to follow a structured reflection cycle on every prompt:

  1. Instinct — write a raw first-reaction file (enforced via UserPromptSubmit hook)
  2. Recall — run memory retrieval scripts
  3. Deliberation — write a reflection file synthesizing instinct + recall
  4. Respond — only then deliver the text response

Steps 1 and 4 are enforceable: UserPromptSubmit injects a reminder with a pre-generated timestamp for the instinct step, and Stop logs the exchange. But step 3 (deliberation) has no enforcement point — it sits in the gap between the last tool call and the response. A PreResponse hook would let us check whether the deliberation file was written and inject a reminder (or block the response) if it wasn't.

This pattern generalizes to any workflow that needs a "pause and reflect before speaking" checkpoint — code review checklists, safety checks, response quality gates, etc.

Additional Context

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗