[BUG] Claude accesses git origin server on startup before any commands issued
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I'm using Claude Code, on an ubuntu machine. Sometimes (not always) when I run claude in a directory with a git repo, after it starts up, and shows its little > Try "write a todo list" or whatever, I get prompted for the passphrase of my SSH key to github.com - the SSH key is associated with the origin server of the current git repo I'm in.
Before anybody suggests (as Claude did) that I just cache my passphrase or some such - no, that's exactly what I don't want. I explicitly do not want claude interacting with the origin server, which is why the passphrase is there. It can do all the coding it wants locally, but deliberately has zero authZ to do anything off the box.
So, Claude appears to be doing something with the github origin server completely by itself without being prompted to do anything - as part of "orienting itself" or similar. This is not good behavior, and is the key bug to be fixed.
Interestingly, this appears to be some kind of race condition. I have a set of tests on a utility which automates running claude and when these tests are run in parallel, it prompts for the ssh passphrase almost every time. When they're run serially in a single thread, I think this never happens. When running the tool manually it certainly seems to happen more when I run multiple instances in quick succession. (The current release which starts up faster is much harder to repo than slightly older 2.0.69.)
What Should Happen?
NEVER attempt to access my github origin server without being asked to!
Error Messages/Logs
Steps to Reproduce
Set up your ~/.ssh/config like this:
Host github.com
Hostname github.com
user git
IdentityFile ~/.ssh/my-github-key-with-passphrase.pem
And create an ED2215 key with a passphrase as ~/.ssh/my-github-key-with-passphrase.pem
Create a file race.sh:
#!/bin/bash
claude -p "what time is it?" &
claude -p "what time is it?" &
claude -p "what time is it?" &
claude -p "what time is it?" &
claude -p "what time is it?" &
Then run it:
$ ./race.sh
Enter passphrase for key '/home/ubuntu/.ssh/my-github-key-with-passphrase.pem':
Enter passphrase for key '/home/ubuntu/.ssh/my-github-key-with-passphrase.pem':
Enter passphrase for key '/home/ubuntu/.ssh/my-github-key-with-passphrase.pem':
Enter passphrase for key '/home/ubuntu/.ssh/my-github-key-with-passphrase.pem':
I don't have access to real-time information like the current time. You can check the time on your device or run:
```bash
date
in your terminal to see the current date and time.
I don't have access to real-time information like the current time. You can check the time on your device or run:
date
in your terminal to see the current date and time.
I don't have access to the current time. You can check the time on your system by running:
date
Or if you'd like, I can run that command for you.
I don't have access to the current time. I can only see today's date (2026-01-26) from my environment information, but not the current time.
You can check the time by running date in your terminal, or checking your system clock.
I don't have access to real-time clock information. To check the current time on your system, you can run:
date
Would you like me to run that command for you?
### Claude Model
Sonnet (default)
### Is this a regression?
I don't know
### Last Working Version
_No response_
### Claude Code Version
2.1.19
### Platform
AWS Bedrock
### Operating System
Ubuntu/Debian Linux
### Terminal/Shell
iTerm2
### Additional Information
_No response_Showing cached comments. Read the full discussion on GitHub ↗
12 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I think this might be different from/broader than #14485:
I have this same issue.
This is the same problem I reported in https://github.com/anthropics/claude-code/issues/14346 but it was closed. This is still an issue, and my workaround below is now bypassed in the latest version in my global
.gitconfig:Whenever I send the first message with Claude, I get prompted to unlock my YubiKey SSH keys, and I also see this in
ps auxClaude should _NEVER_ be doing anything with marketplaces using ssh to github...
Looks like the same as #16274 too.
Same happens to me on macos with claude 2.1.63. On first prompt it somehow triggers ssh key prompt (which i store in 1Password)
Still an issue on claude 2.1.69 - first prompt always triggers ssh-agent for key access, regardless of what is actually being requested.
I see very similar behavior in v2.1.71 with my SSH key managed via 1Password. In my case, the only difference is that Git commands that access the remote repo appear to only run after I send my first prompt to Claude Code.
Screencast illustrating the issue:
https://github.com/user-attachments/assets/20ffe6e2-38ab-4702-bc5f-a9a4847e89b5
+1. My workaround so far is to set
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1.Another workaround: create a wrapper script that intercepts Claude Code's SSH connectivity probe and fakes a success response, passing all other SSH calls through to the real binary:
Then prepend it to
PATHwhen launching Claude:This avoids the
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1tradeoff of losing feature flags and gated commands. Claude sees a successful SSH check, 1Password/YubiKey never gets triggered, and all other SSH operations work normally.worked for me
This really needs to be fixed. ☹️ I'm getting these interruptions constantly.