[DOCS] Plugin docs missing `CLAUDE_CODE_PLUGIN_PREFER_HTTPS` for GitHub sources

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 5 comments · opened May 13, 2026 · closed Aug 17, 2026
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/env-vars

Section/Topic

Plugin-related environment variables, especially GitHub plugin and marketplace clone/auth behavior

Current Documentation

The environment variable index currently lists nearby plugin variables, but not this new one:

| CLAUDE_CODE_PLUGIN_CACHE_DIR | Override the plugins root directory. Despite the name, this sets the parent directory, not the cache itself: marketplaces and the plugin cache live in subdirectories under this path. Defaults to ~/.claude/plugins | | CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS | Timeout in milliseconds for git operations when installing or updating plugins (default: 120000). Increase this value for large repositories or slow network connections. See Git operations time out | | CLAUDE_CODE_PLUGIN_KEEP_MARKETPLACE_ON_FAILURE | Set to 1 to keep the existing marketplace cache when a git pull fails instead of wiping and re-cloning. Useful in offline or airgapped environments where re-cloning would fail the same way. See Marketplace updates fail in offline environments | | CLAUDE_CODE_PLUGIN_SEED_DIR | Path to one or more read-only plugin seed directories, separated by : on Unix or ; on Windows. Use this to bundle a pre-populated plugins directory into a container image. Claude Code registers marketplaces from these directories at startup and uses pre-cached plugins without re-cloning. See Pre-populate plugins for containers |

Related plugin docs also describe GitHub and SSH/HTTPS source handling without mentioning this setting:

Add a GitHub repository that contains a .claude-plugin/marketplace.json file using the owner/repo format—where owner is the GitHub username or organization and repo is the repository name.
The url field also accepts a GitHub shorthand (owner/repo) or SSH URLs (git@github.com:owner/repo.git).
Claude Code supports installing plugins from private repositories. For manual installation and updates, Claude Code uses your existing git credential helpers, so HTTPS access via gh auth login, macOS Keychain, or git-credential-store works the same as in your terminal. SSH access works as long as the host is already in your known_hosts file and the key is loaded in ssh-agent, since Claude Code suppresses interactive SSH prompts for the host fingerprint and key passphrase.

What's Wrong or Missing?

The v2.1.141 changelog adds CLAUDE_CODE_PLUGIN_PREFER_HTTPS to clone GitHub plugin sources over HTTPS instead of SSH for environments without a GitHub SSH key, but that setting is not documented in the environment variable reference or in the plugin marketplace/discovery guidance.

That leaves a gap for users who:

  1. add marketplaces or plugin sources using GitHub shorthand such as owner/repo, and
  2. authenticate to GitHub with HTTPS credentials or tokens rather than an SSH key.

The current docs explain GitHub shorthand, SSH URLs, and private-repository auth expectations, but they do not tell readers that there is now a dedicated setting to prefer HTTPS for GitHub plugin source clones.

Suggested Improvement

Add a CLAUDE_CODE_PLUGIN_PREFER_HTTPS entry to https://code.claude.com/docs/en/env-vars that documents:

  • what the variable changes (GitHub plugin source clones use HTTPS instead of SSH)
  • which source forms it affects (for example, GitHub shorthand / GitHub-backed plugin sources)
  • when to use it (environments without a GitHub SSH key, but with HTTPS credentials, gh auth, or tokens)
  • any accepted values and a minimal shell example

Then add a short note or cross-reference in the GitHub/plugin marketplace docs so readers who are following GitHub source setup instructions can discover the setting without hunting through release notes.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

| Page | Line(s) | Context |
|------|---------|---------|
| https://code.claude.com/docs/en/env-vars | 138-141 | Plugin-related environment variables are listed here, but CLAUDE_CODE_PLUGIN_PREFER_HTTPS is absent |
| https://code.claude.com/docs/en/discover-plugins | 188-205 | GitHub owner/repo marketplace setup is documented here without any note about preferring HTTPS for GitHub clones |
| https://code.claude.com/docs/en/plugin-marketplaces | 359-363, 508-510 | GitHub shorthand, SSH URLs, and HTTPS/SSH auth behavior are described here, but not the new HTTPS-preference setting |

Total scope: 3 pages affected

This appears to be a new documentation gap introduced with changelog entry v2.1.141.

View original on GitHub ↗

4 Comments

coygeek · 4 months ago

Verified against the latest docs; this still appears unresolved.

coygeek · 3 months ago

Verified against the latest docs; this still appears unresolved.

signal-yield · 2 months ago

Confirming this affects claude plugin install too, not just marketplace add — and that it's specific to the object-format source ({"source": "github", "repo": "..."}) resolution path, not the "SSH not configured" detection that marketplace add already has (that one correctly falls back to HTTPS and logs it explicitly).

Repro: fresh environment with no ~/.ssh directory at all (no keypair, no known_hosts). claude plugin marketplace add owner/marketplace-repo succeeds and logs "SSH not configured, cloning via HTTPS". claude plugin install some-plugin@marketplace-name, where the plugin's own source in marketplace.json is object-format ({"source": "github", "repo": "owner/plugin-repo"}), fails with:

No ED25519 host key is known for github.com and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

No "SSH not configured" fallback message is logged for this path — it goes straight to SSH.

CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1 fixes it completely — confirmed with a real public repo/plugin pair. Since this variable already exists but is undocumented, seems like the fastest fix here might just be documenting it prominently in plugin-marketplaces.md / discover-plugins.md, not necessarily changing the default.

Environment: Windows 11 Home 10.0.26200, Claude Code 2.1.178, git 2.54.0 (Git for Windows / MSYS)

bcherny collaborator · 1 month ago

This is now documented. CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1 makes GitHub owner/repo shorthand sources clone over HTTPS instead of SSH, for plugin install/update and /plugin marketplace add/update. It's listed on the environment variables page and mentioned in the marketplace docs:

The variable itself landed in v2.1.141 (https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md). Closing as done.

🤖 Generated with Claude Code

Showing cached comments. Read the full discussion on GitHub ↗