claude-code - 💡(How to fix) Fix [FEATURE] Support GITHUB_TOKEN / GIT_ASKPASS for plugin marketplace git operations [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49694Fetched 2026-04-17 08:34:03
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Fix Action

Workaround

Pre-clone the repo manually, then point the marketplace at the
local path:

git clone https://github.com/my-org/my-private-marketplace.git \ ~/.claude/plugins/marketplaces/my-marketplace

claude plugin marketplace add
~/.claude/plugins/marketplaces/my-marketplace
claude plugin install my-plugin

This works but requires additional scripting and means claude
plugin marketplace update won't be able to pull new changes (same auth issue).

Embedding token in URL — security concern

Embedding a token directly in the URL does work:

claude plugin marketplace add "https://x-access-token:${TOKEN}@gi thub.com/my-org/my-marketplace"

However, the CLI stores the full token in plaintext in
~/.claude/settings.json:

  "extraKnownMarketplaces": {                                    
    "my-marketplace": {                                          
      "source": {                                                
        "source": "git",                                         
        "url": "https://x-access-token:[email protected]/my-org
/my-marketplace.git"                                             
      }                                                          
    }                                                            
  }                                                              
}

This is a security risk — tokens persisted on disk can be leaked via backups, dotfile syncing, or compromised environments.


RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

claude plugin marketplace add cannot clone private GitHub
repositories in environments that rely on external credential
helpers (e.g., GIT_ASKPASS, GITHUB_TOKEN, GH_TOKEN).

The CLI spawns its own git clone subprocess, but does not pass
through standard git authentication environment variables. This
means that even though git clone works correctly in the user's
terminal (via credential helpers), the same operation fails when triggered by claude plugin marketplace add.

Reproduction

In an environment where git HTTPS authentication is provided via GIT_ASKPASS:

This works — git respects GIT_ASKPASS
git clone https://github.com/my-org/my-private-marketplace.git
✓ Cloning into 'my-private-marketplace'...

This fails — claude CLI does not pass GIT_ASKPASS to its git
subprocess
claude plugin marketplace add
https://github.com/my-org/my-private-marketplace
✘ HTTPS authentication failed. Please ensure your credential
helper is configured

Setting GITHUB_TOKEN also doesn't work
GITHUB_TOKEN=ghp_xxx claude plugin marketplace add
https://github.com/my-org/my-private-marketplace
✘ HTTPS authentication failed.

Workaround

Pre-clone the repo manually, then point the marketplace at the
local path:

git clone https://github.com/my-org/my-private-marketplace.git \ ~/.claude/plugins/marketplaces/my-marketplace

claude plugin marketplace add
~/.claude/plugins/marketplaces/my-marketplace
claude plugin install my-plugin

This works but requires additional scripting and means claude
plugin marketplace update won't be able to pull new changes (same auth issue).

Embedding token in URL — security concern

Embedding a token directly in the URL does work:

claude plugin marketplace add "https://x-access-token:${TOKEN}@gi thub.com/my-org/my-marketplace"

However, the CLI stores the full token in plaintext in
~/.claude/settings.json:

  "extraKnownMarketplaces": {                                    
    "my-marketplace": {                                          
      "source": {                                                
        "source": "git",                                         
        "url": "https://x-access-token:[email protected]/my-org
/my-marketplace.git"                                             
      }                                                          
    }                                                            
  }                                                              
}

This is a security risk — tokens persisted on disk can be leaked via backups, dotfile syncing, or compromised environments.


Proposed Solution

Support standard git authentication mechanisms in the CLI's git
operations:

  1. Inherit GIT_ASKPASS — pass through the existing GIT_ASKPASS
    environment variable to the git subprocess. This is how many
    CI/CD systems and remote development environments (Coder, Gitpod, Codespaces) provide credentials.
  2. Read GITHUB_TOKEN / GH_TOKEN — use these environment variables to authenticate HTTPS clones, consistent with how gh CLI and
    GitHub Actions work.
  3. Inherit git credential helpers — respect the user's configured credential.helper in their git config.
  4. If token-in-URL is supported, don't persist it — redact
    credentials from the stored URL in settings.json and re-resolve
    them at clone/update time from environment variables.

Alternative Solutions

No response

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

This is particularly important for:

  • Remote development environments (Coder, Gitpod, Codespaces)
    where auth is provided via credential helpers, not SSH keys or gh auth login
  • CI/CD pipelines where tokens are injected as environment
    variables
  • Organizations distributing private plugin marketplaces to their teams — the marketplace add + install should work with the same auth the user already has for git

Additional Context

Environment

  • Claude Code CLI v2.1.112
  • Linux (Alpine-based container)
  • Git authentication provided via GIT_ASKPASS credential helper

extent analysis

TL;DR

The most likely fix is to modify the Claude CLI to pass through standard git authentication environment variables, such as GIT_ASKPASS, GITHUB_TOKEN, or GH_TOKEN, to its git subprocess.

Guidance

  • The issue is caused by the Claude CLI not passing through git authentication environment variables to its subprocess, resulting in authentication failures when cloning private GitHub repositories.
  • To verify the issue, try cloning a private repository using the git clone command with the GIT_ASKPASS environment variable set, and then attempt to add the same repository using the Claude CLI.
  • A potential workaround is to pre-clone the repository manually and then point the marketplace at the local path, but this requires additional scripting and may not be suitable for all use cases.
  • The proposed solution involves modifying the Claude CLI to inherit GIT_ASKPASS, read GITHUB_TOKEN or GH_TOKEN, and respect the user's configured credential helper.

Example

No code snippet is provided as the issue is more related to the design and functionality of the Claude CLI rather than a specific code error.

Notes

The solution requires modifications to the Claude CLI, and it's essential to ensure that any changes do not introduce security risks, such as persisting tokens in plaintext.

Recommendation

Apply the proposed solution to support standard git authentication mechanisms in the CLI's git operations, as it addresses the root cause of the issue and provides a secure way to authenticate with private GitHub repositories.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] Support GITHUB_TOKEN / GIT_ASKPASS for plugin marketplace git operations [1 comments, 2 participants]