claudecode.nvim
claudecode.nvim copied to clipboard
chore(release): 0.4.0
The next claudecode.nvim release. Merging this PR creates the release tag and GitHub Release, then starts Communique GitHub Release note generation.
[0.4.0] - 2026-06-15
Added
:ClaudeCodeSendText {text}command (andrequire("claudecode.terminal").send_to_terminal(text, opts)) to send arbitrary text to the open Claude terminal as if typed at the prompt, submitting by default;:ClaudeCodeSendText!inserts without submitting. Multi-line text uses bracketed paste. Works with the in-editornative/snacksproviders only (#272, #197).User ClaudeCodeSendCompleteautocmd, fired once per file when a send is accepted while Claude is connected, withdata = { file_path, start_line, end_line, context }(lines 0-indexed). Lets you focus a Claude session running outside Neovim (provider = "none"/"external"), e.g. viatmux select-pane, whichfocus_after_sendcannot do (#265, #228).User ClaudeCodeDiffOpened/ClaudeCodeDiffClosedautocmds carrying diff metadata so configs can react to diffs opening and closing (resize, relayout, statusline, etc.) (#270).terminal.diff_split_width_percentageto set a separate Claude terminal width while a diff is open (falls back tosplit_width_percentagewhen unset), anddiff_opts.auto_resize_terminal(defaulttrue) to opt out of automatic width management entirely (#270).:ClaudeCodeCloseAllDiffscommand to close pending Claude diffs at once. Diffs already accepted but not yet written are left intact (#261, #248).:checkhealth claudecodehealth check that verifies Neovim version,setup(), Claude CLI resolution, terminal provider sanity, the WebSocket server/port, the IDE lock file, and live connection state (#275).- netrw file selection support:
<leader>asin a netrw buffer adds marked files or the file under the cursor to Claude's context (#62). - snacks.nvim picker support for
:ClaudeCodeTreeAdd/:ClaudeCodeSend, adding selected files fromSnacks.explorer()andSnacks.pickerto Claude's context (#269, #192). - Model picker labels are now version-free (
Claude Opus (Latest), etc.) with new 1M-context aliases (opus[1m],sonnet[1m]) and aDefault (account recommended)entry (#256).
Fixed
- WebSocket server now retries port binding on
EADDRINUSE, so a second Neovim instance no longer fails to start with "Failed to listen on port ... address already in use" (#284, #283). - Detect system sleep/wake and reset client keepalive timestamps, preventing false disconnections after a laptop resumes from sleep (#141).
- IDE auth token is now generated from a CSPRNG (
vim.loop.random) and the lock file is written atomically with0600permissions in a0700directory (previously world-readable) (#259). - Close the connection on malformed WebSocket frames with the proper RFC 6455 close code instead of stalling forever with un-drained buffer bytes (#258, #257).
on_disconnectnow fires on all teardown paths (EOF, read/protocol errors, keepalive timeout), fixing "phantom" client entries that accumulated over time (#176, #170).- IDE diagnostics tool no longer errors when Claude passes a bare file path instead of a
file://URI (#163). - IDE tool responses now return grouped URI-based diagnostics with editor-native ranges and severity names, stop advertising an unsupported resources capability, and harden background file opens (#274).
- Legacy
diff_opts.vertical_splitandopen_in_current_tabare honored again; they were silently ignored due to merge ordering (#142). keep_terminal_focus = truenow works for floating Claude terminals (e.g. Snacksposition = "float"), which previously lost focus to the diff split (#178, #150).- Diffs now open when the Claude terminal is the only window; previously this failed with "No suitable editor window found" (#260, #231).
- Rejecting a diff with
:q(or:close/<C-w>c/ tab close) now resolves it as rejected via a newWinClosedautocmd, matching the documented behavior (#266, #238). - Pending diffs are now auto-closed when the client that opened them disconnects or the server stops, instead of lingering when resolved outside this Neovim (#261, #248).
- Plugin-created diff splits are now closed on cleanup, so accepted/rejected diffs no longer leave stray windows behind (#175, #155).
- With
open_in_new_tab = true, a stranded empty tab is no longer left behind (and focus returns to the original tab) when diff setup errors (#264, #262). - Snacks Explorer and picker windows are excluded from main-editor-window detection, so diffs no longer open on top of or corrupt the explorer/picker sidebar (#255, #165).
- Quickly-made visual selections are now pushed to Claude reliably: selections are flushed synchronously on visual-mode exit and persist until the cursor moves, fixing single-line selections that often never reached Claude (#267, #246).
- Selection context is now also sent on
BufEnter, so switching buffers without moving the cursor updates Claude (#159). - Selection-context fallback for external terminals (
provider = "none") now matches the Claude buffer name by substring, fixing skipped/incorrect context detection (#160). - The Snacks terminal no longer leaves a "climbing cursor" after hide/show toggles; the panel is parked and restored without being destroyed (#271, #240, #183).
- Loopback hosts (
localhost,127.0.0.1,::1) are added tono_proxy/NO_PROXYfor the Claude terminal so a configured proxy no longer tunnels Claude'sws://127.0.0.1IDE connection and times out @ mentions (#268, #70). - The 1M-context model aliases (
opus[1m],sonnet[1m]) launched via the Snacks provider no longer fail with a shell glob error; the launch command is now passed as an argv list (#256). - Work around a Neovim core bug (< 0.12.2) that fragmented large bracketed pastes into the terminal; gated by
terminal.fix_streamed_paste("auto"by default) (#252). - Debounce timers in selection tracking are now stopped and closed correctly, fixing a libuv handle leak and stale callbacks firing after being superseded (#245).
focus_after_send = truenow emits a one-time warning underprovider = "none"/"external"(which run Claude outside Neovim) pointing toUser ClaudeCodeSendComplete(#265, #228).- Updated the latest Claude Haiku model version (#146).
Maintained by the release-please workflow. CHANGELOG.md and the release PR body are regenerated by Communique on every push to main, so manual edits to this PR are overwritten.