{"version":"2.1.299","anchor":"plugin-hooks-can-read-prompt-attachments-by-id","canonical_anchor":"plugin-hooks-can-read-prompt-attachments-by-id","heading":"Plugin hooks can read images and documents attached to a prompt","tier":"use","area":"Plugins","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.299\/e\/plugin-hooks-can-read-prompt-attachments-by-id","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.299","markdown":"### Plugin hooks can read images and documents attached to a prompt\n\nPlugin hooks can now read, in chunks, the bytes of an image or document attached to the prompt being sent\n\n**What**\n\nPlugins are add-on packages that extend Claude Code, and a hook is code a plugin runs at a set moment. `prompt.submit` is the moment a prompt is sent. A new built-in tool lets a hook read the contents of an image or document attached to that prompt.\n\n- The hook asks with `{ id, offset }`, where `id` is the attachment's id from the prompt being sent.\n\n- Claude Code answers with a chunk of the file encoded as base64 (a way of writing binary data as text), plus a `next` offset for asking for the following chunk.\n\n- Claude Code refuses ids that do not belong to the prompt being sent.\n\n- Claude Code refuses attachments that point to a web address or a file path instead of carrying the data directly.\n\n**Why**\n\nPlugin authors can now work with images and documents a user pastes into a prompt. Before, hooks had no way to read them.\n\n- Area: Plugins\n- Names: `prompt.submit`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}