PostToolUse Hook - Claude Code
Fires after a successful tool call. Good for feedback and follow-ups.
PostToolUse runs after a tool call completes successfully. Use it to provide feedback, run side effects, or kick off follow-up actions.
What it does
The hook receives the tool name, arguments, and result. It can log the call, inject a follow-up instruction into the conversation, run a linter after every edit, or push a notification. Unlike PreToolUse, it can't prevent the call - it reacts to what already happened.
When to use it
- Running a formatter or linter after every file edit.
- Auto-staging files in git after Claude writes them.
- Posting a Slack notification when deploys happen.
- Auditing tool outcomes to an observability pipeline.
Gotchas
- The hook runs on every success, which can be many times per turn. Stay fast.
- Post-hooks can't roll back the tool call. If something was dangerous, catch it in PreToolUse.
- Injecting too much context via the hook inflates the next turn's tokens.
Official docs: https://code.claude.com/docs/en/hooks.md#posttooluse
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
Was this helpful?




