What
A hook is a command that runs automatically at a set point. A PostToolUse hook runs after Claude successfully uses a tool, such as editing a file. Managed hooks are hooks set by an organization.
When only managed hooks are allowed, Claude Code now passes the tool call's duration in milliseconds to PostToolUse hooks. Before, no duration was passed on that path.
Why
Organization hooks can now see how long each tool ran.
Names in the bundlePostToolUse
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Confirmed since
Anthropic's documentation has since written up PostToolUse, on Agent SDK reference - TypeScript.
On Claude Code v2.1.227 or later, a hook's [`systemMessage`](/docs/en/hooks#json-output) can arrive as this message, with each line prefixed by the hook's name, such as `PostToolUse:Bash says:`. Each [event's section](/docs/en/hooks#hook-e…agent-sdk/typescript see the edit
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubt
It is not known how the duration appears in the input a hook receives.
Anthropic's documentation agrees
Anthropic's documentation has since written up PostToolUse, on Agent SDK reference - TypeScript.