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 2 hours 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 19:32 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 19:37 UTC.

Upstream edited
Recorded here
Lines+8added
Lines−7removed
From line 1,296 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 1296, 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 1296
12961296| `compact` | Auto or manual compaction |
12971297| `fork` | A new session forked from an existing one: `--fork-session` with `--resume` or `--continue`, the `/fork` background copy, `/branch`, or a conversation you [move to the background](https://code.claude.com/docs/en/agent-view.md#from-inside-a-session) |
12981298 
1299When you start an interactive session, resume a conversation at launch with `--continue` or `--resume`, or run `/clear`, SessionStart hooks run in the background. You can type right away, and a conversation you resumed appears without waiting for the hooks. Claude's first response still waits for the hooks to finish, so their context reaches Claude.
1299When you start an interactive session, resume a conversation at launch with `--continue` or `--resume`, or run `/clear`, you can type while SessionStart hooks run. A conversation you resumed at launch appears without waiting for the hooks. When you run `/resume` inside a terminal session, you see the resumed conversation after its synchronous hooks finish. SessionStart hooks are [synchronous by default](#run-hooks-in-the-background).
13001300 
1301When you switch conversations with `/resume` inside a session, the switch waits for the hooks to finish instead. If you run `/clear` or switch to another conversation while background hooks are still running, nothing they return applies to the session.
1301While synchronous hooks are still running after launch or `/clear` in an interactive terminal session, Claude Code waits to send your prompt or discards their output:
13021302 
1303The same wait applies at launch, including a resumed session: a prompt you send while SessionStart hooks are still running doesn't reach Claude until they finish.
1303* **You send a prompt**: Claude Code sends the prompt after the hooks finish, so their context reaches Claude. To take the waiting prompt back into the input, press `Esc`. The hooks keep running.
1304* **You run `/clear`**: Claude Code discards what the hooks return.
13041305 
1305During either wait, press `Esc` to take the prompt back into the input without sending it. The hooks keep running.
1306If a plugin finishes loading after the session starts, your prompt can reach Claude without the context from that plugin's hooks.
13061307 
13071308#### SessionStart input
13081309 
from line 3641
36403641| `prompt_cache_warm` | boolean | Whether the current model's prompt cache is likely still warm, meaning the switch forfeits it |
36413642| `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"` |
36423643| `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 |
3643| `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 `"default"` when `to_model` has no known pric
3644| `pricing` | string | How Claude Code priced `estimated_cache_write_usd`: `"configured"` at your organization'
Feedback