{"version":"2.1.292","anchor":"hooks-modelcomplete-accepts-cached-promptsystem-blocks","canonical_anchor":"hooks-modelcomplete-accepts-cached-promptsystem-blocks","heading":"Hooks can use prompt caching when calling the model","tier":"use","area":"Hooks","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.292\/e\/hooks-modelcomplete-accepts-cached-promptsystem-blocks","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.292","markdown":"### Hooks can use prompt caching when calling the model\n\nHooks calling $.model.complete can now pass promptBlocks and systemBlocks and mark blocks with cache: true for prompt caching\n\n**What**\n\nHooks are your own scripts that Claude Code runs at set points. A hook that asks the model a question through `$.model.complete` can now pass `promptBlocks` and `systemBlocks` instead of a single plain text prompt and system message. Each block is `{ text }` and can also include `cache: true`.\n\n- Blocks marked `cache: true` are sent as cacheable blocks. Caching lets a repeated part of a prompt be reused instead of processed again.\n\n- If caching is disabled, Claude Code drops those cache markers.\n\n- Badly shaped input is rejected with specific error messages.\n\n**Why**\n\nHook authors who send the same long text again and again can use prompt caching.\n\n- Area: Hooks\n- Names: `promptBlocks`, `systemBlocks`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}