From 01f2ec31212313fc5eec68b259295dfd842db99b Mon Sep 17 00:00:00 2001 From: Diogo Tandeta Tartarotti Date: Tue, 10 Mar 2026 13:21:33 -0300 Subject: [PATCH 1/2] fix: only run checktime if not in command line window --- README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b21494e..f778090 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ Claude CLI (terminal) Neovim ``` Three mechanisms: + 1. **Claude Code Hooks** — `PreToolUse` intercepts edits, `PostToolUse` cleans up 2. **Neovim RPC** — hook scripts send Lua commands via `nvim --server --remote-send` 3. **Neovim diff mode** — native side-by-side diff in a dedicated tab @@ -144,6 +145,7 @@ If you use [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim), clau | Deleted | 󰆴 | Red + strikethrough | Claude is deleting a file via `rm` | Additional behaviors: + - **Auto-reveal** — the tree expands to highlight the changed file - **Virtual nodes** — new files/directories appear in the tree before they exist on disk - **Clean focus** — git status, diagnostics, and modified indicators are temporarily hidden while changes are pending @@ -204,25 +206,36 @@ For buffers to auto-reload after Claude writes a file, add this to your Neovim c ```lua vim.o.autoread = true -vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold" }, { - command = "checktime", -}) + vim.api.nvim_create_autocmd( + { "FocusGained", "BufEnter", "CursorHold" }, + { + callback = function() + if vim.fn.getcmdwintype() == "" then + vim.cmd("checktime") + end + end, + } + ) ``` + --- ## Troubleshooting **Diff doesn't open** + - Run `:ClaudePreviewStatus` — check that `Neovim socket` is found - Ensure `jq` is in PATH - Restart Claude Code after installing hooks (hooks are read at startup) **Hooks not firing** + - Run `:ClaudePreviewInstallHooks` in the project root - Verify `.claude/settings.local.json` contains the hook entries - Restart the Claude CLI **Diff doesn't close after rejecting** + - Press `dq` or run `:ClaudePreviewCloseDiff` — PostToolUse only fires on accept --- From 0c56306b7e10fca87a9290a7c92f628563374808 Mon Sep 17 00:00:00 2001 From: Diogo Tandeta Tartarotti Date: Sun, 15 Mar 2026 17:18:19 -0300 Subject: [PATCH 2/2] fix: formatting on README.md --- README.md | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f778090..6f3dc3a 100644 --- a/README.md +++ b/README.md @@ -206,16 +206,13 @@ For buffers to auto-reload after Claude writes a file, add this to your Neovim c ```lua vim.o.autoread = true - vim.api.nvim_create_autocmd( - { "FocusGained", "BufEnter", "CursorHold" }, - { - callback = function() - if vim.fn.getcmdwintype() == "" then - vim.cmd("checktime") - end - end, - } - ) +vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold" }, { + callback = function() + if vim.fn.getcmdwintype() == "" then + vim.cmd("checktime") + end + end, +}) ``` ---