[Bug] /add-dir does not strip surrounding quotes from path argument
Bug Description
Title: /add-dir does not strip surrounding quotes from its path argument
Environment
- Claude Code 2.1.226
- Windows 11 Pro 10.0.26200, PowerShell
Description
/add-dir treats surrounding quote characters as part of the path. Quoting a path is normal habit from the terminal, so this is easy to hit, and the resulting error message does not point at the real cause.
Steps to reproduce
- Start Claude Code in any working director\project.
- Make sure C:\Git\some-folder exists.
- Run: /add-dir "C:\Git\some-folder"
Actual result
Path C:\Users\me\Documents\project\"C:\Git\s
The leading " makes the argument look like ained with the current working directory. Thedirectory is never added.
Expected result
The directory is added, the same as when the command is run without quotes. Leading and trailing " or ' should be stripped before the path is resolved.
Secondary issue
The error message technically contains the cwith the quote characters in the middle – but it reads as "this directory does not exist". Two things would help:
- report the argument as the user typed it, and say that it was resolved relative to the working directory because it
is not an absolute path,
- or detect the quote characters and say so explicitly.
Workaround
Run the command without quotes: /add-dir C:\Git\some-folder. Paths containing spaces then have no way to be quoted, which is the other half of the problem.
Environment Info
- Platform: win32
- Terminal: windows-terminal
- Version: 2.1.226
- Feedback ID: 43e0b90c-b3a1-4a4c-b535-d00a56f768ba
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗