[BUG] Plugin marketplace add hangs terminal when git clone requires authentication, bricks subsequent launches

Resolved 💬 3 comments Opened Mar 5, 2026 by igalbakal Closed Mar 9, 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?

---

Description

When claude plugin marketplace add clones a private/internal GitHub repository and git cannot authenticate silently (no SSH key or HTTPS credential helper configured for the host), git falls back to an interactive HTTPS credential prompt. Claude Code does not handle this — the prompt hangs the terminal since Claude Code doesn't pass through interactive stdin.

Worse, on every subsequent claude launch, it retries the failed clone, making the terminal hang again. The user is effectively locked out of Claude Code until they manually delete the broken state from the filesystem.

Expected Behavior

  • git clone failure should be caught and surfaced as a clear error message (e.g., "Failed to clone marketplace repository. Check your SSH keys or run gh auth login --hostname github.com")
  • Failed marketplace state should NOT be persisted — a failed marketplace add should be atomic (either succeed fully or leave no state behind)
  • Subsequent claude launches should not retry a previously failed clone

Actual Behavior

  • Terminal hangs indefinitely on interactive credential prompt
  • Broken state is written to ~/.claude/plugins/marketplaces/<repo>/ and ~/.claude/settings.json (extraKnownMarketplaces, enabledPlugins)
  • Every subsequent claude launch retries the failed operation, locking the user out

Environment

  • Claude Code: latest (observed across multiple versions)
  • OS: macOS (Apple Silicon)
  • Git: system git (Xcode CLT)
  • Context: Enterprise environment where marketplace repos are internal-visibility GitHub repositories requiring authentication

Impact

This is a "bricking" bug — users cannot use Claude Code at all after hitting it, and the recovery requires filesystem surgery that non-technical users struggle with. Multiple engineers on our team hit this during plugin onboarding.

What Should Happen?

Workaround

Users must manually clean up from another terminal:

rm -rf ~/.claude/plugins/marketplaces/<repo-name> && python3 -c "
import json, os
f = os.path.expanduser('~/.claude/settings.json')
s = json.load(open(f))
for k in ['extraKnownMarketplaces', 'enabledPlugins']:
    if k in s:
        s[k] = [e for e in s[k] if '<repo-name>' not in str(e)]
json.dump(s, open(f, 'w'), indent=2)
print('Cleaned.')
"

Then authenticate before retrying:

gh auth login --hostname github.com

Suggested Fix

  1. Set GIT_TERMINAL_PROMPT=0 when running git clone for marketplace operations — this disables interactive credential prompts and makes git fail immediately with a clear error
  2. Make marketplace add atomic — don't persist state until the clone succeeds
  3. On startup, validate marketplace clones before attempting to fetch updates — skip or remove broken entries

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce

  1. Ensure git is not configured with SSH keys or an HTTPS credential helper for github.com (e.g., gh auth login has not been run)
  2. Run:

``bash
claude plugin marketplace add <org>/<private-repo>
``

  1. Claude Code runs git clone git@github.com:<org>/<private-repo>.git
  2. SSH fails → git falls back to HTTPS → prompts for username interactively
  3. Terminal hangs (no way to provide input)
  4. Kill the process
  5. Run claude again — it retries the broken clone on startup → hangs again

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.62

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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