Skip to content

[BUG] Plugin install fails with EXDEV when /tmp is tmpfs #14799

@discreteds

Description

@discreteds

Description

Plugin installation fails with EXDEV: cross-device link not permitted when /tmp is mounted as tmpfs (common default on modern Linux distros like Ubuntu, Fedora, Arch).

Steps to Reproduce

  1. Have /tmp mounted as tmpfs (default on Ubuntu 25.10, many other distros)
  2. Have ~/.claude on a different filesystem (ext4, btrfs, etc.)
  3. Attempt to install any plugin via /plugins UI

Error Message

Error: Failed to install: EXDEV: cross-device link not permitted, 
rename '/home/user/.claude/plugins/cache/hiivmind-corpus-github' -> '/tmp/claude-plugin-temp-1766187024245'

Environment

  • OS: Ubuntu 25.10 (Questing Quetzal)
  • Kernel: 6.17.0-8-generic
  • /tmp: tmpfs mount (tmpfs on /tmp type tmpfs)
  • ~/.claude: ext4 on nvme (/dev/nvme0n1p2)
  • Claude Code Version: Latest (1.0.40)

Root Cause

Node.js fs.rename() cannot move files across filesystem boundaries. The plugin installer uses rename() to move between ~/.claude/plugins/cache/ and /tmp/, which fails with EXDEV when these are on different mount points.

This is increasingly common as:

  • Ubuntu 21.04+ defaults to tmpfs for /tmp
  • Fedora, Arch, and others also use tmpfs /tmp by default
  • Many users have /home on a separate partition

Workaround

Set TMPDIR to a location on the same filesystem as ~/.claude:

mkdir -p ~/.claude/tmp
TMPDIR=~/.claude/tmp claude

Or permanently in shell profile:

echo 'export TMPDIR="$HOME/.claude/tmp"' >> ~/.bashrc

Suggested Fix

Catch EXDEV error and fall back to copy+unlink pattern:

try {
  fs.renameSync(src, dest);
} catch (err) {
  if (err.code === 'EXDEV') {
    fs.cpSync(src, dest, { recursive: true });
    fs.rmSync(src, { recursive: true, force: true });
  } else {
    throw err;
  }
}

This is the standard pattern for handling cross-device moves in Node.js.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on Linux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions