Quick fix
# One-liner: force HTTPS + CN acceleration (public repos clone anonymously, no key needed; drop the first segment if the mirror is down)
git config --global url."https://gh-proxy.com/https://github.com/".insteadOf "https://github.com/" && git config --global url."https://github.com/".insteadOf "git@github.com:"
Copy this line into the terminal, then re-run the install command.
What you will run into
You run claude-mem install --ide claude-code in the terminal; mid-install it hangs at "Adding marketplace…", then either reports SSH authentication failed or just sits there and the clone gets reset.
You assume it's the network, switch networks, turn off the proxy, retry several times - same result.
In fact the problem is usually not the network but the clone going over SSH while you have no usable SSH key (or the key's account is in an abnormal state).
Why this happens
Claude Code installing a plugin is essentially a git clone: it pulls the plugin repo (claude-mem upstream, ~271MB with submodules) to your machine. The installer defaults to the SSH address (git@github.com:...) for cloning:
| Clone channel | What it needs | Direct CN connection |
|---|---|---|
| SSH (default) | A usable SSH key | No key -> authentication fails immediately |
| HTTPS | Public repos need no credentials | Large repos slow/easy to drop; mirror recommended |
- Going SSH requires a working key; without a key, or with the key's GitHub account in an abnormal state, GitHub rejects the authentication outright ->
SSH authentication failed. - On direct CN connections to GitHub, clones of large repos often break mid-way -> looks like "stuck" or
Recv failure: Connection reset by peer.
The core of the fix is git config --global url.<new-address>.insteadOf <old-address>: git's URL rewriting mechanism - anything that "wants to access the old address" goes to the new one instead.
Public repos clone anonymously, no key needed; only the clone channel changes, the plugin's behavior itself doesn't change a single line - safe, no side effects.
The installer clones via SSH by default, and SSH authentication is key-pair based: git sends the request to GitHub's SSH service, GitHub verifies your identity with your public key — no key, or a key GitHub doesn't accept, and authentication fails outright (SSH authentication failed).
This is a "channel requires credentials" problem, not a network problem. The HTTPS channel, by contrast, is anonymous for public repos: no credentials needed, just network reachability.
git's url.<new>.insteadOf <old> is a URL rewriting mechanism: before any access, git checks the rewrite rules in its config and replaces any matching address — it works at the "addressing layer" and never touches the plugin's code logic, hence "only the channel changes, behavior unchanged".
That mechanism also explains why it's "safe with no side effects": what's rewritten is git's own address resolution; everything the plugin does after the clone is untouched.
The diagnostic path is fixed: SSH authentication failed = channel/credential problem (switch channel or configure a key) -> Connection reset/stuck = network problem (mirror/acceleration) -> after the change, verify the rewrite took effect with git config --get url.<new>.insteadOf.
Step by step
1. Confirm this is the problem — Required
Look for SSH authentication failed in the error, or install stuck at "Adding marketplace…" for a long time. If unsure, test the clone channel manually:
git ls-remote git@github.com:thedotmack/claude-mem
If it says Permission denied (publickey) or authentication failed, this is it.
2. Force HTTPS — Required
git config --global url."https://github.com/".insteadOf "git@github.com:"
This line makes git rewrite every git@github.com:... address to https://github.com/.... Public repos clone anonymously - no SSH key needed, and the authentication failure disappears. The global config applies to all git operations on this machine; harmless.
3. CN acceleration (optional, recommended) — Advanced
git config --global url."https://gh-proxy.com/https://github.com/".insteadOf "https://github.com/"
Direct clones of GitHub from CN often break. This line rewrites HTTPS addresses to the gh-proxy mirror.
The mirror occasionally goes down or slows: if acceleration makes things worse/slower, skip this step and keep only step 2's force-HTTPS; you can also use another mirror reachable from your network.
This insteadOf automatically applies to all future GitHub clones (including your other projects) without affecting anything else.
4. Reinstall — Required
claude-mem install --ide claude-code
You should quickly see SSH not configured, cloning via HTTPS, then ✔ Successfully added marketplace: thedotmack.
How to confirm it works
These two lines in the install output = success (measured output):
SSH not configured, cloning via HTTPS
✔ Successfully added marketplace: thedotmack
✔ Successfully installed plugin: claude-mem@thedotmack (scope: user)
claude-mem --version prints a version normally afterwards (measured: CLI 12.4.7, plugin 13.16.1 - an official phenomenon).
Other environments
| Environment | Notes |
|---|---|
| Windows / PowerShell | Identical git config commands; no admin needed |
| macOS | Same; macOS ships git, run in the terminal |
| Company proxy / campus network | If the mirror is slow/unavailable keep only "force HTTPS", or use a reachable mirror |
| Private repos | insteadOf only changes the clone channel, not auth; private repos still need HTTPS credentials or an SSH key |
| One-off effect only | -c injects temporarily for a single command: git -c url."https://github.com/".insteadOf=git@github.com: ls-remote git@github.com:thedotmack/claude-mem; note it can't reach inside the installer's clone |
| Undo | Run git config --global --unset-all url.https://gh-proxy.com/https://github.com/.insteadOf and git config --global --unset-all url.https://github.com/.insteadOf separately |
Symptom
claude-mem install --ide claude-code errors or hangs at "Adding marketplace…":
Failed to add marketplace: Failed to clone marketplace repository: SSH authentication failed.
Please ensure your SSH keys are configured for GitHub, or use an HTTPS URL instead.
Or on direct connection the clone makes no progress, then reports Recv failure: Connection reset by peer.
Cause
Claude Code plugin install = git clone of the upstream repo thedotmack/claude-mem (shallow clone + recursive submodules; ~271MB measured), and the installer defaults to the SSH URL (git@github.com:...). With no usable SSH key (or the key's account in an abnormal state) authentication fails; on direct CN connections large-repo clones break easily.
Solution
- Force HTTPS (public repos clone anonymously, no key needed):
git config --global url."https://github.com/".insteadOf "git@github.com:"
- CN acceleration (measured working 2026-08-28):
git config --global url."https://gh-proxy.com/https://github.com/".insteadOf "https://github.com/"
- CLI itself via mirror registry:
npm_config_registry=https://registry.npmmirror.com npm install -g claude-mem - The above only changes the git clone URL channel, not any plugin behavior; no account authorization needed.
Verification Evidence
- Measured in this marketplace 2026-08-28 (local repro log):
- Without rewriting: SSH authentication failed (the key's account is abnormal) -> install FAIL;
- With rewriting:
SSH not configured, cloning via HTTPS->✔ Successfully added marketplace: thedotmack->✔ Successfully installed plugin: claude-mem@thedotmack (scope: user)->claude-mem installed successfully!-> install exit=0; - Direct 90s incomplete vs gh-proxy accelerated clone completed within 60s (single measurement; repo measured 271MB).
Applicable tools (1)
This problem is linked from the tool pages below — reachable from either side.
claude-memSource & evidence
← Sessions & Memory domain | Problem Catalog Experience | Facing another issue? Go to the Helpdesk