Follow Discord
Sweep 03 Dec 2026 · 19:13Z Build v2.1.336 553 read Stable v2.1.332 Latest v2.1.336 Next v2.1.336 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Hooks reference changedhooks

Nearest release: v2.1.335, published an hour after upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Upstream edited this page at 2 Dec 2026 20:24 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 2 Dec 2026 20:37 UTC.

Upstream edited
Recorded here
Lines+3added
Lines−1removed
From line 2,810 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits177to this page, all time

The whole hunk

from line 2810, old and new numbered
/
lines

This page is larger than the 256 KiB this site keeps, so one side of the diff below stops where the stored text does.

from line 2810
28102810}
28112811```
28122812 
2813SubagentStop hooks use the same decision control format as [Stop hooks](#stop-decision-control), including the `hookSpecificOutput.additionalContext` field with the `hookEventName` field set to `"SubagentStop"`, for non-error feedback that keeps the subagent running. Returning `decision: "block"` with a `reason` keeps the subagent running and delivers `reason` to the subagent. To inject context into the parent session after a subagent returns, use a [`PostToolUse`](#posttooluse) hook on the `Agent` tool instead.
2813To keep the subagent running, return `decision: "block"` with a `reason` field, or return a `hookSpecificOutput.additionalContext` field, as for [Stop hooks](#stop-decision-control). The subagent receives that text. In the `hookSpecificOutput` object, also set the `hookEventName` field to `"SubagentStop"`.
28142814 
2815To add context to the parent session after a foreground subagent returns, use a [`PostToolUse`](#posttooluse) hook on the `Agent` tool.
2816 
28152817### TaskCreated
28162818 
28172819Runs when a task is being created via the `TaskCreate` tool. Use this to enforce naming conventions, require task descriptions, or prevent certain tasks from being created. In a [session without the Task tools](https://code.claude.com/docs/en/tools-reference.md#task-tool-availability), this event doesn't fire.
from line 3643
36413643| `prompt_cache_warm` | boolean | Whether the current model's prompt cache is likely still warm, meaning the switch forfeits it |
36423644| `cache_ttl` | string | [Prompt cache lifetime](https://code.claude.com/docs/en/prompt-caching.md#cache-lifetime) of the main conversation at the time of this switch: `"5m"` or `"1h"` |
36433645| `estimated_cache_write_usd` | number | Estimated cost in US dollars of writing `context_tokens` to the prompt cache on `to_model` at the `cache_ttl` rate, excluding the next response. The server may not need to re-cache the whole context, so treat it as an estimate |
3644| `pricing` | string | How Claude Code priced `estimated_cache_write_usd`: `"configured"` at your organization'
3646| `pricing` | string | How Claude Code priced `estimated_cache_write_usd`: `"configured"` at your organization's own rates when it has configured them, `"catalog"` at list price, or `"
Feedback