ELOOP: .mcpb-cache created as self-referencing symlink in cowork plugin sessions

Resolved 💬 2 comments Opened Mar 12, 2026 by razvanz Closed Mar 12, 2026

Bug

When a cowork session uses a remote plugin with MCP servers (e.g. an observability plugin with Elasticsearch SSE + Grafana Docker servers), the .mcpb-cache entry inside the session's remote_cowork_plugins/<plugin_id>/ directory is created as a symlink pointing to itself (same absolute path), causing:

ELOOP: too many symbolic links encountered, mkdir '.../.mcpb-cache'

Reproduction

  1. Have a plugin with .mcp.json defining MCP servers (SSE and/or stdio)
  2. Start a cowork session that uses that plugin
  3. Observe the error in the session

Root cause

Y5D(pluginDir) returns path.join(pluginDir, ".mcpb-cache") — the intended cache directory. However, when the plugin is copied/set up into the session directory at:

~/.config/Claude/local-agent-mode-sessions/<session>/<id>/remote_cowork_plugins/<plugin_id>/

the .mcpb-cache entry is created as a symlink targeting its own absolute path rather than as an actual directory:

.mcpb-cache -> /home/user/.config/Claude/local-agent-mode-sessions/.../plugin_id/.mcpb-cache

The symlink is also recreated continuously — deleting it and replacing with a real directory doesn't stick because the process overwrites it.

Environment

  • Claude Code: /opt/claude-code/bin/claude (compiled binary)
  • Claude Desktop: Electron via /usr/lib/claude-desktop-bin/app.asar
  • OS: Manjaro Linux (Wayland/GNOME)

Workaround

Killing the agent-mode Claude Code subprocess (the one with --plugin-dir flags) and letting Claude Desktop respawn it.

View original on GitHub ↗

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