Vibe Coding
Tip: Use PostToolUse Hooks to Replace Tool Output for Custom Agent Pipelines
Claude Code 2.1.121 extends PostToolUse hooks so that hookSpecificOutput.updatedToolOutput now works for ALL tools, not just MCP tools. This means you can write a hook that intercepts any tool's output (Bash, Read, Edit, etc.) and replaces it with transformed content before the agent sees it. Use cases: stripping sensitive data from command output, injecting additional context after file reads, or reformatting large outputs to stay within context budgets. Previously this was MCP-only, limiting its utility.
Source
↳ Follow the thread