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

Resolved 💬 3 comments Opened Mar 12, 2026 by razvanz Closed Apr 10, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

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 '/home/user/.config/Claude/local-agent-mode-sessions/<session_id>/<id>/remote_cowork_plugins/<plugin_id>/.mcpb-cache'

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

What Should Happen?

.mcpb-cache should be created as an actual directory (or a symlink pointing to a valid, different target), allowing the MCP bridge cache to function normally.

Error Messages/Logs

ELOOP: too many symbolic links encountered, mkdir '/home/user/.config/Claude/local-agent-mode-sessions/9c636c54-90b2-49a8-990f-bc4bddc028ff/d3c115ca-456c-4290-b444-c2804f6e665e/remote_cowork_plugins/plugin_01PRZURvTYeLwtgacVug3mSa/.mcpb-cache'

# ls -la shows the self-referencing symlink:
.mcpb-cache -> /home/user/.config/Claude/local-agent-mode-sessions/9c636c54-90b2-49a8-990f-bc4bddc028ff/d3c115ca-456c-4290-b444-c2804f6e665e/remote_cowork_plugins/plugin_01PRZURvTYeLwtgacVug3mSa/.mcpb-cache

Steps to Reproduce

  1. Have a plugin (installed via marketplace) with .mcp.json defining MCP servers — e.g. an SSE server and a Docker stdio server
  2. Start a cowork session that loads that plugin
  3. Observe the ELOOP error repeatedly in the session
  4. Inspecting the path shows .mcpb-cache is a symlink to itself

The source plugin cache at ~/.claude/plugins/cache/<org>/<plugin>/<version>/ does not contain .mcpb-cache — the broken symlink is created during session setup.

Claude Model

Opus

Is this a regression?

I don't know

Claude Code Version

2.1.71 (Claude Code)

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

  • OS: Manjaro Linux (Wayland/GNOME), Electron 39
  • Claude Desktop: /usr/lib/claude-desktop-bin/app.asar
  • The Y5D() function in the binary builds the path via path.join(pluginDir, ".mcpb-cache"). The issue is that the session setup code symlinks this path to itself rather than creating a real directory.
  • Workaround: kill the agent-mode Claude Code subprocess (the one with --plugin-dir flags) and let Claude Desktop respawn it.

View original on GitHub ↗

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