Add inline @ file-path completion - #4
Merged
Merged
Conversation
Type @ at a word boundary to open a live-filtering file menu that floats just above the prompt: ↑/↓ to move, tab/↵ to insert, esc to dismiss. The chosen "@path" is inserted with its leading @ on purpose — the claude subprocess expands @relative/path into the file's contents even over the headless stream-json input path (verified by probing: no Read tool_use, content injected), so this is real mention support, not just path-typing. The menu is non-modal (keystrokes fall through to the textarea; a tail syncCompletion re-derives the @-token under the cursor), git-aware (git ls-files, respecting .gitignore, with a directory-walk fallback), and reuses the picker's fuzzy scorer. Rendered via a new anchored placeOverlayAt sibling of the centered placeOverlay. New: complete.go, repofiles.go, complete_test.go. Docs: CLAUDE.md architecture note.
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.
Adds a Claude-Code-style inline
@file picker to the prompt.What
@at a word boundary → a live-filtering file menu floats just above the prompt. ↑/↓ move, tab/↵ insert, esc dismisses (and stays dismissed until you leave the token). Enter accepts the completion instead of submitting the turn.@path(keeping the leading@) — see verification below.git ls-files --cached --others --exclude-standard, respects.gitignore; directory-walk fallback outside a repo). Reuses the picker's fuzzy scorer.Verified:
@is real mention supportProbed the
claudesubprocess over the exact headless stream-json input path cathode uses (credentials scrubbed). Sending a turn containing@go.modreturned the correct content with noReadtool_use in the stream; a control probe with an unguessable marker in a temp file came back verbatim, again with zero tool calls. So the CLI expands@relative/pathinto file contents in headless mode too — which is why the completion keeps the@.How it fits
update.go's tail callssyncCompletion, which re-derives the@-token under the cursor (atToken).keys.goonly intercepts navigation while the menu is open.placeOverlayAt(sibling of the centeredplaceOverlay).Files
New:
complete.go,repofiles.go,complete_test.go. Modified:keys.go,update.go,view.go,overlay.go,model.go,commands.go,CLAUDE.md.Tests
7 new tests incl. an end-to-end
Update→Viewrender assertion (menu sits above the prompt, frame height preserved). Fullgo test ./...,make build,gofmt,go vetall clean.