Claude/Code/Q/Can the ~ tilde character be used in Claude Code's additionalDirectories setting in settings.json?
Properties
- tags
- Claude/Code, Q
- logseq-entity
- Logseq/Entity/Question
- see-also
- Claude/Code/Settings
Can the
~tilde character be used in Claude/Code'sadditionalDirectoriessetting in settings.json?My Notes
- if we are using ghq for everything then we should be able to use relative directories pretty easily
AI Answer
- AI/Response
- Short answer: No —
~is not expanded inadditionalDirectories. Use a full absolute path instead. ~is a shell expansion feature; Node.js treats it as a relative path (path.isAbsolute('~')returnsfalse), not as the home directory.- There is a known bug where using
~causes Claude Code to create a literal~/directory inside the working directory. - Use an absolute path:
- Session-only alternative:
/add-dirin-session also requires an absolute path (shell expansion of~does not happen inside Claude Code).
- Short answer: No —
- AI/Response