[BUG] claude-cli creates its configs when asked to use none
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
something strange happens when I do like this in /tmp/testclaude ➜ ls
➜ claude --dangerously-skip-permissions --setting-sources ""
╭─── Claude Code v2.0.76 ....────────╯
➜ ls '~'
➜ tree /tmp/testclaude/~/.claude/ /tmp/testclaude/~/.claude/ └── plugins └── marketplaces └── claude-plugins-official ├── external_plugins │ ├── asana │ ├── context7 │ ├── firebase ...
⏺ That's a bug in Claude Code. When you pass --setting-sources "", some initialization code is creating ~/.claude/ but treating ~ as a literal string instead of expanding it to your home directory.
The tilde expansion happens at the shell level, but here it looks like the path is being constructed programmatically (likely in Node.js) without using the proper home directory resolution (e.g., os.homedir() or process.env.HOME).
You can clean it up with:
rm -rf '/tmp/testclaude/~'
This should be reported at https://github.com/anthropics/claude-code/issues - the bug is that when --setting-sources "" is used, some code path is writing to a literal ~ path instead of expanding it properly.
imho "no sources" should not try to overwirte my configs, I am happy that it fails and not deletes existing
What Should Happen?
"no sources" should not try to create any config. moreovere to overwirte my configs, I am happy that it fails and not deletes existing
Error Messages/Logs
Steps to Reproduce
claude --dangerously-skip-permissions --setting-sources ""
Claude Model
None
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
No response