Skip to content

Commit 24c1f43

Browse files
authored
Update docs to include fix for auto-save plugins (#106)
1 parent 4770090 commit 24c1f43

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,87 @@ Provides convenient Claude interaction history management and access for enhance
573573

574574
> **Disclaimer**: These community extensions are developed and maintained by independent contributors. The authors and their extensions are not affiliated with Coder. Use at your own discretion and refer to their respective repositories for installation instructions, documentation, and support.
575575
576+
## Auto-Save Plugin Issues
577+
578+
Using auto-save plugins can cause diff windows opened by Claude to immediately accept without waiting for input. You can avoid this using a custom condition:
579+
580+
<details>
581+
<summary>Pocco81/auto-save.nvim</summary>
582+
583+
```lua
584+
opts = {
585+
-- ... other options
586+
condition = function(buf)
587+
local fn = vim.fn
588+
local utils = require("auto-save.utils.data")
589+
590+
-- First check the default conditions
591+
if not (fn.getbufvar(buf, "&modifiable") == 1 and utils.not_in(fn.getbufvar(buf, "&filetype"), {})) then
592+
return false
593+
end
594+
595+
-- Exclude claudecode diff buffers by buffer name patterns
596+
local bufname = vim.api.nvim_buf_get_name(buf)
597+
if bufname:match("%(proposed%)") or
598+
bufname:match("%(NEW FILE %- proposed%)") or
599+
bufname:match("%(New%)") then
600+
return false
601+
end
602+
603+
-- Exclude by buffer variables (claudecode sets these)
604+
if vim.b[buf].claudecode_diff_tab_name or
605+
vim.b[buf].claudecode_diff_new_win or
606+
vim.b[buf].claudecode_diff_target_win then
607+
return false
608+
end
609+
610+
-- Exclude by buffer type (claudecode diff buffers use "acwrite")
611+
local buftype = fn.getbufvar(buf, "&buftype")
612+
if buftype == "acwrite" then
613+
return false
614+
end
615+
616+
return true -- Safe to auto-save
617+
end,
618+
},
619+
```
620+
621+
</details>
622+
<details>
623+
<summary>okuuva/auto-save.nvim</summary>
624+
625+
```lua
626+
opts = {
627+
-- ... other options
628+
condition = function(buf)
629+
-- Exclude claudecode diff buffers by buffer name patterns
630+
local bufname = vim.api.nvim_buf_get_name(buf)
631+
if bufname:match('%(proposed%)') or bufname:match('%(NEW FILE %- proposed%)') or bufname:match('%(New%)') then
632+
return false
633+
end
634+
635+
-- Exclude by buffer variables (claudecode sets these)
636+
if
637+
vim.b[buf].claudecode_diff_tab_name
638+
or vim.b[buf].claudecode_diff_new_win
639+
or vim.b[buf].claudecode_diff_target_win
640+
then
641+
return false
642+
end
643+
644+
-- Exclude by buffer type (claudecode diff buffers use "acwrite")
645+
local buftype = vim.fn.getbufvar(buf, '&buftype')
646+
if buftype == 'acwrite' then
647+
return false
648+
end
649+
650+
return true -- Safe to auto-save
651+
end,
652+
},
653+
```
654+
655+
</details>
656+
576657
## Troubleshooting
577658

578659
- **Claude not connecting?** Check `:ClaudeCodeStatus` and verify lock file exists in `~/.claude/ide/` (or `$CLAUDE_CONFIG_DIR/ide/` if `CLAUDE_CONFIG_DIR` is set)

0 commit comments

Comments
 (0)