Skip to content

[BUG] claude install corrupts project git remote URL to anthropics/claude-plugins-official on macOS #32793

@podlesny-j

Description

@podlesny-j

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

  1. Have a git repository open in the terminal (any repo with an origin remote)
  2. Run claude install from within that directory
  3. 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/main

This 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 install

Then 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:pluginsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions