Files
helder/docs/guide/pass-on-to-agent.md
T
2026-10-05 11:10:12 +02:00

102 lines
5.0 KiB
Markdown

# Pass on to Agent
Pass on to Agent sends a pointer to your code to the [Claude Code](claude-code.md) pane: a file path with a line or a line range, and optionally the selected code and a note. Copy reference puts the same pointer on the clipboard instead.
[Guide index](index.md) · Related: [File view](file-view.md), [Diff](file-view-diff.md), [Claude Code](claude-code.md), [Right-click menu](right-click-menu.md)
## At a glance
```text
app/Http/UserController.php:42-45 (1) menu header
+--------------------------------------+
| * Pass on selection | (2)
| Copy reference | (3)
+--------------------------------------+
+----------------------------------------------+
| * Pass on to agent [esc] | (4)
| +------------------------------------------+ |
| | Add a note (optional)... | | (5)
| +------------------------------------------+ |
| Inserts [ check the eager load app/Http/ ] | (6)
| [ UserController.php:42-45 ] |
| [ ``` ] |
| [ $user->load('roles'); ] |
| [ ``` ] |
| (enter) insert into agent (esc) cancel | (7)
+----------------------------------------------+
```
1. **Header**: the reference the menu acts on.
2. **Pass on**: "Pass on selection" with text selected, else "Pass on reference". Opens the prompt.
3. **Copy reference**: copies the reference to the clipboard.
4. **Prompt title**: marked with the amber spark that marks every pass-on action.
5. **Note field**: an optional note. The keyboard starts here.
6. **Inserts**: a live preview of the exact text that goes to the agent.
7. **Hints**: `Enter` inserts, `Esc` cancels.
## Features
### The reference format
- A single line: `path:line`, for example `app/Http/UserController.php:42`.
- A range of lines: `path:start-end`, for example `app/Http/UserController.php:42-58`.
- The path is relative to the project folder.
- With text selected, the range covers every line the selection touches.
- With nothing selected, the reference is the line you right-clicked.
### Right-click in the code
- Right-click anywhere in the [file view](file-view.md). The menu has exactly two items: a Pass on item and **Copy reference**.
- Without a selection: **Pass on reference** and **Copy reference**, for the clicked line.
- With a selection: **Pass on selection** (sends the reference and the selected code) and **Copy reference** (copies only the reference).
- In the Markdown [Preview](file-view-markdown.md) and on an image, the reference points at line 1 of the file.
- In the [Diff](file-view-diff.md), right-click a line on either side. The reference uses the line number of that side. The Diff passes on a reference, not code.
### Copy reference
- Puts the reference on the clipboard.
- A "Copied reference" [notification](notifications.md) shows the reference.
### The pass-on prompt
- Opens next to the click or the selection.
- Type a note, or leave the field empty.
- `Enter` inserts the text into the Claude Code pane. `Esc`, or a click outside the prompt, cancels without inserting.
- What is inserted:
- Reference only, no note: `app/User.php:42`
- Reference with a note: `check this => app/User.php:42`
- Selection: the note (if any) and the reference on one line, then the selected code in a fenced code block.
- A "Passed to agent" [notification](notifications.md) confirms the insert and shows the reference.
### How the text lands in Claude Code
- The text goes into Claude's input as pasted text. It is never submitted.
- You can read it, edit it, and press `Enter` in the Claude pane yourself when you are ready.
- The keyboard stays where it was. Click the Claude pane, or move focus there, to send.
### Stack several references
- Pass on as many references as you like before you send.
- When Claude's input already holds text, each new insert starts on a new line.
- Once you send (press `Enter` in Claude), the next insert starts a fresh message.
### Pass on with the keyboard
- Select text in the file view and press `Cmd+Right`. The prompt opens for that selection, with the code included.
- Without a selection, `Cmd+Right` in the code keeps its normal meaning (end of line).
### Other things you can pass on
- Files, folders and Git rows have their own pass-on items in their [right-click menu](right-click-menu.md), such as **Pass on file name**.
- The project [note](notes.md) can be passed on as a whole.
## Keyboard
| Keys | Action |
|---|---|
| `Cmd+Right` | Open the pass-on prompt for the selected code |
| `Enter` | Insert into the agent (in the prompt) |
| `Esc` | Cancel the prompt or close the menu |
| `Up` / `Down` / `Enter` | Choose a menu item |
## Related
- [Claude Code](claude-code.md): the pane that receives the text.
- [File view](file-view.md): select code and right-click.
- [File view: Diff](file-view-diff.md): pass on a line from the comparison.
- [Right-click menu](right-click-menu.md): all menus and their pass-on items.
- [Notifications](notifications.md): the confirmations after copy and pass on.