
The Claude Code “failed to clone marketplace repository” error means git could not copy the marketplace onto your machine. The line under the message tells you why. Repository not found means the owner/repo is misspelled, gone or private.
SSH host key is not in your known_hosts file means Claude Code tried SSH on a host your machine has never trusted. Git clone timed out after 120s means the repository was too big or your connection too slow.
The quick fixes are just as short. Check the address with git ls-remote, switch GitHub sources to HTTPS with CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1, store a git credential for private repos with gh auth login and gh auth setup-git, and raise the limit with CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS=300000 for big repos. If the clone works but the add still fails, the marketplace file is in the wrong folder.
We triggered every one of these errors on purpose and fixed each one. This guide shows the real output, what it means and the exact fix.
Browse all our Claude Code tutorials for more fixes and how-tos.
Tested with Claude Code v2.1.332 on macOS on December 3, 2026. Every test used a throwaway config folder and a demo folder, so the real Claude Code setup was never touched. Fixes marked as coming from the docs follow Anthropic’s official plugin troubleshooting page.
Quick Summary: Marketplace Clone Errors and Fixes
Find the line you see under the error in the first column. The first six rows are failures we triggered ourselves, so the wording is exactly what v2.1.332 printed.
| Line you see | What it means | Fix | How we checked it |
|---|---|---|---|
remote: Repository not found. | Typo, deleted repo or a private repo you can’t see | Check the address with git ls-remote | Tested in the terminal |
SSH host key is not in your known_hosts file | Claude Code tried SSH on an untrusted host | Use HTTPS, or accept the host key once | Tested in the terminal |
Git clone timed out after 1s (120s by default) | The clone ran past the time limit | Raise CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS | Tested in the terminal |
Marketplace file not found at ... | The clone worked, but the file is missing or misplaced | Put it at .claude-plugin/marketplace.json | Tested in the terminal |
is not a valid GitHub owner/repo shorthand | You typed a host name in front of the repo | Use owner/repo or the full https:// URL | Tested in the terminal |
Path does not exist | The local folder isn’t where you said | Use the right relative or absolute path | Tested in the terminal |
Cannot prompt because user interactivity has been disabled | A private repo needs a password git can’t ask for | Store a credential first | From the official docs |
Command 'git' not found (Windows) | Git isn’t installed or isn’t on your PATH | Install Git for Windows, open a new terminal | From the official docs |
Why Claude Code Fails to Clone a Marketplace Repository
A plugin marketplace is a git repository or folder with a .claude-plugin/marketplace.json file that lists plugins. When you run /plugin marketplace add in a session or claude plugin marketplace add in your shell, Claude Code clones that repository onto your machine. If you are new to the idea, our guide to plugin marketplaces explained covers the basics.
The clone runs with plain git, but with prompts switched off. The official plugin install guide says Claude Code uses the git credentials already on your machine and never prompts. So a repo that would make git ask for a password, a passphrase or a host key simply fails.
For GitHub owner/repo shorthand there is one more twist. Claude Code checks whether your SSH key works with github.com, tries the matching method, and falls back to the other one. When both fail, you get both errors in one long message, which is exactly what we saw.
The words “failed to clone” are only the headline. The real cause is always in the next few lines, so read past the first sentence.
How We Reproduced “Failed to Clone Marketplace Repository”
We made a demo folder with two tiny marketplaces: good-market, laid out correctly with one small plugin, and broken-market, with marketplace.json in the wrong place. Then we pointed Claude Code at a throwaway config folder so nothing reached the real setup:
export CLAUDE_CONFIG_DIR=~/claude-code-demos/mkt/cfg
claude plugin marketplace add aip-demo-missing/plugins-marketplaceThe claude plugin marketplace commands don’t send prompts to a model, so these tests cost nothing in usage. The Mac we used had no GitHub SSH key and had never connected to github.com over SSH, which is common on a fresh machine.

Look at how the message is built. It starts with Fetching the marketplace from GitHub failed on both attempts, then gives the HTTPS result and the SSH result. In this case the HTTPS line is the one that matters, because the repo really doesn’t exist.
Fix 1: Check That the Repository Exists
The troubleshooting page says to check the repository first, because a misspelled name, a deleted repo and a private repo you can’t see all end in the same message. Run git ls-remote on the URL from your terminal. The docs suggest turning off askpass so the test behaves like Claude Code:
git -c core.askPass= ls-remote https://github.com/OWNER/REPO.git
If you get a commit hash, the repo exists and you can reach it. If you get Repository not found, fix the spelling or ask whoever shared the add command for the right source. For a private repo, this same test also tells you whether your credentials work.
Fix the Source Format
Some sources fail before git even runs. We tried three common slips, and each one got its own clear message.

file:// URL all fail early.github.com/owner/repois not valid shorthand. Useowner/repo, or the fullhttps://github.com/owner/repo.gitURL.- For GitLab or a company git server, give the full clone URL with
https://. The docs warn that a baregitlab.example.com/group/project.gitis read as GitHub shorthand and rejected. - Local folders must start with
./,../,/or~. A relative path resolves against your current folder. - A
file://URL isn’t accepted. Pass the folder path instead.
Fix 2: Use HTTPS When SSH Fails
The SSH half of our first error said SSH host key is not in your known_hosts file. Claude Code clones with strict host key checking, so it refuses a host you have never accepted. You have two ways out.
For public repos, the easy fix is HTTPS. Set CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1 and Claude Code skips the SSH check for GitHub owner/repo sources. The environment variables reference lists it as useful for CI runners, containers and any machine without a GitHub SSH key.

If you do want SSH, the docs say to connect once from your terminal so you can check and accept the fingerprint, then retry:
ssh -T [email protected]Your SSH key must also work without a passphrase prompt, for example because it’s loaded in ssh-agent. If a host’s key changed, the message says SSH host key has changed and suggests ssh-keygen -R <host>. We didn’t run these on our test Mac, so this part comes from the docs.
Fix 3: Store a Credential for Private Repositories
A private marketplace fails when git needs to ask for a username or token. According to the docs, the error then includes lines like fatal: Cannot prompt because user interactivity has been disabled, terminal prompts disabled or fatal: unable to get password from user.
The fix is to give git a credential it can use silently. On GitHub, the docs give two commands:
gh auth login
gh auth setup-gitFor other hosts, store a personal access token in your git credential helper, such as the macOS Keychain helper. Then test with git -c core.askPass= ls-remote <url>. When that works without a prompt, the add will work too.
Setting GITHUB_TOKEN in your shell does not log git in by itself. The docs explain that a token works through a credential helper, such as the one gh sets up. If you also push code from Claude Code, our guide to git authentication fixes covers the same credential setup.
Fix 4: Raise the Clone Time Limit
Each clone gets 120 seconds by default. A large repo or a slow network can run out of time. To show the message without waiting, we set the limit to under a second.

The value is in milliseconds. Set it in your shell, then run the add again in that same shell:
export CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS=300000
claude plugin marketplace add owner/repoOur successful run above printed Cloning repository (timeout: 300s), which confirms the new limit took effect.
The docs add two more options. For a monorepo, use --sparse <paths> to check out only the folders you need. For a repo with big git submodules, update Claude Code, because v2.1.295 and later fetch only the submodules that hold plugin files.
Fix 5: Put marketplace.json in the Right Folder
Sometimes the clone works and the add still fails. We added a real public repo that is not a marketplace, plus our broken local folder. Both failed with Marketplace file not found.

marketplace.json at its root instead of inside .claude-plugin.Claude Code looks for .claude-plugin/marketplace.json at the repository root by default. If you own the marketplace, move the file there. The built-in validator spots the problem before you add anything:
claude plugin validate ./broken-market
mkdir broken-market/.claude-plugin
mv broken-market/marketplace.json broken-market/.claude-plugin/
claude plugin marketplace add ./broken-market
If someone else hosts the marketplace, you can’t move their file. Ask the owner for the exact source they publish. For building your own, our walkthrough on how to build a plugin shows a working layout.
Which Failed to Clone Marketplace Repository Fix Do You Need?
Use this ladder when the error scrolls past too fast. Start at the top, match the line under the error, and take the fix on the right.

Other Cases From the Official Docs
A few situations we could not reproduce on a Mac, or chose not to. These steps follow Anthropic’s plugin troubleshooting page.
- Windows:
Command 'git' not found or is in an unsafe locationmeans Git isn’t on yourPATH. Install Git for Windows, open a new terminal, confirmgit --version, then retry. - Offline or locked-down networks: set
CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE=1so background updates keep your existing copy instead of re-cloning and failing every session. - GitHub Enterprise Server: a policy error means an admin must allow the host in your organization’s settings.
- Git LFS: the clone never downloads LFS content, so files tracked that way arrive as small pointer files.
Try It Yourself
You can rehearse the whole thing safely in a spare folder. Ask Claude Code to build a broken marketplace, then fix it with the commands above:
Create a folder called practice-market with a marketplace.json at its root
(not inside .claude-plugin) that lists one plugin called hello in
./plugins/hello. Give the plugin a plugin.json and one tiny skill.
Don't add the marketplace. Just tell me the command to add it.Run the add, read the error, then run claude plugin validate ./practice-market and move the file. You will see the same before and after we did.
Common Mistakes
- Reading only the first line. The cause sits under
Failed to clone marketplace repository:, not in it. - Pasting the browser address with
github.com/in front of the shorthand. - Setting
CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MSin one terminal and retrying in another. - Expecting
GITHUB_TOKENalone to unlock a private repo. - Typing a bare marketplace name like
claude-plugins-officialas the source. Useanthropics/claude-plugins-official.
Pro Tips
- Run
claude plugin marketplace listafter every add. It shows each marketplace and where it came from. - Add
CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1to your shell profile if you never use SSH with GitHub. - Run
claude plugin validatein CI on your own marketplace repo so a bad layout never ships. - If the add works but a plugin won’t install, see our fix for plugin not found errors, and our plugins guide for managing what you install.
- For errors outside plugins, our list of common errors is a good next stop.
Cheat Sheet

Frequently Asked Questions
What does “failed to clone marketplace repository” mean in Claude Code?
Git could not copy the marketplace repo onto your machine. The lines after the message give the reason, most often a repo that doesn’t exist, an SSH host key that isn’t trusted, a missing credential or a timeout.
Why does the error mention both HTTPS and SSH?
For GitHub owner/repo sources, Claude Code tries one method and falls back to the other. When both fail, it prints both results. Fix the one you plan to use, usually HTTPS.
How do I add a private marketplace?
Make sure git can reach it without a prompt. On GitHub, run gh auth login and gh auth setup-git, test with git ls-remote, then run the add again.
How long does Claude Code wait for a marketplace clone?
120 seconds by default. Raise it with CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS, which takes milliseconds, so 300000 means five minutes.
Does a failed add change my settings?
In our tests, failed adds registered nothing, and claude plugin marketplace list showed only the ones that worked. Learn more about the model behind the tool on our Claude AI page.
Conclusion
The Claude Code “failed to clone marketplace repository” error is git telling you it couldn’t copy the repo, and the real cause is always in the lines just below. Check the address with git ls-remote, use CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1 when SSH isn’t set up, store a credential for private repos, raise CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS for big ones, and keep marketplace.json inside .claude-plugin. With those five fixes, almost every failed add becomes a one-line retry, and the official marketplace guide covers hosting your own.


