Claude Code – Troubleshooting

Plugins

Installing Plugins

Fixing the “Permission denied (publickey)” Error in Claude Code

If you’ve recently started using Claude Code and tried to install a plugin, you might have run into this frustrating error:

Plaintext

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

If you’re like me, you probably double-checked your GitHub SSH keys, tried to re-add them, and wondered why git clone works perfectly fine in your terminal, but fails inside the Claude Code plugin installer.

The Cause

The culprit is simple: Claude Code’s internal installer is hardcoded to use SSH (git@github.com) to fetch plugins. If your system isn’t configured for SSH authentication (even if your HTTPS git workflow is perfectly fine), the authentication handshake fails.

The Fix: Force HTTPS globally

Instead of fighting with SSH keys and agent configurations, you can tell Git to automatically translate any SSH request to an HTTPS request. This utilizes your existing cached GitHub credentials and bypasses the SSH issue entirely.

Open your terminal and run the following command:

❯ git config --global url."https://github.com/".insteadOf git@github.com:

What this does

This command updates your global Git configuration (located at ~/.gitconfig). It essentially adds a permanent rule that tells Git: “Whenever you are asked to connect to git@github.com, go to https://github.com instead.”

Verifying the Change

You can see exactly what this changed by running:

❯ git config --list --show-origin

You should see an entry pointing to your ~/.gitconfig file that maps the SSH URL to HTTPS. Once this is set, run your plugin install command again:

/plugin install <plugin-name>

It should now proceed without a hitch. If you ever need to revert this change for specific projects, you can simply remove that line from your ~/.gitconfig file or run git config --global --unset url."https://github.com/".insteadOf

❯ git config --global --unset url."[https://github.com/](https://github.com/)".insteadOf