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

Draw in the interface with a mod changedplugins/mods/interface

Nearest release: v2.1.333, published an hour 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 30 Nov 2026 17:58 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 30 Nov 2026 18:07 UTC.

Upstream edited
Recorded here
Lines+15added
Lines−11removed
From line 2 where the diff opens
First seen 1 Oct 2026 this site's first read of the page
Recorded edits47to this page, all time

The whole hunk

from line 2, old and new numbered
/
lines
from line 2
22 
33> Draw panes, a band above the prompt, buttons, and text fields from a Claude Code mod, handle presses and input, and keep state between redraws and sessions.
44 
5A mod can draw its own interface in Claude Code and change parts of the interface Claude Code already draws. Each place a mod can draw is called a [render site](https://code.claude.com/docs/en/plugins/mods/reference.md#render-sites), such as a pane, the band above the prompt, or the spinner. Claude Code fires the [`ui.render`](https://code.claude.com/docs/en/plugins/mods/reference#interface) event each time it's about to draw a render site, and your hook for that event returns what to draw there.
5A mod can draw its own interface in Claude Code and change parts of the interface Claude Code already draws. Each place a mod can draw is called a [render site](https://code.claude.com/docs/en/plugins/mods/reference.md#render-sites), such as a pane, the band above the prompt, or the spinner. Claude Code fires the [`ui.render`](#pick-where-to-draw) event each time it's about to draw a render site, and your hook for that event returns what to draw there.
66 
77This map shows where a mod can draw in a terminal session:
88 
from line 14
1414 
1515> [!NOTE]
1616>
17> To look up one prop or limit, see the [reference](https://code.claude.com/docs/en/plugins/mods/reference.md#render-sites).
17> To look up one prop or limit, see the [reference](https://code.claude.com/docs/en/plugins/mods/reference.md).
1818 
1919## Build a pane with tabs
2020 
from line 284
284284 
285285A pane appears only when your mod opens it. How and when you open it decides whether it takes keyboard focus, how much room it asks for, and whether it shows at all in a narrow terminal.
286286 
287To open a pane, call [`$.ui.open`](https://code.claude.com/docs/en/plugins/mods/reference#mods-api-methods) with an `id` you choose. The `id` is the pane's name: your `ui.render` hook checks for it, and you pass it again to close the pane. If another mod has a pane open with that `id`, the call rejects.
287To open a pane, call `$.ui.open` with an `id` you choose. The `id` is the pane's name: your `ui.render` hook checks for it, and you pass it again to close the pane. If another mod has a pane open with that `id`, the call rejects.
288288 
289289```javascript theme={null}
290290await $.ui.open({ id: 'hello-tabs', title: 'Hello tabs', focus: true })
from line 335
335335 
336336### Draw in the VS Code extension
337337 
338In the VS Code extension, what a mod draws appears in the chat panel with extension version 2.1.299 or later. A session that [doesn't fetch feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), such as one on Amazon Bedrock, needs 2.1.304 or later. In a `ui.render` hook for the panel, `e.surface` is `vscode`. To check which sites and elements the panel draws, and which props it ignores, see the [render sites](https://code.claude.com/docs/en/plugins/mods/reference.md#render-sites) and [elements](https://code.claude.com/docs/en/plugins/mods/reference.md#elements) tables.
338In the VS Code extension, what a mod draws appears in the chat panel with extension version 2.1.299 or later. A session that [doesn't fetch feature flags](https://code.claude.com/docs/en/env-vars.md#features-that-need-feature-flag-fetching), such as one on Amazon Bedrock, needs 2.1.304 or later. In a `ui.render` hook for the panel, `e.surface` is `vscode`. To check what the panel draws, see the [render sites](https://code.claude.com/docs/en/plugins/mods/reference.md#render-sites) and [elements](#build-a-tree-from-elements) tables and the [props it ignores](https://code.claude.com/docs/en/plugins/mods/reference.md#vs-code-ignored-props).
339339 
340340To make a mod work in the panel as well as the terminal, account for these differences:
341341 
from line 354
354354 
355355**1. Place the row**
356356 
357Call [`$.ui.place`](https://code.claude.com/docs/en/plugins/mods/reference#mods-api-methods) with an `id`. The `id` is a name you make up for the row, such as `build-status`. It can be 1 to 64 letters, digits, `_`, or `-`, and each row your mod has in the transcript needs its own.
357Call `$.ui.place` with an `id`. The `id` is a name you make up for the row, such as `build-status`. It can be 1 to 64 letters, digits, `_`, or `-`, and each row your mod has in the transcript needs its own.
358358 
359359**2. Draw the row**
360360 
from line 928
928928| `Client` | A region drawn by a second file of yours, for animation and pointer input. That file gets no mods API. It reaches your hooks by posting data, which arrives as a `ui.message` event. If it fails to load, draw, or run, your hooks receive a [`ui.fault`](https://code.claude.com/docs/en/plugins/mods/reference#interface) event. | Terminal, Desktop |
929929| `Raster`, `Image` | A [grid of colored cells](#draw-a-grid-of-colored-cells), and a picture | Terminal |
930930 
931> [!NOTE]
932>
933> Spacing step names and the `Text` props `size`, `weight`, `mono`, and `tabular` require Claude Code v2.1.299 or later. On an earlier release, a tree that uses one doesn't draw.
934 
931935If your module is a `.tsx` or `.jsx` file, you can write the tree as JSX. Destructure the elements from `$.ui.resolve(e)` first.
932936 
933937If your drawing doesn't show up, check its tree for a prop an element doesn't take or a child where none goes. A hook that returns such a tree [fails](https://code.claude.com/docs/en/plugins/mods/events.md#handle-a-hook-that-fails), and a [`hook skipped` line](https://code.claude.com/docs/en/plugins/mods/troubleshoot#a-pane-or-band-is-empty) names your mod and the rule the tree broke. For a `Text` in a pane with a prop named `bogusProp`, that line reads:
from line 954
950954 
951955In the terminal, when the file a `Client` runs fails, a dimmed line such as `my-mod: Client client/spinner.js: boom` takes the `Client`'s place, and the rest of your drawing still shows.
952956 
953If your mod handles [`ui.fault`](https://code.claude.com/docs/en/plugins/mods/reference#interface), Claude Code then [draws the site again](#when-claude-code-redraws-without-being-asked).
957If your mod handles `ui.fault`, Claude Code then [draws the site again](#when-claude-code-redraws-without-being-asked). The event requires Claude Code v2.1.289 or later.
954958 
955959### Draw a grid of colored cells
956960 
from line 1021
10171021 
10181022### Keyboard focus and hotkeys
10191023 
1020Your mod never reads the keyboard itself. The user presses a key, Claude Code decides which of your controls it's for, and that control's callback runs. Apart from a [digit hotkey on the band or an `action` binding](https://code.claude.com/docs/en/plugins/mods/reference#elements), that happens only while your pane or band has keyboard focus. The rest of the time, keys go to the prompt.
1024The user presses a key, Claude Code decides which of your controls it's for, and that control's callback runs. Apart from a [digit hotkey on the band or an `action` binding](https://code.claude.com/docs/en/plugins/mods/reference#look-up), that happens only while your pane or band has keyboard focus.
10211025 
10221026In the [VS Code extension](#draw-in-the-vs-code-extension), buttons have no hotkeys: the user clicks a button or presses Enter on it, and types into fields.
10231027 
from line 1065
10611065| With brackets, the default | `[ Add one ]`, with no hotkey shown | The label with a small key beside it | The label, and the hotkey does nothing |
10621066| With `plain: true` | `1: One` | The label with a small key beside it | The label, and the hotkey does nothing |
10631067 
1064In the terminal, name the key in a bracketed button's label, or use `plain: true`, so the user can see what to press. The [elements reference](https://code.claude.com/docs/en/plugins/mods/reference.md#elements) has the other `Button` rules: `action`, digit hotkeys on the band, and two buttons on one hotkey.
1068In the terminal, name the key in a bracketed button's label, or use `plain: true`, so the user can see what to press. The [type declarations](https://code.claude.com/docs/en/plugins/mods/reference.md#look-up) have the other `Button` rules: `action`, digit hotkeys on the band, and two buttons on one hotkey.
10651069 
10661070#### When the user collapses the band
10671071 
from line 1080
10761080▸ plugin panel hidden · ctrl+x ctrl+a or click to show
10771081```
10781082 
1079The same keys, or in fullscreen rendering a click on the row, expand the band again. Until then, nothing presses a button in it: no hotkey, no digit typed into an empty prompt, and no keybinding for a button's [`action`](https://code.claude.com/docs/en/plugins/mods/reference#elements). If the band has keyboard focus when the user collapses it, the focus returns to the prompt, and Ctrl+X then Tab skips the band while it's collapsed.
1083The same keys, or in fullscreen rendering a click on the row, expand the band again. Until then, nothing presses a button in it. If the band has keyboard focus when the user collapses it, the focus returns to the prompt, and Ctrl+X then Tab skips the band while it's collapsed.
10801084 
10811085The band stays collapsed until the user expands it, even after `/clear`, and is expanded again the next time Claude Code starts. Your mod can't expand it. Don't make the band the only place your mod shows something the user has to answer. To show that elsewhere only while the band is collapsed, read `e.props.isCollapsed` in your `ui.render` hook, which keeps running. `isCollapsed` requires Claude Code v2.1.321 or later.
10821086 
from line 1187
11831187 
11841188### When Claude Code redraws without being asked
11851189 
1186Claude Code runs your `ui.render` hook again when the site's props change or the terminal's width changes. When a `Client` in the site fails and your mod handles [`ui.fault`](https://code.claude.com/docs/en/plugins/mods/reference#interface), Claude Code runs the hook once more after your `ui.fault` hooks return, so your `ui.render` hook can leave the `Client` out. It doesn't run the hook on a timer, and it can't tell when a variable in your module changes.
1190Claude Code runs your `ui.render` hook again when the site's props change or the terminal's width changes. When a `Client` in the site fails and your mod handles [`ui.fault`](#when-a-client-fails), Claude Code runs the hook once more after your `ui.fault` hooks return, so your `ui.render` hook can omit the `Client`. It doesn't run the hook on a timer, and it can't tell when a variable in your module changes.
11871191 
11881192### Redraw when your data changes
11891193 
from line 1393
13891393* [React to events](https://code.claude.com/docs/en/plugins/mods/events.md): feed your drawing from tool calls and turns
13901394* [Use the mods API](https://code.claude.com/docs/en/plugins/mods/api.md): feed your drawing from timers and model calls
13911395* [Test a drawing](https://code.claude.com/docs/en/plugins/mods/test.md#test-a-drawing): press your buttons from a test, on more than one surface
1392* [Render sites](https://code.claude.com/docs/en/plugins/mods/reference.md#render-sites) and [elements](https://code.claude.com/docs/en/plugins/mods/reference.md#elements): each site's props and each element's props
1396* [Mods reference](https://code.claude.com/docs/en/plugins/mods/reference.md): where to look up a prop, which app draws each site, and the limits
13931397 
Feedback