Malformed additionalDirectories entry in settings.json causes silent failure (zero output, exit 0)
Summary
A non-path string (HTML content) in ~/.claude/settings.json permissions.additionalDirectories causes Claude Code 2.1.63+ to silently produce zero output. No error message, no stderr, exit code 0.
Versions affected
- Works: 2.1.62 and below (tolerates the malformed entry)
- Broken: 2.1.63 through 2.1.69 (silent failure, zero output)
Root cause
The additionalDirectories array in ~/.claude/settings.json contained a string that was HTML content rather than a filesystem path. Example:
"additionalDirectories": [
"/valid/path/one",
"/Users/me/Projects/SomeProject/Heres what I think this deck should look like. The goal is: <b>Read this and know exactly what to implement.</b></p>\n\n<p><b>Slide 1: Title</b>...",
"/valid/path/two"
]
A ~500 character string containing HTML tags, line breaks, and presentation content got concatenated with a directory path and saved to settings.
(This was added during a Claude session where It asked for permission and I obviously didn't notice in enough detail what it was adding. )
How to reproduce
- Add any non-path string containing HTML to
additionalDirectoriesin~/.claude/settings.json - Run
claude -p "hello"in terminal - Observe: zero output, no error, exit code 0
Expected behavior
Claude Code should:
- Validate
additionalDirectoriesentries are plausible filesystem paths - Skip or warn about invalid entries rather than silently failing
- At minimum, produce an error message — not zero output with exit 0
How it likely happened (secondary bug)
During a Claude Code session, I was working with HTML content (presentation instructions). When Claude Code prompted for directory access approval, the HTML content was somehow concatenated into the path string and auto-saved to settings.json. Claude Code should sanitize directory paths before persisting them to settings.
Debugging notes
- Version bisect confirmed 2.1.62 → 2.1.63 is the breaking point
- The async init refactor in 2.1.63 (sync
j8(() => {→ asyncT8(async () => {) appears to be where the tolerance for malformed entries was lost - Removing
~/.claude/settings.jsonentirely and letting it regenerate fixes the issue - Removing only the HTML blob from
additionalDirectoriesfixes the issue - Re-adding the HTML blob reproduces the failure — confirmed multiple times
Workaround
Remove the malformed entry from ~/.claude/settings.json permissions.additionalDirectories. If Claude Code produces zero output after an update, try mv ~/.claude/settings.json ~/.claude/settings.json.bak and test again.
Environment
- macOS Sequoia (Darwin 24.6.0)
- Node 22.x via nvm
- Claude Code installed via npm
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗