VS Code Remote: Claude Code doesn't create ~/.claude/ subdirectories on startup, causing silent init failure
Summary
When ~/.claude/ exists as a directory (or symlink to a directory) but its required subdirectories are missing, the Claude Code VS Code extension fails to initialize — with no clear error surfaced to the user. Claude Code handles the case where ~/.claude/ itself is absent (it creates it), but does not extend that same treatment to the subdirectories it expects within it.
A secondary issue: when ~/.claude/ is a symlink, allow-rule paths written to settings.local.json acquire a double leading slash (e.g. //path/... instead of /path/...).
---
Environment
- OS: Unraid 7.x (Slackware-based Linux), kernel 6.12.85
- VS Code version: 1.100.x (remote server via SSH)
- Claude Code extension version: latest as of 2026-05-01
- Connection method: VS Code Remote SSH
Setup:
/root/.claude → symlink → /mnt/cache/system/claude/
~/.claude/ is a symlink to persistent NAS storage so Claude Code config/state survives reboots. At boot, a startup script creates only the top-level directory — subdirectories are not pre-created.
---
Steps to Reproduce
- On a Linux remote, create
~/.claude/as a symlink to an empty directory:
``bash``
mkdir -p /some/persistent/path
ln -s /some/persistent/path ~/.claude
- Connect to the remote via VS Code Remote SSH.
- Activate the Claude Code extension.
---
Expected Behavior
Claude Code starts successfully. It creates any missing subdirectories under ~/.claude/ (e.g. ide/, projects/, plugins/cache/, shell-snapshots/, commands/, agents/, output-styles/, skills/, statsig/, todos/) just as it creates ~/.claude/ itself when fully absent.
---
Actual Behavior
Claude Code fails to initialize. The failure is silent — no error toast, no terminal output, no diagnostic visible to the user. The extension appears to load but does not become functional.
Manually creating the missing subdirectories resolves the issue immediately:
mkdir -p ~/.claude/{ide,projects,plugins/cache,shell-snapshots,commands,agents,output-styles,skills,statsig,todos}
---
Secondary Bug: Double-slash paths in settings.local.json
When ~/.claude/ is a symlink and Claude Code writes permission allow-rules to settings.local.json, the resolved paths contain a double leading slash:
{
"permissions": {
"allow": [
"Read(//mnt/cache/system/claude/**)",
"Read(//mnt/cache/system/claude/ide/**)"
]
}
}
The // prefix is incorrect (should be /mnt/cache/system/claude/**). Appears to be a path-join issue when resolving the symlink target before writing the rule.
---
Suggested Fix
In the extension startup path, after ensuring ~/.claude/ exists, stat each required subdirectory and mkdir -p any that are absent. Idempotent and safe — same pattern already applied to the parent directory.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗