Repository navigation
Phase 4.5: agent context links (Ctrl+L / Ctrl+Shift+L) — 0.5.1 - #11
Merged
Merged
Conversation
Clean @path token with the range in words ('@src/foo.ts (lines 10-24) ', '@nb.ipynb (cell id, lines 3-5) ') so @-mention expansion in Claude Code and Pi is not broken by a suffix. Links go to the task's most recently used agent tab (per-window MRU), activated in its pane, via an 'agent-insert' window event. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PTY agent tabs (Pi, Claude, Codex) paste the link (bracketed paste when the TUI enabled it, no newline) and take focus; links that arrive before the PTY is spawned or while scrollback replays are queued. The Claude chat composer inserts at the caret. Both record agent-tab recency. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tree Editor: Monaco actions (keys + context menu) replace Monaco's own Ctrl+L and Ctrl+Shift+L; the selection, else the cursor line, or the whole file. Notebook: the same actions in the cell editor, a cell header button and a toolbar button; with no cell editor focused, a capture handler scoped to the notebook links the active cell or the notebook. Unsaved buffers (and cells whose id is not on disk yet) are saved first. File tree: 'Link to agent' in the context menu. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
'Link Selection to Agent' (Ctrl+L) and 'Link File to Agent' (Ctrl+Shift+L) in the palette list the shortcuts with Windows labels. A short banner explains when nothing was sent (no agent tab, save failed). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude Code expands @path into the whole file, so selection and cell links attached entire files/notebooks. Only whole-file links are @ mentions now; selections are a bare path + range the agent reads itself. Notebooks without stored cell ids got random stand-in ids on every parse, and the tab re-reads the file on a timer, so linked ids could be gone by the time the agent read the file. Stand-ins are now cell-N, repeated ids are made unique, and links name the cell by position plus its id only when the file stores it. Linking no longer saves just to write ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Testing in Claude showed a pointer is not enough: '@path (lines ...)' attached the whole file, and a bare 'path (lines ...)' attached nothing, leaving the agent to go read it. Ctrl+L now inserts a header naming the file / cell / lines plus the lines themselves in a fenced block (fence longer than any backtick run inside). Claude Code, Codex and Pi fold a multi-line paste into a chip. Over 20k chars a pointer is sent instead, with a notice. Cells read 'cell 1 of 5' so the numbering is clearly 1-based. Ctrl+Shift+L still sends @path. PTY tabs hold a multi-line snippet until the TUI has turned bracketed paste on, so a TUI still starting up never sees the newlines as Enter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… pointer" This reverts commit fd48fae.
Selections and cells are '@path (lines ...)' / '@nb.ipynb (cell N, id ...)' again — the form that worked in Codex and matches Cursor. Keeps the stable notebook cell ids and the cell position from the earlier fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tab bar showed two Claude buttons (default mode plus the other one). Now there is one: the chat icon when Settings picks chat, the Claude mark for the terminal. An open tab can still be switched between the two from its own tab. The palette entry is 'New Claude Tab' and opens the same mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Links to an agent in the right pane of a closed split open the split and are delivered; inserts are queued per tab until it subscribes, so a tab that mounts later still gets them. - PTY tabs paste only once attached (not merely spawn-started) and the agent TUI has turned bracketed paste on (10 s fallback), so links are not lost or typed into a starting TUI; a tab awaiting Resume says the link is queued. - Recency follows the agent tab last typed in, not the last one shown. - Palette commands act on the tab that had focus when the palette opened (no timer) and say so when none answers. - Palette 'Link Selection' in a notebook uses the open cell editor's selection, like Ctrl+L; stored cell ids are read from the file's cells, not substring-matched. - Notebook key handler uses Cmd on macOS / Ctrl elsewhere, matching Monaco; Control+L on a Mac no longer links from notebook chrome. - Monaco addAction registrations are disposed with their editor. - Tests for the insert queue, split routing, readiness, recency, palette routing, the shortcut matcher and stored cell ids. - The palette's New Claude Tab (claudeDefaultView) keeps its commit; ROADMAP gains a 'one agent per task' parking-lot idea. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A small chip at the end of a non-empty selection in editors and notebook cells, like Cursor's 'Add to chat', showing the platform shortcut. It appears once the selection settles, only while the editor has focus and the task has an agent tab, hides when the selection is cleared or the editor blurs, and links like the shortcut when clicked (mousedown keeps the editor's focus and selection). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cursor-style "add to chat" for any agent tab. In an editor or notebook tab:
@link to the selection — or the cursor line / focused cell when nothing is selected — into the task's agent input:@src/foo.ts (lines 10-24),@nb.ipynb (cell 2, id 3c8d9b5c, lines 3-5).@src/foo.ts.Nothing is submitted. The link goes to the task's most recently used agent tab (Pi / Claude / Codex terminal or Claude chat), which is activated and focused. Terminal tabs get a bracketed paste with no newline; a link for a not-yet-resumed Pi/Claude tab waits until it starts. Unsaved buffers are saved first. With no agent tab, a short notice is shown.
Notebook cell ids: notebooks without stored ids (nbformat < 4.5) got random stand-in ids on every parse, and the tab re-reads on a timer, so linked ids could vanish. Stand-ins are now stable (
cell-N), duplicate ids are made unique, and links name the cell by 1-based position plus the id only when the file stores it.Also bumps to 0.5.1 and closes Phase 4.5 in
ROADMAP.md. Includes one unrelated palette change (commands.ts: new AI tabs honourclaudeDefaultView) from parallel Claude tab work, kept here on purpose.Test plan
npm run typecheck,npm test(1039 passed),npm run build@pathand finds the section from cell/lines (accepted)test-windows) on this PR🤖 Generated with Claude Code