[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_This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗