[BUG] Cowork EXDEV: cross-device link not permitted on macOS when ~/Library is on external SSD
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?
Environment:
Claude Desktop (latest)
macOS, MacBook Pro
~/Library located on external SSD (/Volumes/AmitSSD)
Internal drive used for system temp (/var/folders/...)
What's Wrong:
Cowork fails to start every time with:
EXDEV: cross-device link not permitted, rename
'/var/folders/v8/b_44tkdn1cbbjf7lgtz0y2th0000gn/T/wvm-XXXXX/rootfs.img' ->
'/Users/amitmishra/Library/Application Support/Claude/vm_bundles/claudevm.bundle/rootfs.img'
Claude downloads rootfs.img to macOS system temp (/var/folders/... on internal drive) then attempts fs.rename() to move it to ~/Library/Application Support/Claude/vm_bundles/ which is on an external SSD. Since these are different filesystems, rename() always fails with EXDEV.
Root Cause:
Claude hardcodes os.tmpdir() internally, completely ignoring the TMPDIR environment variable. On macOS, os.tmpdir() always returns /var/folders/... regardless of TMPDIR. When ~/Library is on a different volume (common for users who move caches/storage to external SSD to save space), the rename across devices always fails.
What I tried:
Restarting Claude and Mac multiple times
Symlinking vm_bundles to SSD
Setting TMPDIR via ~/.zshenv, ~/.zprofile, launchctl setenv, sudo launchctl config system setenv — Claude ignores all of them
Reinstalling workspace
What Should Happen?
Use fs.copyFile() + fs.unlink() as fallback when fs.rename() fails with EXDEV. This is standard practice and already suggested in issues #25476, #25911, #30584.
Workaround needed for users with ~/Library on external SSD — a very common macOS setup to save internal SSD space.
Error Messages/Logs
EXDEV: cross-device link not permitted, rename
'/var/folders/v8/b_44tkdn1cbbjf7lgtz0y2th0000gn/T/wvm-XXXXX/rootfs.img' ->
'/Users/amit/Library/Application Support/Claude/vm_bundles/claudevm.bundle/rootfs.img'
Steps to Reproduce
Restarting Claude and Mac multiple times
Symlinking vm_bundles to SSD
Setting TMPDIR via ~/.zshenv, ~/.zprofile, launchctl setenv, sudo launchctl config system setenv — Claude ignores all of them
Reinstalling workspace
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.83 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗