{"version":"2.1.289","anchor":"new-ui-read-selection-client-capability-for-plugin-uisele","canonical_anchor":"new-ui-read-selection-client-capability-for-plugin-uisele","heading":"Plugins can read the user's selected text through ui_read_selection","tier":"internal","area":"Plugin UI","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.289\/e\/new-ui-read-selection-client-capability-for-plugin-uisele","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.289","markdown":"### Plugins can read the user's selected text through ui_read_selection\n\nA new `ui_read_selection` request lets a plugin's `$.ui.selection` read text the user has selected in an attached client\n\n**What**\n\nPlugins can now ask what text the person has selected. In a headless session (one running without Claude Code's own terminal screen), a plugin's `$.ui.selection` sends a new request, `ui_read_selection`, to the attached clients, meaning the apps or pages showing the session.\n\n- Opt in: a client receives the request only if it lists `ui_read_selection` under `answers` when it attaches with `ui_attach`. Before, that list covered only `ui_copy` and the prompt requests (`ui_prompt_read`, `ui_prompt_fill`, `ui_prompt_suggest`).\n\n- Answers: every client that opted in is asked. The first non-empty selection wins. If no client answers within 5 seconds, the plugin gets nothing.\n\n- Where it travels: the request goes only over the host's own pipes, never over the remote transport.\n\n- Context: the plugin context object gains a `selection` entry next to `composer`.\n\n**Why**\n\nA plugin can now act on what the person has highlighted in a connected app, while the request stays off the remote connection and only reaches clients that chose to answer it.\n\n- Area: Plugin UI\n- Names: `ui_read_selection`\n- Tier: Under the hood\n- Useful: 4\/5\n- Signal: 4\/5\n- Scope: individual\n- Heads-up: no"}