[BUG] Startup SSH connectivity check triggers hardware key prompt (YubiKey/GPG agent)
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
On every session start, Claude Code checks GitHub access by running:
ssh -T -o BatchMode=yes -o ConnectTimeout=2 -o StrictHostKeyChecking=yes git@github.com
For users who use gpg-agent as their SSH agent (via enable-ssh-support) with keys stored on a hardware token (e.g. YubiKey), this triggers a GPG pinentry prompt (touch/PIN) on every new conversation — even when the session doesn't involve any remote git operations.
While BatchMode=yes prevents interactive passphrase prompts from OpenSSH directly, it does not suppress prompts originating from the SSH agent. When gpg-agent acts as the SSH agent, it uses its own pinentry program to request user confirmation, which BatchMode cannot control.
Steps to reproduce
- Use
gpg-agentwithenable-ssh-supportas your SSH agent - Have a GPG authentication subkey on a hardware token (e.g. YubiKey) configured for
github.com(https://github.com/drduh/YubiKey-Guide) - Start a new Claude Code session in any git repo with a GitHub remote
Observed behavior
GPG pinentry prompts the user to authorize the hardware key on every session start, adding friction to the workflow.
Environment
- SSH agent:
gpg-agentwithenable-ssh-support - Hardware token: YubiKey
- Confirmed via
strace -f -e trace=execve claude 2>&1 | grep -E 'gpg|git|ssh'
Proposed Solution
No user interaction required at startup. The connectivity check should either:
- Be opt-in or deferrable (only run when a remote operation is actually needed)
- Be skippable via a config flag (e.g.
"skipGitHubConnectivityCheck": true)
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
_No response_
Additional Context
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗