[FEATURE] PostAssistantResponse
Resolved 💬 1 comment Opened May 31, 2026 by Dimajp Closed Jul 4, 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
Problem
Claude Code currently has no hook that fires after the assistant produces a text response. The existing hooks (PreToolUse, PostToolUse, SessionStart, SessionEnd) cover tool calls and session lifecycle, but there is no way to intercept assistant text output programmatically.
This makes it impossible to reliably pipe Claude's responses to external tools — log files, documentation sites, note-taking systems, etc. — without manual copy-paste.
Proposed Solution
Proposed solution
Add a PostAssistantResponse hook that fires after each assistant turn completes. The hook should receive the response text as input (via stdin or environment variable), for example:
{
"hooks": {
"PostAssistantResponse": [
{
"hooks": [
{
"type": "command",
"command": "cat >> ~/claude_responses.log"
}
]
}
]
}
}
The hook payload could follow the same pattern as existing hooks — a JSON object on stdin with at minimum:
{
"text": "<full assistant response text>",
"session_id": "..."
}
### Alternative Solutions
_No response_
### Priority
High - Significant impact on productivity
### Feature Category
Configuration and settings
### Use Case Example
Routing long responses to a local documentation site or sketchbook (avoiding terminal clutter)
Logging assistant output for review or auditing
Triggering notifications when a task completes
Post-processing responses with custom scripts (summarization, tagging, archiving)
### Additional Context
Why a pseudo-terminal wrapper does not work[¶](http://localhost:8005/#why-a-pseudo-terminal-wrapper-does-not-work)
A pty.spawn wrapper around the Claude Code binary captures raw terminal bytes including ANSI escape codes and Terminal User Interface chrome (borders, spinner, status bar). Extracting clean assistant text from that stream requires complex post-processing and is fragile. A first-class hook is the only reliable solution.
PreToolUse / PostToolUse hooks already demonstrate this pattern works well
Many users have asked for ways to log or redirect Claude output (see related issues) ```This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗