Skip to content

Agent pane: @ picks a file for the session's context - #549

Merged
vydra merged 2 commits into
mainfrom
claude/agent-pane-file-browser-38903d
Dec 5, 2026
Merged

vydra merged 2 commits into
mainfrom
claude/agent-pane-file-browser-38903d

Conversation

@vydra

@vydra vydra commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Typing @ in the coding agent pane's message box opens a list of files, as in Claude Code Desktop. Picking one adds it to the session's context.

What the user sees

  • @ at the start of the message or after a space opens a list over the box: the files of the folder the session works in, then, when the open specifications folder is another folder, its files, tagged with its name. A bare @ lists the files nearest the top.
  • Typing after the @ narrows the list with the Files tab's name search, with the matched letters highlighted. Ignored files and the app's own .specdriven/ store are never listed. At most 20 files from the session's folder and 10 from the specs folder are shown.
  • ↑/↓ move, Enter/Tab/click pick, Esc closes. With no match the list says so, and Enter sends. An @ inside a word (an e-mail address) opens nothing.
  • A picked file becomes @<path> in the message and a kept context chip. It goes with every message until removed, told to the agent in the existing [Context — …] line: relative to the agent's folder, or in full when it is elsewhere.

Changes

  • src/server/agentFiles.ts and GET /api/agent/files (local app only): matches from both folders, each with the ref the message carries and the path its words use.
  • src/server/agent.ts: checkRefs also accepts absolute paths inside the session's folder (create and message routes). Every other path is still refused, now with "refs must be paths inside the open folder or the session's folder".
  • src/server/codeSearch.ts: file lists cached for up to four folders instead of one; topFiles for a bare @.
  • AgentPane.tsx, agentChat.ts, index.css: the popup, its keys, and the hints.

Spec

specs/agents/agent-pane.feature.md S33 "@ picks a file for the context" (new), and S17's server bullet reworded. These live in the spec repo, not in this PR.

Testing

  • New tests in tests/agentEngine.test.ts (checkRefs, both folders and the caps, the routes, a picked file told to the agent) and tests/agentComposer.test.tsx (mentionAt/applyMention, the popup end to end).
  • bun test for the agent, codeSearch, api and files tests: 416 pass. tsc is clean.
  • Live check in a sandboxed server with a test-double agent: bare @, a query hitting both folders, keyboard picks of two files, and a send. The double was told the code file relative to its folder and the spec file by full path. @ also works in a running session's box.

vydra and others added 2 commits December 4, 2026 15:55
Typing "@" in the coding agent pane's message box opens a list of files,
like Claude Code Desktop: the folder the session works in first, then the
open specifications folder when that is another one. What follows the "@"
narrows the list with the Files tab's name search. Picking a file puts
@<path> in the message and adds the file as a kept context chip, so the
agent is told it with every message until it is removed.

- src/server/agentFiles.ts and GET /api/agent/files: the two folders'
  matches, at most 20 and 10, each with the path the message's refs carry
  and the one its words use; the app's .specdriven/ store is left out.
- src/server/agent.ts: checkRefs also takes absolute paths inside the
  session's folder (the create and message routes pass it); any other path
  is still refused.
- src/server/codeSearch.ts: the file lists are kept for up to four folders,
  and topFiles lists what a bare "@" shows.
- AgentPane.tsx / agentChat.ts / index.css: the popup, its keys (arrows,
  Enter/Tab, Escape), and the hints.

Spec: specs/agents/agent-pane.feature.md S33 (spec repo).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ctron-builder's asar

Two advisories published after main's last green audit:
- GHSA-3924-r96c-gp9w (minimatch 11.0.6-11.0.9): minimatch 11.0.10, in range.
- GHSA-c6wh-w8c3-cv3g (glob <=14.0.5): the only copy is glob 7.2.3 under
  @electron/asar, which app-builder-lib pins, and rimraf 2 — build tooling
  only, and glob 14's API would break asar, so it is ignored with the reason
  beside the other ignores.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vydra
vydra enabled auto-merge (squash) December 5, 2026 00:07
@vydra
vydra merged commit c9c85bb into main Dec 5, 2026
6 checks passed
@vydra
vydra deleted the claude/agent-pane-file-browser-38903d branch December 5, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant