-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Description
Summary
Running claude install (to update Claude Code) changes the origin remote URL of whatever git repository is in the current working directory to https://github.com/anthropics/claude-plugins-official.git. It also injects duplicate fetch = +refs/heads/main:refs/remotes/origin/main refspecs into .git/config, which breaks subsequent git fetch calls with fatal: couldn't find remote ref refs/heads/main.
Environment
- OS: macOS 26.3.1 (arm64)
- Claude Code version: 2.1.72
- Shell: zsh
- Project VCS: GitLab (HTTPS remote)
Steps to Reproduce
- Have a git repository open in the terminal (any repo with an
originremote) - Run
claude installfrom within that directory - After installation completes, check
git remote -v
Observed Behavior
$ git remote -v
origin https://github.com/anthropics/claude-plugins-official.git (fetch)
origin https://github.com/anthropics/claude-plugins-official.git (push)
Additionally, .git/config gains duplicate fetch refspecs:
[remote "origin"]
url = https://github.com/anthropics/claude-plugins-official.git
fetch = +refs/heads/*:refs/remotes/origin/*
glab-resolved-head = head
fetch = +refs/heads/main:refs/remotes/origin/main
fetch = +refs/heads/main:refs/remotes/origin/mainThis breaks git fetch:
fatal: couldn't find remote ref refs/heads/main
fatal: invalid upstream 'origin/master'
Expected Behavior
claude install should not modify the git configuration of the user's project at all.
Root Cause Analysis
Claude Code's plugin marketplace updater manages a local git clone of anthropics/claude-plugins-official at ~/.claude/plugins/marketplaces/claude-plugins-official/. On my machine, that directory exists but is empty (no .git inside):
$ ls -la ~/.claude/plugins/marketplaces/claude-plugins-official/
# directory is empty
// ~/.claude/plugins/known_marketplaces.json
{
"claude-plugins-official": {
"source": { "source": "github", "repo": "anthropics/claude-plugins-official" },
"installLocation": "/home/user/.claude/plugins/marketplaces/claude-plugins-official",
"lastUpdated": "2026-03-10T11:32:03.271Z"
}
}The marketplace updater appears to run git commands (e.g. git remote set-url origin https://github.com/anthropics/claude-plugins-official.git) without specifying the target repository path (i.e. without git -C /path/to/marketplace/dir). Since these commands run in the user's current working directory, they affect the user's project repo instead of the marketplace clone.
Workaround
Run claude install from a non-git directory:
cd ~ && claude installThen restore the remote manually:
git remote set-url origin <correct-url>And remove the injected refspecs from .git/config manually, then re-fetch.
Related Issues
- [BUG] Plugin marketplace creates directories with Windows paths inside working directory on WSL2 #32661 — same "wrong cwd" bug class (plugin marketplace git ops in wrong directory), but Windows/WSL2 path mismatch variant
- Plugin marketplace: internal git clone fails silently on macOS #28373 — plugin marketplace git clone fails silently on macOS (possibly same underlying failure leaving the directory empty)