[FEATURE] Add terminal selection → chat reference (like Cursor's inline terminal chip)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When debugging or discussing command output with Claude Code inside an IDE (VS Code/JetBrains), the only way to bring terminal output into the conversation is to reference the entire terminal via @terminal:<name> or copy/paste manually. In long-running or noisy terminal sessions (dev servers, test watchers, build logs), the relevant output is often just a handful of lines buried in a much longer scrollback. There's no way to select just the lines that matter and attach them as scoped context, the way editor text selection already works.
Proposed Solution
Allow selecting a range of lines in the IDE's integrated terminal and attaching that specific selection to the chat as a reference chip (similar to how selecting code in the editor already becomes a context reference today). Concretely:
- Select a range of terminal output with the mouse/keyboard, same as selecting editor text.
- A keyboard shortcut or right-click action ("Add terminal selection to Claude") attaches just that range to the next message, shown as a chip (e.g.
zsh (42-58)). - Claude receives only the selected lines as context, not the whole terminal buffer.
Alternative Solutions
- Currently using
@terminal:<name>, which pulls in the entire terminal's output rather than a specific range. - Manually copy/pasting the relevant lines into the chat, which is slower and easy to get wrong (missing lines, extra noise).
- Cursor supports this exact workflow today — selecting terminal text creates an attached reference chip (e.g.
zsh (1-16)) without manual copy/paste.
Priority
Medium - Would be very helpful
Feature Category
IDE integration (VS Code)
Use Case Example
- I'm running a dev server in the VS Code integrated terminal and it throws a stack trace among hundreds of lines of log output.
- I select just the ~15 lines containing the error and stack trace.
- With this feature, I could attach that exact selection to my message instead of using
@terminal:name(which would include the entire noisy log) or manually copying the text. - This saves time and keeps the context sent to Claude precise, especially in long-running sessions where the terminal buffer is thousands of lines long.
Additional Context
- Cursor has this exact feature today: selecting terminal output creates an attached chip like
zsh (1-16)next to the chat input, scoped to just that line range. - Claude Code today supports
@terminal:<name>(whole terminal) and automatic editor-selection context (for files) — this request is to extend the same "selection → context reference" pattern from the editor to the terminal, with a scoped range instead of the whole buffer.