claude-code - 💡(How to fix) Fix Plugin marketplace installation flow needs improvement [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49051Fetched 2026-04-17 08:52:15
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3commented ×1

Error Message

具体错误示例

/plugin marketplace add milla-jovovich/mempalace

第一次:git clone 超时

Error: Failed to clone marketplace repository: Git clone timed out after 120s

第二次:文件夹已存在但内容不完整

Error: EBUSY: resource busy or locked, rm 'C:\Users\sjlia.claude\plugins\marketplaces\milla-jovovich\mempalace'

Code Example

## 具体错误示例
  
  /plugin marketplace add milla-jovovich/mempalace
  # 第一次:git clone 超时
  Error: Failed to clone marketplace repository: Git clone timed out after 120s

  # 第二次:文件夹已存在但内容不完整
  Error: EBUSY: resource busy or locked, rm 'C:\Users\sjlia\.claude\plugins\marketplaces\milla-jovovich\mempalace'
RAW_BUFFERClick to expand / collapse

Preflight Checklist

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

What's Wrong?

Claude Code Plugin Marketplace Installation Issue Report

问题描述

当前 /plugin marketplace add 命令的安装流程存在以下问题:

1. 缺少预检查机制

  • 命令直接执行 git clone,不检查目标文件夹是否已存在
  • 即使插件已经部分或完全下载,也会强制删除并重新克隆

2. 网络超时问题

  • 固定 120 秒超时时间对网络较慢的用户不友好
  • 没有重试机制,第一次失败后需要手动重试

3. 资源管理问题

  • 部分下载失败时会创建空目录,导致后续操作失败(EBUSY 错误)
  • 清理逻辑不够健壮

What Should Happen?

用户建议

  1. 改进安装流程

建议的检查逻辑

if [ -d "$PLUGIN_DIR/$PLUGIN_NAME" ]; then if [ -d "$PLUGIN_DIR/$PLUGIN_NAME/.git" ]; then echo "Plugin already exists. Update? (y/n)" read -r response if [[ "$response" =~ ^[Yy]$ ]]; then cd "$PLUGIN_DIR/$PLUGIN_NAME" && git pull else exit 0 fi else echo "Incomplete installation found. Cleaning up..." rm -rf "$PLUGIN_DIR/$PLUGIN_NAME" fi fi

  1. 增加网络容错机制
  • 设置可配置的超时时间(环境变量 CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS)
  • 增加重试机制(默认 2-3 次)
  • 提供网络状态检测
  1. 提供更好的用户体验
  • 显示下载进度
  • 在失败时提供手动安装选项
  • 保留已下载的部分文件供恢复
  1. 文档改进
  • 在安装前检查系统网络状态
  • 提供详细的错误说明和解决方案
  • 支持离线安装模式

影响范围

  • 网络条件较差的用户
  • 大型插件仓库(如包含大量依赖的插件)
  • CI/CD 环境中的自动化安装

Error Messages/Logs

## 具体错误示例
  
  /plugin marketplace add milla-jovovich/mempalace
  # 第一次:git clone 超时
  Error: Failed to clone marketplace repository: Git clone timed out after 120s

  # 第二次:文件夹已存在但内容不完整
  Error: EBUSY: resource busy or locked, rm 'C:\Users\sjlia\.claude\plugins\marketplaces\milla-jovovich\mempalace'

Steps to Reproduce

临时解决方案

对于受影响的用户,建议:

  1. 设置环境变量增加超时时间: export CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS=300000 # 5分钟
  2. 使用手动安装方式: - 手动下载仓库 - 解压到插件目录 - 初始化 git 仓库

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

v2.1.110

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

No response

extent analysis

TL;DR

To address the Claude Code Plugin Marketplace installation issues, implement a pre-check mechanism, introduce a configurable timeout with retries, and enhance resource management and user experience.

Guidance

  1. Implement pre-installation checks: Before executing git clone, check if the target plugin directory exists and handle cases where the plugin is already partially or fully downloaded.
  2. Introduce a configurable timeout with retries: Allow users to set a custom timeout via an environment variable (e.g., CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS) and implement a retry mechanism (e.g., 2-3 attempts) to handle network timeouts.
  3. Enhance resource management: Improve cleanup logic to prevent empty directories and handle cases where downloads fail, causing EBUSY errors.
  4. Improve user experience: Display download progress, offer manual installation options upon failure, and preserve partially downloaded files for recovery.

Example

A suggested check logic in shell script:

if [ -d "$PLUGIN_DIR/$PLUGIN_NAME" ]; then
    if [ -d "$PLUGIN_DIR/$PLUGIN_NAME/.git" ]; then
        echo "Plugin already exists. Update? (y/n)"
        read -r response
        if [[ "$response" =~ ^[Yy]$ ]]; then
            cd "$PLUGIN_DIR/$PLUGIN_NAME" && git pull
        else
            exit 0
        fi
    else
        echo "Incomplete installation found. Cleaning up..."
        rm -rf "$PLUGIN_DIR/$PLUGIN_NAME"
    fi
fi

Notes

The provided suggestions aim to address the reported issues but may require further refinement based on the specific implementation details of the Claude Code Plugin Marketplace.

Recommendation

Apply the suggested workarounds, such as setting a longer timeout via CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS and using manual installation methods, until a more comprehensive fix is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING