Plugin install fails with EXDEV when /tmp is on different filesystem
Description
Plugin installation fails with EXDEV: cross-device link not permitted when /tmp is mounted on a different filesystem than ~/.claude/plugins/.
Error Message
Error: Failed to install: EXDEV: cross-device link not permitted, rename
'/home/user/.claude/plugins/cache/<plugin>' -> '/tmp/claude-plugin-temp-1768434350964'
Environment
- OS: openSUSE Tumbleweed (also affects Fedora, Arch, and other systemd-based distros)
- Claude Code version: Latest
- Filesystem layout:
/homeon/dev/nvme0n1p3(ext4/btrfs)/tmpontmpfs(RAM-based)
Root Cause
The plugin installer uses fs.rename() to move files from the plugin cache to a temp directory in /tmp. The rename() syscall fails with EXDEV when source and destination are on different filesystems.
This is a very common Linux configuration - most systemd-based distributions mount /tmp as tmpfs by default for performance and SSD longevity.
Suggested Fix
When rename() fails with EXDEV, fall back to copy + delete:
async function moveFile(src, dest) {
try {
await fs.rename(src, dest);
} catch (err) {
if (err.code === 'EXDEV') {
// Cross-device move: copy then delete
await fs.cp(src, dest, { recursive: true });
await fs.rm(src, { recursive: true });
} else {
throw err;
}
}
}
Alternatively, use a temp directory on the same filesystem as the plugin cache (e.g., ~/.claude/plugins/.tmp/).
Workaround
Users can work around this by setting TMPDIR:
TMPDIR=~/.claude/tmp claude
Reproduction Steps
- Have a system where
/tmpis on tmpfs (default on most modern Linux distros) - Run Claude Code
- Try to install any plugin (e.g.,
/plugin install <plugin>) - Observe the EXDEV error
Found 2 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/18115
- https://github.com/anthropics/claude-code/issues/14799
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 Generated with Claude Code
This issue has been automatically closed as a duplicate of #18115.
If this is incorrect, please re-open this issue or create a new one.
🤖 Generated with Claude Code
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.