{"version":"2.1.304","anchor":"uirender-hook-in-the-hooks-module-scan-list","canonical_anchor":"uirender-hook-in-the-hooks-module-scan-list","heading":"Plugin hook modules gain a ui.render hook and redraw-on-press","tier":"internal","area":"Plugins","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.304\/e\/uirender-hook-in-the-hooks-module-scan-list","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.304","markdown":"### Plugin hook modules gain a ui.render hook and redraw-on-press\n\nPlugin hook modules can now be scanned for a `ui.render` hook, and a UI press can return a freshly drawn tree in one step\n\n**Unclear.** It is not clear whether mods can use the `ui.render` hook yet or whether it is switched off.\n\n**What**\n\nPlugin hook modules are pieces of plugin code that run when certain events happen in Claude Code, and some can draw their own interface. Changes:\n\n- `ui.render`: the list of hooks Claude Code scans modules for now includes `ui.render`, next to `command.run`, `skill.prompt` and `classic.SubagentStop`.\n\n- Composer drafts: the path that writes into the message box now passes decorations to `fillDraft`, and a render call passes `detail` and `terminalWidth`.\n\n- `ui_press`: this request, sent when a user presses something in a plugin's interface, now accepts `press_id` and `render`. When `render` is given, the reply includes a freshly drawn tree. If that drawing is invalidated it is retried, and the retry gives up with `draw_overtaken`. Before, `ui_press` returned only `handled` and `element`.\n\n**Why**\n\nPlugins appear to be getting a place to draw interface elements, and apps showing them can get the updated screen in the same reply as a press, without asking again.\n\n- Area: Plugins\n- Names: `ui.render`\n- Tier: Under the hood\n- Useful: 3\/5\n- Signal: 4\/5\n- Scope: individual\n- Heads-up: no"}