claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Plugin install fails with EXDEV when /tmp is on different filesystem

Open randalmurphal opened this issue 10 months ago • 1 comments

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:
    • /home on /dev/nvme0n1p3 (ext4/btrfs)
    • /tmp on tmpfs (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

  1. Have a system where /tmp is on tmpfs (default on most modern Linux distros)
  2. Run Claude Code
  3. Try to install any plugin (e.g., /plugin install <plugin>)
  4. Observe the EXDEV error

randalmurphal avatar Jan 14 '26 23:01 randalmurphal

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/18115
  2. 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

github-actions[bot] avatar Jan 14 '26 23:01 github-actions[bot]

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

github-actions[bot] avatar Jan 18 '26 09:01 github-actions[bot]

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.

github-actions[bot] avatar Jan 26 '26 14:01 github-actions[bot]