[BUG] Plugin marketplace add hangs terminal when git clone requires authentication, bricks subsequent launches
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 clonefailure should be caught and surfaced as a clear error message (e.g., "Failed to clone marketplace repository. Check your SSH keys or rungh auth login --hostname github.com")- Failed marketplace state should NOT be persisted — a failed
marketplace addshould be atomic (either succeed fully or leave no state behind) - Subsequent
claudelaunches 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
claudelaunch 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
- Set
GIT_TERMINAL_PROMPT=0when runninggit clonefor marketplace operations — this disables interactive credential prompts and makes git fail immediately with a clear error - Make
marketplace addatomic — don't persist state until the clone succeeds - On startup, validate marketplace clones before attempting to fetch updates — skip or remove broken entries
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- Ensure git is not configured with SSH keys or an HTTPS credential helper for github.com (e.g.,
gh auth loginhas not been run) - Run:
``bash``
claude plugin marketplace add <org>/<private-repo>
- Claude Code runs
git clone git@github.com:<org>/<private-repo>.git - SSH fails → git falls back to HTTPS → prompts for username interactively
- Terminal hangs (no way to provide input)
- Kill the process
- Run
claudeagain — 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_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗