{"version":"2.1.277","anchor":"new-plugin-hook-event-promptattachment","canonical_anchor":"new-promptattachment-hook-type-lets-plugins-rewrite-or-dr","heading":"New prompt.attachment plugin hook lets hooks rewrite or drop attachment text","tier":"use","area":"Plugin Hooks","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.277\/e\/new-plugin-hook-event-promptattachment","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.277","markdown":"### New prompt.attachment plugin hook lets hooks rewrite or drop attachment text\n\nPlugins can now implement a prompt.attachment hook to rewrite or remove text attached to a message before it reaches the model\n\n**Unclear.** Whether `prompt.edit` does anything yet is unclear, since it appears in the event list without any visible dispatch wiring.\n\n**What** Claude Code adds a new hook event type, `prompt.attachment`, that plugins can implement to inspect and change text attached to a user's message. A hook can rewrite the attachment's text or leave it out entirely before it reaches the model. Claude Code logs what changed and which plugin or hook made the change, including whether the origin was the plugin, a hook, or the engine's own default handling.\n\n**Why** This lets plugins control what attachment content actually gets sent to the model, for example filtering or transforming pasted content before use, with a record of what was changed and by what.\n\n- Area: Plugin Hooks\n- Names: `prompt.attachment`\n- Tier: Use it now\n- Useful: 5\/5\n- Signal: 3\/5"}