Claude Code “Failed to Clone Marketplace Repository”: How to Fix It

Claude Code “Failed to Clone Marketplace Repository”: How to Fix It

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 seeWhat it meansFixHow we checked it
remote: Repository not found.Typo, deleted repo or a private repo you can’t seeCheck the address with git ls-remoteTested in the terminal
SSH host key is not in your known_hosts fileClaude Code tried SSH on an untrusted hostUse HTTPS, or accept the host key onceTested in the terminal
Git clone timed out after 1s (120s by default)The clone ran past the time limitRaise CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MSTested in the terminal
Marketplace file not found at ...The clone worked, but the file is missing or misplacedPut it at .claude-plugin/marketplace.jsonTested in the terminal
is not a valid GitHub owner/repo shorthandYou typed a host name in front of the repoUse owner/repo or the full https:// URLTested in the terminal
Path does not existThe local folder isn’t where you saidUse the right relative or absolute pathTested in the terminal
Cannot prompt because user interactivity has been disabledA private repo needs a password git can’t ask forStore a credential firstFrom the official docs
Command 'git' not found (Windows)Git isn’t installed or isn’t on your PATHInstall Git for Windows, open a new terminalFrom 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-marketplace

The 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.

Terminal showing Claude Code failed to clone marketplace repository with Repository not found over HTTPS and an SSH host key error
One add, two failures: HTTPS says the repo doesn’t exist, SSH says the host isn’t trusted.

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
git ls-remote showing Repository not found for a missing repo and a commit hash for the official Claude plugins repo
The missing repo fails, while the official marketplace repo answers with a commit hash.

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.

Claude Code errors for github.com shorthand, a missing local path and an unsupported file URL
A host name in front of the repo, a wrong folder and a file:// URL all fail early.
  • github.com/owner/repo is not valid shorthand. Use owner/repo, or the full https://github.com/owner/repo.git URL.
  • For GitLab or a company git server, give the full clone URL with https://. The docs warn that a bare gitlab.example.com/group/project.git is 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.

Claude Code cloning the official plugins marketplace over HTTPS and listing both added marketplaces
With HTTPS forced, the official marketplace cloned in about two seconds and showed up in the list.

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-git

For 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.

Claude Code Git clone timed out error with a hint to set CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS
The timeout message names the exact variable to raise.

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/repo

Our 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.

Claude Code Marketplace file not found errors for a GitHub repo and a local folder with marketplace.json at the wrong level
The broken folder has 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
claude plugin validate failing with No manifest found, then passing after the move, and the marketplace added
After the move, validation passed with two warnings and the marketplace was added.

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.

Decision ladder for Claude Code failed to clone marketplace repository: repo not found, SSH host key, private repo, timeout and missing marketplace file
Match the line under the error to its fix.

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 location means Git isn’t on your PATH. Install Git for Windows, open a new terminal, confirm git --version, then retry.
  • Offline or locked-down networks: set CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE=1 so 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_MS in one terminal and retrying in another.
  • Expecting GITHUB_TOKEN alone to unlock a private repo.
  • Typing a bare marketplace name like claude-plugins-official as the source. Use anthropics/claude-plugins-official.

Pro Tips

  • Run claude plugin marketplace list after every add. It shows each marketplace and where it came from.
  • Add CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1 to your shell profile if you never use SSH with GitHub.
  • Run claude plugin validate in 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

Cheat sheet of Claude Code marketplace clone error messages with their meaning and fix commands
Marketplace clone errors and fixes on one card.

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.

Newsletter

New AI tools in your inbox

The best new tools and the AI news that matters, in one short email. Unsubscribe any time.

Free · No spam · Unsubscribe any time

✓ Looks like you’re subscribed

Loading Google’s sign-up form…

Looks like you’re already subscribed

Thanks for reading! New AI tools and the AI news that matters will land in your inbox.

Not subscribed yet? Refresh the page to load the sign-up form.

The sign-up form couldn’t load. If you use an ad or content blocker, allow news.google.com and reload the page.

Free instant check before you pay. Takes a few seconds.

Scroll to Top