What
When Claude runs a shell command (a terminal command) as a background task, Claude Code sends a notification about it. That notification now includes durationMs: how long the command took from start to finish, in milliseconds.
Why
Anything reading these notifications can now see how long each background command ran.
Names in the bundledurationMs
Documented inclaude-code/agent-sdk/python
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 durationMs, on Test a mod.
| `turn.complete` | `() => ({ text: '' })`. Fire it with `$.turn.complete({ turnId: '...', reason: 'answer', answer: '...', durationMs: 0, isAborted: false })`. |plugins/mods/test see the edit
Added since
A small documentation edit on React to events with a mod touched a line naming durationMs after this was published.
| `turn.complete` | The turn ended, including a turn the user interrupted, where `e.isAborted` is `true`. `e.reason` is `answer`, `aborted`, `refusal`, or `error`. `e.answer` is Claude's final text, `e.durationMs` how long it took, and `e.…plugins/mods/events see the edit
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
A small documentation edit on React to events with a mod touched a line naming durationMs after this was published.