Selection as Context
# Selection as Context ### Attaching selections from Warp's native code editor When you have Warp’s [native code editor](/code/code-editor/) open beside a regular pane, you can easily attach specific lines of code as context: 1. **Select text** in the editor. A tooltip will appear in the bottom-right corner of the selection. 2. **Add as context** by clicking the tooltip or using the keyboard shortcuts `Cmd + L` (macOS) or `CTRL + SHIFT + L` (Windows or Linux). 3. Warp automatically adds the relative file path and context, in addition to the line numbers of the hunk, as a formatted string into the prompt. This makes it easy to highlight just the lines you want the Agent to analyze or modify.  ### Attaching selections from Warp’s Code Review panel You can also directly attach context from the [Code Review panel](/code/code-review/): 1. Hover over any **diff hunk** to reveal the option to attach it as context.  2. Attaching a diff will automatically insert the relevant file path and changed lines into your prompt. This helps the Agent understand exactly what has been modified, making it easier to request explanations, feedback, or follow-up edits.  ### Attaching code to a third-party agent session You can select code, files, or snippets and feed them directly to a running third-party CLI agent session without copy-pasting or switching tools. When a third-party agent (Claude Code, Codex, OpenCode, etc.) is running in a Warp tab, select text in Warp's code editor or Code Review panel and attach it as context to that agent's session using `Cmd + L` (macOS) or `CTRL + SHIFT + L` (Windows/Linux). This works the same way as attaching context to Warp's built-in Agent. For more on third-party agent support, see [Third-Party CLI Agents](/agent-platform/cli-agents/overview/).Attach text or diffs directly from Warp’s editor or Code Review panel as context for your Agent prompts.
Attaching selections from Warp’s native code editor
Section titled “Attaching selections from Warp’s native code editor”When you have Warp’s native code editor open beside a regular pane, you can easily attach specific lines of code as context:
- Select text in the editor. A tooltip will appear in the bottom-right corner of the selection.
- Add as context by clicking the tooltip or using the keyboard shortcuts
Cmd + L(macOS) orCTRL + SHIFT + L(Windows or Linux). - Warp automatically adds the relative file path and context, in addition to the line numbers of the hunk, as a formatted string into the prompt.
This makes it easy to highlight just the lines you want the Agent to analyze or modify.

Attaching selections from Warp’s Code Review panel
Section titled “Attaching selections from Warp’s Code Review panel”You can also directly attach context from the Code Review panel:
- Hover over any diff hunk to reveal the option to attach it as context.

- Attaching a diff will automatically insert the relevant file path and changed lines into your prompt.
This helps the Agent understand exactly what has been modified, making it easier to request explanations, feedback, or follow-up edits.

Attaching code to a third-party agent session
Section titled “Attaching code to a third-party agent session”You can select code, files, or snippets and feed them directly to a running third-party CLI agent session without copy-pasting or switching tools.
When a third-party agent (Claude Code, Codex, OpenCode, etc.) is running in a Warp tab, select text in Warp’s code editor or Code Review panel and attach it as context to that agent’s session using Cmd + L (macOS) or CTRL + SHIFT + L (Windows/Linux). This works the same way as attaching context to Warp’s built-in Agent.
For more on third-party agent support, see Third-Party CLI Agents.