Plugin cache writes output directories inside cloned repo, causing recursive ENAMETOOLONG

Resolved 💬 4 comments Opened Mar 12, 2026 by MatthiasPdx Closed Apr 9, 2026

Environment:

  • Claude Code (macOS Darwin 25.3.0)
  • Plugin: marketplace plugin from GitHub repo (luqrahq/luqra-skills)

Description:
When caching a marketplace plugin, the cacher clones the source repo and then creates plugin-specific subdirectories (e.g., task-mgr/1.0.6/) inside the cloned repo's directory. On subsequent cache operations, these output directories are treated as repo contents and get re-cached recursively until hitting the OS path length limit.

Cache structure observed:

~/.claude/plugins/cache/luqra-skills/
├── README.md              ← cloned repo contents
├── docs/
├── project-registry.yaml
├── skills/
└── task-mgr/              ← plugin cache output, co-located with repo contents
    └── 1.0.6/
        ├── .claude/       ← cloned repo contents (again)
        ├── docs/
        ├── project-registry.yaml
        └── task-mgr/      ← recursive: cache output inside its own output
            └── 1.0.6/
                └── task-mgr/
                    └── 1.0.6/
                        └── ... (repeats ~55 times, paths reach 1011 chars)

Error on plugin load:

Failed to download/cache plugin task-mgr: ENAMETOOLONG: name too long, open

Root cause:
The plugin cache output directory is written inside the cloned repo tree. The cacher doesn't exclude its own output directories when reading the repo contents, so it copies them into the next cache layer recursively.

This affects any plugin name — the name itself doesn't matter. We tested with luqra-skills, luqra-task-manager, and task-mgr and all eventually produce the same recursion.

Reproduction:

  1. Create a GitHub repo with .claude-plugin/marketplace.json listing plugins
  2. Add the repo as a marketplace in Claude Code
  3. Install one of the listed plugins
  4. Run /reload-plugins a few times
  5. Observe recursive directories in ~/.claude/plugins/cache/{marketplace}/{plugin-name}/

Expected behavior:
Plugin cache output should be written to a location separate from the cloned repo contents, or the cacher should exclude its own output directories when copying.

Suggested fix:
Either:

  • Clone to a temp directory, copy needed files to the cache location (don't cache in-place)
  • Or add the cache output path to an exclusion list when traversing repo contents

Workaround:
rm -rf ~/.claude/plugins/cache/{marketplace} before each reload. The recursion rebuilds on the next cache operation.

View original on GitHub ↗

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