[BUG] File paths sent to Claude Code do not respect running Claude from a different CWD
まだ誰も着手していません。
評価
調査の方向性
示されている cwd_provider で問題を再現し、ClaudeCodeOpen、ClaudeCodeAdd %、ClaudeCodeSend のエントリポイントと、claudecode.cwd 周辺のパス処理を追跡します。Neovim の CWD が Claude の設定済み CWD と異なる場合に送信されるパスを、初回送信のケースも含めて比較します。バッファとビジュアル選択のパスが常に Claude の CWD を基準に解決されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Lua
- スター
- 3.1k
- フォーク
- 217
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/claudecode.nvim のほかの issue
-
bug needs-triage
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
coder/claudecode.nvim#314 ·
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
coder/claudecode.nvim#313 ·
-
needs-triage
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
coder/claudecode.nvim#319 · リアクション 1 件 ·
-
[BUG] 框选文本一直抱错误信息 オープンbug needs-triage
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
coder/claudecode.nvim#316 · コメント 1 件 ·
-
needs-triage
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
coder/claudecode.nvim#309 ·
coder/claudecode.nvim の issue をすべて見る
似ている issue
-
Nmap
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
LandSandBoat/server#11579 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100