From f7efec62399f003c3b58c5cabf672c60f45a442e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 17:35:20 +0000 Subject: [PATCH] chore(release): 0.4.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 70 +++++++++++++++++++++++++---------- VERSION | 2 +- 3 files changed, 53 insertions(+), 21 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0ee8c012..2537c1f1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.3.0" + ".": "0.4.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 796f6da9..340df973 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,25 +2,57 @@ ## [Unreleased] -### Features - -- `User ClaudeCodeSendComplete` autocmd, fired once per file when a send is accepted while Claude is connected, with `data = { file_path, start_line, end_line, context }` (lines 0-indexed). Lets you run arbitrary post-send logic — in particular, focus a Claude session running outside Neovim (`provider = "none"`/`"external"`), e.g. via `tmux select-pane`, which `focus_after_send` cannot do. ([#228](https://github.com/coder/claudecode.nvim/issues/228)) -- `:ClaudeCodeCloseAllDiffs` command to close pending Claude diffs at once (e.g. proposals orphaned by resolving them via Claude remote control). Diffs you have already accepted but whose file has not been written yet are left intact so saved edits are never discarded. ([#248](https://github.com/coder/claudecode.nvim/issues/248)) -- `:ClaudeCodeSendText {text}` command (and `require("claudecode.terminal").send_to_terminal(text, opts)` function) to send arbitrary text to the open Claude terminal as if typed at the prompt, submitting it by default. `:ClaudeCodeSendText!` inserts the text without submitting. Handy for scripting and keymaps; multi-line text is sent via bracketed paste. Works with the in-editor `native`/`snacks` providers only — `external`/`none` run Claude outside Neovim, where there is no pane to write to. ([#197](https://github.com/coder/claudecode.nvim/issues/197)) -- `terminal.auto_insert` option (default `true`) controlling whether the Claude terminal auto-enters insert/terminal mode when its window gains focus. With the default Snacks provider, switching back into the terminal window (e.g. `l`) previously re-entered terminal mode and jumped to the bottom prompt, discarding your Normal-mode scroll/reading position; set `auto_insert = false` to stay in Normal mode and preserve the scroll position (press `i` to type). Applies to the `native` and `snacks` providers and the new-tab diff terminal. ([#232](https://github.com/coder/claudecode.nvim/issues/232), [#145](https://github.com/coder/claudecode.nvim/issues/145)) -- `diff_opts.layout = "unified"`: a unified diff rendered in a single buffer with deleted (red/strikethrough) and added (green) lines interleaved, as a compact alternative to the two-pane `"vertical"`/`"horizontal"` layouts. Requires Neovim >= 0.9.0; the `ClaudeCodeInlineDiffAdd`/`Delete`/`AddSign`/`DeleteSign` highlight groups are customizable. ([#82](https://github.com/coder/claudecode.nvim/issues/82), [#195](https://github.com/coder/claudecode.nvim/pull/195), [#293](https://github.com/coder/claudecode.nvim/issues/293)) - -### Bug Fixes - -- `closeAllDiffTabs` no longer destroys diffs it does not own. It previously closed every window with `&diff` set and force-deleted any buffer named like `*.diff`/`diff://`/`fugitive://`, so an open diffview.nvim, fugitive, or native `:diffsplit` review was wiped out — and because the Claude CLI calls this tool at the start of every turn, it happened on essentially every prompt. The tool is now scoped to claudecode's own tracked diffs (matching the official VS Code extension, which only closes the tabs it labelled). Relatedly, `openFile`/`openDiff` no longer reuse a window that is in diff mode, which previously `:edit`-ed over one side of an unrelated diff and broke its layout. ([#277](https://github.com/coder/claudecode.nvim/issues/277)) -- The Claude terminal now adds the loopback hosts (`localhost`, `127.0.0.1`, `::1`) to `no_proxy`/`NO_PROXY`, so a configured `http_proxy`/`all_proxy` no longer tunnels Claude's `ws://127.0.0.1` IDE connection and causes queued @ mentions to time out. Existing `no_proxy` exclusions are preserved. ([#70](https://github.com/coder/claudecode.nvim/issues/70)) -- `focus_after_send = true` no longer fails silently with `terminal.provider = "none"`/`"external"`: those providers run Claude outside Neovim, so focus cannot move there. A one-time warning is now emitted at setup pointing to the new `User ClaudeCodeSendComplete` autocmd, which you can hook to focus your own terminal. (`focus_after_send` still only auto-focuses the in-editor providers.) ([#228](https://github.com/coder/claudecode.nvim/issues/228)) -- Rejecting a Claude diff with `:q` (or `:close` / `c` / closing the tab) now resolves it as rejected, matching the documented behavior. The proposed buffer is a scratch buffer that `:q` only hides, so the existing `BufDelete`/`BufUnload`/`BufWipeout` autocmds never fired; a `WinClosed` autocmd now handles window-close rejection. ([#238](https://github.com/coder/claudecode.nvim/issues/238)) -- Push quickly-made visual selections to Claude reliably. Selections made and released faster than the selection-tracking debounce were never broadcast, and any selection was wiped shortly after leaving visual mode when Claude runs in an external terminal (the `/ide` flow) — so single-line selections in particular often never reached Claude. Selections are now flushed synchronously on visual-mode exit (from the `'<`/`'>` marks) and persist until the cursor actually moves; a single-line linewise `V` made right after a charwise selection is also no longer mis-extracted to a single character. ([#246](https://github.com/coder/claudecode.nvim/issues/246)) -- Diffs opened via `openDiff` no longer linger forever when they are resolved outside this Neovim or their Claude session goes away. Pending diffs are now automatically closed when the client that opened them disconnects or the integration is stopped, and `closeAllDiffTabs` now also resolves/cleans the diff module's tracked state instead of only closing windows. ([#248](https://github.com/coder/claudecode.nvim/issues/248)) -- Show diffs when the Claude Code terminal is the only window (no other splits). Previously `openDiff` failed with "No suitable editor window found"; now a split is created to host the diff, matching the behavior of the `openFile` tool. ([#231](https://github.com/coder/claudecode.nvim/issues/231)) -- Fix the "climbing cursor" in the Snacks terminal: hiding and re-showing the Claude panel no longer leaves the cursor one row above the prompt (so typed text lands on the wrong line). The Snacks provider now hides/shows without destroying the window — floats are parked via `nvim_win_set_config({hide=...})` and splits are recreated like the native provider — which preserves the cursor anchor Claude re-renders against on focus-in. Splits are fixed on all supported Neovim versions; the float fix requires Neovim >= 0.10. ([#240](https://github.com/coder/claudecode.nvim/issues/240), [#183](https://github.com/coder/claudecode.nvim/issues/183)) -- Work around a Neovim core bug (< 0.12.2) that fragmented large bracketed pastes into the terminal across `vim.paste` phases, making Cmd+V appear to truncate content. Added a scoped, version-gated `vim.paste` shim controlled by `terminal.fix_streamed_paste` (`"auto"` by default; no-op on Neovim >= 0.12.2). ([#161](https://github.com/coder/claudecode.nvim/issues/161)) +## [0.4.0] - 2026-06-25 + +### Added + +- `:checkhealth claudecode` health check that verifies your Neovim version, `setup()`, the Claude CLI, terminal provider, WebSocket server, lock file, and live connection state, with actionable advice on each failure ([#275](https://github.com/coder/claudecode.nvim/pull/275)). +- `:ClaudeCodeSendText {text}` command (and `require("claudecode.terminal").send_to_terminal(text, opts)`) to send arbitrary text to the open Claude terminal as if typed at the prompt; `:ClaudeCodeSendText!` inserts without submitting. Multi-line text is sent via bracketed paste. Works with the in-editor `native`/`snacks` providers only ([#272](https://github.com/coder/claudecode.nvim/pull/272)). +- `User ClaudeCodeSendComplete` autocmd, fired once per file when a send is accepted while Claude is connected, with `data = { file_path, start_line, end_line, context }` (lines 0-indexed). Lets you run post-send logic such as focusing a Claude session running outside Neovim (`provider = "none"`/`"external"`), e.g. via `tmux select-pane` ([#265](https://github.com/coder/claudecode.nvim/pull/265)). +- `User ClaudeCodeDiffOpened` / `ClaudeCodeDiffClosed` autocmds carrying a data payload (tab/window/file info), so configs can react to diffs opening and closing — resize, relayout, statusline, etc. ([#270](https://github.com/coder/claudecode.nvim/pull/270), [#297](https://github.com/coder/claudecode.nvim/pull/297)). +- `:ClaudeCodeCloseAllDiffs` command to close pending Claude diffs at once; accepted-but-unwritten diffs are left intact so saved edits are never discarded ([#261](https://github.com/coder/claudecode.nvim/pull/261)). +- `diff_opts.layout = "unified"`: a unified diff rendered in a single buffer with deleted (red/strikethrough) and added (green) lines interleaved, a compact alternative to the two-pane `"vertical"`/`"horizontal"` layouts. Requires Neovim >= 0.9.0; the `ClaudeCodeInlineDiffAdd`/`Delete`/`AddSign`/`DeleteSign` highlight groups are customizable ([#195](https://github.com/coder/claudecode.nvim/pull/195), [#295](https://github.com/coder/claudecode.nvim/pull/295)). +- `terminal.auto_insert` option (default `true`) controlling whether the Claude terminal auto-enters insert/terminal mode on focus; set `auto_insert = false` to stay in Normal mode and preserve your scroll position ([#233](https://github.com/coder/claudecode.nvim/pull/233)). +- `terminal.diff_split_width_percentage` (optional terminal width while a diff is open, falling back to `split_width_percentage`) and `diff_opts.auto_resize_terminal` (default `true`; set `false` to own the layout yourself) ([#270](https://github.com/coder/claudecode.nvim/pull/270)). +- `:ClaudeCodeTreeAdd` and `:ClaudeCodeSend` now support snacks.nvim pickers (`snacks_picker_list`), adding the selected/highlighted file(s) to Claude's context ([#269](https://github.com/coder/claudecode.nvim/pull/269)). +- netrw file selection: `as` in netrw buffers adds marked files or the file under cursor to Claude's context ([#62](https://github.com/coder/claudecode.nvim/pull/62)). +- Selection updates are now also sent on `BufEnter`, so switching buffers without moving the cursor still updates Claude's selection context ([#159](https://github.com/coder/claudecode.nvim/pull/159)). +- Model picker refreshed: evergreen, version-free labels (`Claude Opus (Latest)`, `Claude Sonnet (Latest)`, `Claude Haiku (Latest)`), the 1M-context `opus[1m]`/`sonnet[1m]` variants, and `Default (account recommended)` ([#256](https://github.com/coder/claudecode.nvim/pull/256)). + +### Fixed + +- The WebSocket auth token is now generated from a cryptographically secure RNG, and the lock file is written atomically with `0600` permissions in a `0700` directory (previously world-readable `0644`). Handshake auth comparison is constant-time ([#259](https://github.com/coder/claudecode.nvim/pull/259)). +- Malformed WebSocket frames now close the connection with the correct RFC 6455 status code instead of leaving the connection wedged with un-drainable bytes ([#258](https://github.com/coder/claudecode.nvim/pull/258)). +- A second Neovim instance no longer fails to start its server with `EADDRINUSE`; port binding retries across candidate ports and the per-process PRNG seed is restored ([#284](https://github.com/coder/claudecode.nvim/pull/284)). +- Disconnect callbacks now fire on every teardown path (EOF, read/protocol errors, CLOSE frames, keepalive timeouts), preventing phantom clients from accumulating ([#176](https://github.com/coder/claudecode.nvim/pull/176)). +- System sleep is detected (>1.5x ping interval elapsed) and client pong timestamps are reset on wake, preventing false keepalive disconnections after a laptop resumes ([#141](https://github.com/coder/claudecode.nvim/pull/141)). +- `closeAllDiffTabs` is now scoped to claudecode's own tracked diffs and no longer wipes out an open diffview.nvim, fugitive, or native `:diffsplit`; `openFile`/`openDiff` no longer reuse a window in diff mode ([#290](https://github.com/coder/claudecode.nvim/pull/290)). +- Rejecting a Claude diff with `:q` (or `:close` / `c` / closing the tab) now resolves it as rejected via a new `WinClosed` autocmd ([#266](https://github.com/coder/claudecode.nvim/pull/266)). +- Diffs opened via `openDiff` are now auto-closed when the client that opened them disconnects or the integration stops, instead of lingering forever when resolved outside this Neovim ([#261](https://github.com/coder/claudecode.nvim/pull/261)). +- Diffs now open when the Claude terminal is the only window — a split is created to host the diff instead of failing with "No suitable editor window found" ([#260](https://github.com/coder/claudecode.nvim/pull/260)). +- A leftover diff split is no longer left behind after accepting a diff; plugin-created windows are tracked and cleaned up deterministically ([#175](https://github.com/coder/claudecode.nvim/pull/175)). +- `open_in_new_tab` diff setup errors no longer strand an empty tab; focus returns to the original tab ([#264](https://github.com/coder/claudecode.nvim/pull/264)). +- `keep_terminal_focus` now works for floating Snacks terminals instead of stealing focus to the hidden diff split ([#178](https://github.com/coder/claudecode.nvim/pull/178)). +- Fixed the Snacks "climbing cursor" on hide/show toggle: the panel is now parked rather than destroyed, preserving the cursor anchor Claude re-renders against (splits on all versions; floats require Neovim >= 0.10) ([#271](https://github.com/coder/claudecode.nvim/pull/271)). +- The Claude terminal now adds loopback hosts (`localhost`, `127.0.0.1`, `::1`) to `no_proxy`/`NO_PROXY`, so a configured proxy no longer tunnels Claude's `ws://127.0.0.1` IDE connection and times out queued @ mentions ([#268](https://github.com/coder/claudecode.nvim/pull/268)). +- Worked around a Neovim core bug (< 0.12.2) that fragmented large bracketed pastes into the terminal, making Cmd+V appear to truncate content; controlled via `terminal.fix_streamed_paste` (`"auto"` default, no-op on >= 0.12.2) ([#252](https://github.com/coder/claudecode.nvim/pull/252)). +- Quickly-made visual selections are now pushed to Claude reliably; selections are flushed synchronously on visual-mode exit and persist until the cursor moves ([#267](https://github.com/coder/claudecode.nvim/pull/267)). +- IDE tool responses are now handled correctly: diagnostics return grouped URI-based payloads with editor-native ranges and severity names, an unsupported resources capability is no longer advertised, and background file opens preserve focus ([#274](https://github.com/coder/claudecode.nvim/pull/274)). +- `getDiagnostics` now accepts a bare file path (not just a `file://` URI), since Claude often sends the path without a scheme ([#163](https://github.com/coder/claudecode.nvim/pull/163)). +- `ClaudeCodeSend` no longer misroutes ordinary files into tree-extraction when their path merely contains `neo-tree`/`NvimTree`; buffers are now classified by filetype only ([#292](https://github.com/coder/claudecode.nvim/pull/292)). +- File paths containing `$` are now handled correctly in `ClaudeCodeAdd` and `openFile` ([#286](https://github.com/coder/claudecode.nvim/pull/286)). +- The legacy diff options `vertical_split` and `open_in_current_tab` are applied correctly again (they were silently ignored after a merge-order change) ([#142](https://github.com/coder/claudecode.nvim/pull/142)). +- Fixed a segfault when accepting a new-file diff with `render-markdown.nvim` installed, by turning off diff mode before the post-write redraw ([#224](https://github.com/coder/claudecode.nvim/pull/224)). +- The empty scratch buffer is now wiped when the terminal provider is `none` ([#223](https://github.com/coder/claudecode.nvim/pull/223)). +- `snacks_picker_list` buffers are excluded from main-editor-window detection, so diffs no longer target the picker ([#165](https://github.com/coder/claudecode.nvim/pull/165)). +- Selection-context fallback now matches the `[Claude Code]` terminal name via substring, so external (`provider = "none"`) terminals correctly skip sending selection context ([#160](https://github.com/coder/claudecode.nvim/pull/160)). +- Selection debounce timers are now stopped and closed safely, fixing a libuv handle leak and stale callbacks firing after being superseded ([#245](https://github.com/coder/claudecode.nvim/pull/245)). +- A one-time warning is now emitted when `focus_after_send = true` with `provider = "none"`/`"external"`, pointing at the new `ClaudeCodeSendComplete` event ([#265](https://github.com/coder/claudecode.nvim/pull/265)). +- Bumped the Haiku picker label to 4.5 ([#146](https://github.com/coder/claudecode.nvim/pull/146)). + +### Changed + +- Floating diff terminals are no longer resized when restoring terminal widths ([#178](https://github.com/coder/claudecode.nvim/pull/178)). ## [0.3.0] - 2025-09-15 diff --git a/VERSION b/VERSION index 0d91a54c..1d0ba9ea 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.0 +0.4.0