Plugin install fails with EXDEV on systems where /home and /tmp are on different filesystems
Bug Description
Plugin installation fails with EXDEV: cross-device link not permitted when the user's home directory and /tmp reside on different filesystems. The installer attempts to rename() a directory from the plugin cache (~/.claude/plugins/cache/) to /tmp/, which fails because rename() cannot operate across mount points.
Steps to Reproduce
- Use a system where
/homeand/tmpare on different filesystems (e.g.,/homeon btrfs/ext4,/tmpon tmpfs) - Run:
/plugin install everything-claude-code@everything-claude-code
Error Output
Error: Failed to install: EXDEV: cross-device link not permitted, rename
'/home/user/.claude/plugins/cache/everything-claude-code' ->
'/tmp/claude-plugin-temp-1769161541016'
Expected Behavior
Plugin installation should succeed regardless of filesystem layout. The installer should handle cross-device moves gracefully (e.g., copy + delete instead of rename()).
Environment
- OS: Fedora Kinoite / Aurora (ublue-os), immutable OSTree-based
- Filesystem layout:
/home→ btrfs (physical disk,/dev/nvme0n1p3)/tmp→ tmpfs (RAM-based)- Claude Code version: Latest (installed via npm)
- Architecture: x86-64
Affected Systems
This likely affects all Linux distributions where /tmp is a tmpfs mount, which is common on:
- Fedora (all variants, immutable and traditional)
- Arch Linux (default systemd tmpfs)
- NixOS
- Any system using
tmp.mountsystemd unit
Workaround
Set TMPDIR to a path on the same filesystem as ~/.claude/ before starting Claude Code:
mkdir -p ~/.cache/claude-tmp
export TMPDIR=~/.cache/claude-tmp
claude
Root Cause
Node.js fs.rename() uses the POSIX rename() syscall which returns EXDEV when source and destination are on different devices. The fix is to detect this error and fall back to a copy-then-remove strategy (e.g., using fs-extra's move() or manual recursive copy + rmdir).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗