[FEATURE] Windows: inherit SSH agent in git subshells (Git Bash / OpenSSH)
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Problem
On Windows, Claude Code spawns subprocesses to perform git operations (e.g. cloning
a marketplace repository). These subprocesses do not inherit the parent shell's SSH
agent, so any git operation over an SSH URL fails:
git@<host>: Permission denied (publickey).
fatal: Could not read from remote repository.
This happens even when the user's SSH keys are correctly configured and work in their
terminal. The subprocess simply has no visibility into the SSH agent loaded by Git Bash
or the Windows OpenSSH service — it's a process isolation boundary, not a key problem.
The result: users cannot use SSH URLs with Claude Code on Windows at all, even though
every other git tool on the same machine works fine.
Proposed Solution
Proposed Solution
When spawning git subprocesses on Windows, Claude Code should propagate SSH agent
context by:
- Forwarding
SSH_AUTH_SOCKfrom the parent environment if it is set (covers Git Bash
and WSL scenarios where the agent socket is already defined)
- Falling back to the Windows OpenSSH agent named pipe
(\\.\pipe\openssh-ssh-agent) if the OpenSSH service is running
This is the standard approach for making SSH agent context available across Windows
process boundaries, and would make Claude Code's git behavior consistent with the
terminal experience users already have.
Alternative Solutions
## Workaround
Use HTTPS URLs instead of SSH. Claude Code's subprocess can authenticate via the
git credential manager, which is accessible process-wide on Windows.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
## Example
A developer on Windows has SSH keys set up for their company's GitHub Enterprise
instance. In their terminal, git works perfectly:
$ ssh -T git@git.corp.example.com
Hi user! You've successfully authenticated.
$ git clone git@git.corp.example.com:org/repo.git
Cloning into 'repo'... done.
They open Claude Code and try to add a private plugin marketplace:
/plugin marketplace add git@git.corp.example.com:org/repo.git
Claude Code fails immediately:
Error: Failed to clone marketplace repository: SSH authentication failed.
Please ensure your SSH keys are configured for GitHub, or use an HTTPS URL instead.
git@git.corp.example.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Nothing is misconfigured. The SSH key is loaded and working. The failure occurs solely
because Claude Code's git subprocess runs in a context that has no SSH agent — the
agent socket from the user's Git Bash session simply isn't visible across the process
boundary.
Additional Context
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗