Original Reddit post

When using Claude Code for automation (–dangerously-skip-permissions) or building integrations, there’s no clean way to capture or transform output programmatically. Current state: - ctrl+o copies current response only (single iteration) - No hook fires after Claude generates a response - No way to intercept output for logging/transformation The hook lifecycle is missing the final piece: PreToolUse → gate/modify tool calls before execution PostToolUse → react to tool results after execution PostResponse → capture/transform final output ← MISSING Proposed PostResponse hook: // Hook receives: { “hook”: “PostResponse”, “response”: “The markdown response”, “tool_results”: [{“tool”: “Edit”, “status”: “success”}, …], “turn_number”: 5, “tokens_used”: 1234 } // Hook can return: { “transformed_response”: “Modified display text”, // optional “suppress_display”: false // optional } Use cases: - CI/CD integration with structured audit logs - Token/cost tracking dashboards - Slack/Discord notifications on task completion - Epistemic tracking frameworks (our use case: Empirica) - Redacting sensitive paths before display - Compressing verbose output for terminal This fits Claude Code’s plugin architecture better than adding CLI flags like --output-json. The hook is non-blocking (display proceeds normally) but enables rich integrations. Would this be on the roadmap? Happy to discuss design or contribute. submitted by /u/entheosoul

Originally posted by u/entheosoul on r/ClaudeCode