Feature Request: Hook for assistant text output (PreResponse / PostResponse)

Resolved 💬 9 comments Opened Mar 21, 2026 by yonghyeon-dev Closed Jun 7, 2026

Problem

Currently, Claude Code hooks can intercept tool calls (PreToolUse, PostToolUse, TaskCompleted, TeammateIdle, Stop, SessionStart, PostCompact) but there is no hook for assistant text output.

This means behavioral rules like "don't write filler messages" or "don't write speculative answers" cannot be mechanically enforced. They can only be placed in rules/CLAUDE.md/auto memory as text — which the model can and does ignore under pressure.

Use Case

We built a comprehensive cowork system (Agent Teams + 10 hooks + 7 agents + knowledge base) to enforce implementation quality. Everything that involves tool calls is mechanically enforced. But the assistant's TEXT responses (status updates, filler messages, speculative answers) bypass all enforcement.

Examples of behaviors we cannot enforce:

  • "Don't write '대기 중입니다' (waiting) as a standalone message"
  • "Don't speculate — verify before answering"
  • "Don't apologize without taking corrective action"
  • "Report teammate objections to the user accurately, don't minimize them"

These are in auto memory feedback rules, CLAUDE.md, and project rules — but the model ignores them when under task pressure.

Proposed Solution

Add PreResponse or PostResponse hook events:

{
  "hooks": {
    "PreResponse": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "bash check-response.sh",
            "timeout": 5
          }
        ]
      }
    ]
  }
}
  • PreResponse: Fires before the assistant's text is shown to the user. Exit 2 = block response + feedback.
  • PostResponse: Fires after the assistant responds. Exit 2 = send feedback for correction.

Input would include:

{
  "response_text": "대기 중입니다.",
  "session_id": "...",
  "hook_event_name": "PreResponse"
}

This would allow mechanical enforcement of text output patterns, completing the enforcement gap in the current hook system.

Environment

  • Claude Code v2.1.80
  • Windows 11, Git Bash
  • Agent Teams enabled
  • 10 hooks configured (PreToolUse, TaskCompleted, TeammateIdle, Stop, SessionStart, PostCompact)

🤖 Generated with Claude Code

View original on GitHub ↗

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