Plugin install fails with EXDEV on systems where /tmp is tmpfs
Bug description
Plugin installation fails with EXDEV: cross-device link not permitted when /tmp is a tmpfs (RAM-backed) filesystem and ~/.claude/ is on a disk-backed filesystem.
The installer appears to use fs.rename() to move between these paths, which fails across filesystem boundaries.
Error message
Error: Failed to install: EXDEV: cross-device link not permitted, rename
'/home/jack/.claude/plugins/cache/faire' -> '/tmp/claude-plugin-temp-1770502820948'
Root cause
fs.rename() uses the rename(2) syscall, which cannot move files across mount points. On this system:
~/.claude/plugins/cache/→ ext4 on/dev/mapper/luks-...(mounted at/)/tmp→tmpfs(RAM-backed, separate filesystem)
This is a common Linux setup — many distributions (Arch, Fedora, etc.) mount /tmp as tmpfs by default.
Suggested fix
Replace fs.rename() with a cross-device-safe move, e.g.:
fs.cp()+fs.rm()(Node 16.7+)- or
fs.rename()with anEXDEVfallback to copy+delete
Alternatively, create temp files on the same filesystem as the destination (e.g., in ~/.claude/plugins/tmp/) instead of using the system /tmp.
Workaround (confirmed)
Setting TMPDIR to a path on the same filesystem works:
export TMPDIR=~/.claude/tmp
mkdir -p ~/.claude/tmp
Environment
- Claude Code: 2.1.37
- OS: Arch Linux, kernel 6.12.53-1-lts
/tmp: tmpfs/home: ext4 on LUKS-encrypted NVMe
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗