[BUG] Artifacts and Scheduled Tasks fail when ~/Documents is a symlink (virtiofs cannot mkdir through symlinks)
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?
Two separate Claude.ai features fail with the same root cause: virtiofs (the VM filesystem layer) cannot mkdir through a symlink, so any feature that tries to create or mount a path under ~/Documents/Claude/ fails before it starts.
Error seen in Artifacts:
RPC error: failed to mount /mnt/.virtiofs-root/shared/Users/amanda.**/Documents/Claude/Artifacts/as .artifacts/stakeholder-pulse: source path does not exist and could not be created: mkdir /mnt/.virtiofs-root/shared/Users/amanda.*****/Documents/Claude: file exists
Also affects: Scheduled Tasks — same error; worked around by manually updating scheduled-tasks.json to use the resolved OneDrive path instead of the symlinked ~/Documents path.
Root cause: virtiofs sees the Documents symlink as a file, not a directory, so mkdir on any child path fails with "file exists."
Expected behavior: Claude.ai should resolve symlinks (realpath) before constructing virtiofs mount paths.
Workaround: Manually replace ~/Documents/Claude/... paths with the real path (~/Library/CloudStorage/OneDrive-*****/Documents 1/Claude/...) in any config files. Not possible for Artifacts — no user-accessible config.
What Should Happen?
Before constructing a virtiofs mount path, Claude should resolve any symlinks in the path to their real filesystem location (equivalent to running realpath on the path). This ensures the mount succeeds regardless of whether components like ~/Documents are symlinks.
For example, instead of mounting:
/Users/amanda.rusch@cohesity.com/Documents/Claude/Artifacts/stakeholder-pulse
Claude should resolve and mount:
/Users/amanda.rusch@cohesity.com/Library/CloudStorage/OneDrive-Cohesity/Documents 1/Claude/Artifacts/stakeholder-pulse
This would make Artifacts and Scheduled Tasks work correctly for any user whose ~/Documents (or any parent directory) is managed by OneDrive, iCloud Drive, or any other sync client that uses symlinks.
Error Messages/Logs
Steps to Reproduce
Set up OneDrive on macOS such that ~/Documents is a symlink to ~/Library/CloudStorage/OneDrive-<tenant>/Documents 1/ (this is OneDrive's default macOS configuration)
Open Claude.ai web app
In any conversation, create or re-open an Artifact (e.g. a stakeholder dashboard) — triggering the VM to mount ~/Documents/Claude/Artifacts/<artifact-name>/
Observe the "Something went wrong" RPC error
For Scheduled Tasks (same bug, different trigger):
Same symlink setup as above
Have at least one scheduled task configured (paths stored as ~/Documents/Claude/Scheduled/...)
Trigger a scheduled task run
Observe task fails before execution with the same virtiofs mount error
Note: The symlink itself is not unusual — OneDrive creates it automatically on macOS when Documents folder sync is enabled. This likely affects any user with OneDrive (or potentially iCloud Drive) syncing their Documents folder.
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Prior to v2.1.119
Claude Code Version
v2.1.119
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗