Skip to content

Copy turn

The copy-turn extension lets you copy a user or assistant result from the current session branch using a short hash. It is useful when you want to reuse an earlier answer, a command output, or an assistant message without retyping it.

Bundled with Selesai

Loaded automatically with Selesai; no per-extension npm install is required.

Manifest entry
./copy-turn.ts
Runtime surface
Slash command

Setup and prerequisites

  • This extension is bundled with Selesai. It is loaded automatically; you do not need to install it separately.
  • Available only in an interactive Selesai TUI session. RPC hosts have their own copy UI and do not receive terminal copy markers.
  • Works only on messages in the current session branch. Messages are matched by a SHA-1 hash of their cleaned content.

What it sets up

  • Registers a custom copy-turn message renderer that adds a copy marker below user messages and appends a marker to the final assistant message of each turn.
  • Maintains a per-branch set of hashes by reading ctx.sessionManager.getBranch().
  • Uses copyToClipboard from the Selesai runtime to copy matched content to the system clipboard.

What you can configure

Copy turn is a command-only extension. It accepts one argument and has no persistent settings.

No user configuration

This capability does not expose user-editable settings. Its behavior is controlled by the commands and runtime rules documented below.

Command, tool, and shortcut controls

Key / pathDescription
/cp <hash>Copy the content of the referenced user or assistant turn.

Source evidence

What you can do

  • Copy a user or assistant message result to the clipboard by typing its hash.
  • Use a short prefix as long as it is unambiguous. If multiple messages match, Selesai tells you the full hashes so you can disambiguate.

Commands, tools, and shortcuts

CommandDescription
/cp <hash>Copy the result of the matching message to the clipboard.

The matching messages are filtered to the current branch, excluding custom copy-turn rows. For bashExecution messages the copied text is the command plus its output; for other roles it is the text content with the marker stripped.

Limits and safety

  • /cp works on messages that are still in the current branch. Navigating to a different session branch changes the available hashes.
  • The hash is a content hash, so editing a message after it was rendered produces a different hash.
  • Empty results and ambiguous prefixes are rejected with a warning.
  • The extension removes copy markers from model context, so it does not inflate context with repeated markers.

Source evidence

Selesai version: 0.10.0