Plugin installation fails with EXDEV error when /tmp and /home are on different filesystems

Resolved 💬 3 comments Opened Jan 23, 2026 by shacea Closed Jan 26, 2026

Bug Description

Plugin installation fails with EXDEV: cross-device link not permitted error when /tmp and /home directories are mounted on different filesystems/partitions.

Error Message

Error: Failed to install: EXDEV: cross-device link not permitted, rename '/home/work/.claude/plugins/cache/claude-ultimate-hud' -> '/tmp/claude-plugin-temp-1769151835954'

Environment

  • OS: Linux 5.15.0-124-generic (Ubuntu)
  • Claude Code Version: Latest
  • Filesystem Setup: /tmp and /home are on separate partitions

Steps to Reproduce

  1. Have a Linux system where /tmp and /home are on different filesystems
  2. Run /plugin install claude-ultimate-hud (or any plugin)
  3. Observe the EXDEV error

Root Cause

The rename() system call in Linux only works within the same filesystem. When attempting to move files between /home/work/.claude/plugins/cache/ and /tmp/, the operation fails because they're on different mount points.

Suggested Fix

Instead of using rename() directly, implement a fallback mechanism:

  1. Try rename() first (fast path for same filesystem)
  2. If EXDEV error occurs, fall back to copy + delete operation

Example pseudocode:

try {
  await fs.rename(src, dest);
} catch (err) {
  if (err.code === 'EXDEV') {
    await fs.copyFile(src, dest);
    await fs.unlink(src);
  } else {
    throw err;
  }
}

Current Workaround

Setting TMPDIR environment variable to a directory on the same filesystem as ~/.claude:

mkdir -p ~/.cache/tmp
export TMPDIR="$HOME/.cache/tmp"
claude

Impact

This affects users with:

  • Separate /tmp partition (common security practice)
  • /tmp mounted as tmpfs
  • Enterprise Linux setups with separate partition layouts

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗