Pimp My IDE / garage dispatch
Back to garage
October 3, 2026 | editor state / agent controls

A highlight is not a handoff.

Selected text is temporary interface state. Before an extension or coding agent acts on it, capture the bytes, their origin, the intended action, and the approval.

The highlight tells you what the user pointed at. It does not tell you whether the text is fresh, where it came from, or what may happen next.
Selection custody clampLive pointer
if (userSelected) {
  captureSelection();
}
Current statePointer only

Selection just became a richer input.

Claude Code 2.1.288 added $.ui.selection() for mods. The release note says it returns the text last selected in fullscreen mode. When that selection sits inside one transcript row, it also returns the row.[1]

That is useful. A user can point at one part of a transcript instead of restating it. It also creates a small design problem. The word "last" describes a time relationship, not a durable identity. A mod still needs to decide when to read the selection, what context to retain, and whether an action needs another confirmation.

Selection is an input gesture. Turn it into a record before it becomes authority.

Editors already expose change, not permanence.

The Visual Studio Code extension API gives an editor a primary selection and a list of selections. Its selection-change event carries the editor, the new selections, and a change kind that may identify keyboard, mouse, or command input.[2]

Those fields help an extension observe editor state. They do not make the selected text durable. The document may change after selection. The active editor may change. A command can move the selection. If later work depends on the exact text, save the text with its document identity and revision before leaving the event or command that read it.

A source span and a text snapshot answer different questions. The span says where the user pointed. The snapshot says which bytes the extension received. Keep both when the action matters.

Direction and scope belong in the record.

MDN describes a document as having one selection object. It distinguishes the anchor, where selection began, from the focus, where it ended. A user can select in either direction. The selection also exposes its range count and whether it has collapsed to a caret.[3]

Most commands need normalized start and end positions. Some interface behavior may still care about direction. A collapsed selection should not quietly fall back to an old highlight. A range that crosses unrelated transcript rows should not inherit the context of one row.

Define that behavior before wiring the command. Reject an empty selection. Mark cross-row text as loose text. If one row supplies extra metadata, show that metadata in the preview before the action runs.

Use two stops, not one click.

  1. Read the current selection and reject an empty or unsupported range.
  2. Snapshot the exact text plus document or transcript identity.
  3. State the proposed action without running it.
  4. Show the captured text and action together.
  5. Ask for approval when the action can edit, send, execute, or disclose data.
  6. Save a receipt after the action with the result and current revision.

Read-only helpers can keep the approval light. Actions with side effects need a visible second stop. The distinction should follow the action, not the fact that the user highlighted something.

Interactive makeover / selection custody bench

Clamp the handoff.

Traditional purpose replaced: a command that acts on whatever is highlighted at invocation time. Better version: a visible packet joins selected text, origin, proposed action, and approval boundary before a tool can use it.

Selection packet inputs

Edit the sample and choose its scope. The controls draft a handoff record. They do not read an editor or run a command.

Selection scope
Custody sections to include
Generated custody packet

Follow the selected bytes

The solid rail stops at the first missing section. Later selections cannot hide an earlier custody gap.

Contiguous custody route0 of 4 sections connected
Custody packet incomplete.No custody section is selected.
Four selected sections mean the packet structure is ready. They do not prove the source is fresh, approval was granted, or an action ran.

Sources read

Source log and evidence boundary
  1. Anthropic, Claude Code v2.1.288 release notes, published October 2 and read October 3, 2026. The notes support the description of $.ui.selection(), its last-selection behavior, and the extra transcript-row return. The release API also listed signed checksum files and platform archives. We did not install or run the release.
  2. Microsoft, Visual Studio Code Extension API, read October 3, 2026. It supports the description of selection-change events, editor identity, selection arrays, and keyboard, mouse, or command change kinds. We also checked the published v1.140.0 type definitions.
  3. MDN Web Docs, Selection, read October 3, 2026. It supports the description of a document selection, anchor and focus direction, collapsed selections, and range count. The browser model is a comparison for interface-state semantics, not a claim about Claude Code's internal implementation.

Evidence boundary. The release note confirms the public feature description. It does not document every lifetime, staleness, or permission rule for mod selection data. The custody bench is a teaching aid. It drafts a packet and performs no editor integration, tool call, approval, or action.