[BUG] File paths sent to Claude Code do not respect running Claude from a different CWD
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
Tái hiện vấn đề với cwd_provider được hiển thị, sau đó lần theo các entry point ClaudeCodeOpen, ClaudeCodeAdd % và ClaudeCodeSend cũng như cách xử lý đường dẫn xung quanh claudecode.cwd. So sánh các đường dẫn được gửi khi CWD của Neovim khác với CWD đã cấu hình của Claude, bao gồm cả trường hợp gửi lần đầu. Hoàn thành khi các đường dẫn của buffer và vùng chọn trực quan được phân giải nhất quán tương đối với CWD của Claude.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug Description
When using a cwd_provider, buffer paths sent to Claude Code are relative to Neovim's CWD instead of the directory that Claude is running in.
To Reproduce
Steps to reproduce the behavior:
Use a plugin configuration similar to
require("claudecode").setup({
terminal = {
cwd_provider = function(ctx)
-- Prefer repo root; fallback to file's directory
local cwd = require("claudecode.cwd").git_root(ctx.file_dir or ctx.cwd) or ctx.file_dir or ctx.cwd
return cwd
end,
},
})
Using this repository
cd pluginnvim claudecode.lua- Run
ClaudeCodeOpen - Run
ClaudeCodeAdd %or make a visual selection and runClaudeCodeSend
Note that the path sent is claudecode.lua but since Claude Code is running from the git root, it should be plugin/claudecode.lua for Claude to properly resolve it.
Oddly, sometimes, the first time I send the path it works properly but then after that the bug occurs. Not sure why but it might be linked to whether the path is calculated before or after Claude is finished opening?
Expected Behavior
The buffer path sent to Claude is relative to Claude's CWD from the cwd_provider instead of relative to Neovim's CWD.
Environment
- Neovim version: 0.11.4
- Claude Code CLI version: 2.0.26
- OS: MacOS 26.0
- Plugin version: latest git
- Ngôn ngữ chính
- Lua
- Star
- 3.1k
- Fork
- 217
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của coder/claudecode.nvim
-
bug needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
coder/claudecode.nvim#314 ·
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
coder/claudecode.nvim#313 ·
-
Is this plugin abondonned? Đang mởneeds-triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
coder/claudecode.nvim#319 · 1 reaction ·
-
[BUG] 框选文本一直抱错误信息 Đang mởbug needs-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
coder/claudecode.nvim#316 · 1 bình luận ·
-
needs-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
coder/claudecode.nvim#309 ·
Tất cả issue của coder/claudecode.nvim
Issue tương tự
-
Nmap
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
LandSandBoat/server#11579 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100