[BUG] Remote Git commands are run on first prompt in Claude Code

Resolved 💬 3 comments Opened Mar 9, 2026 by agarzola Closed Mar 9, 2026

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 use 1Password to manage SSH keys. A side-effect of doing so is that 1P asks me to authorize use of an SSH key whenever it is requested by a program, for instance when a Git command fetches from or pushes to a remote repo, e.g. GitHub. This happens if 1Password is locked. Once authorized for use, there is a grace period during which 1Password is unlocked and will not request for authorization again.

I have noticed that when first starting claude and asking it to do anything for the first time in a session, if 1Password is unlocked I will be prompted to authorize use of my GitHub SSH key.[^1] This happens regardless of what prompt I give it; see screencast under _Additional Information_ below for evidence. To my knowledge, this shouldn’t happen unless a remote Git command is being run (fetch, pull, push) that requires an SSH key. I don’t _always_ see this behavior because 1Password is not always locked, but if I make sure it is locked before I do anything with Claude Code, I am able to reproduce the issue 100% of the time.

This is unexpected and certainly unwanted behavior.

[^1]: For what it’s worth, I have a recollection of observing this behavior when exiting the program (again, if 1Password is locked), but I can’t seem to reproduce that as of this writing. I share it here in case it is useful.

What Should Happen?

I do not expect remote Git commands to be run by Claude Code unless explicitly prompted to do so. This seemingly default behavior is dangerous because fetching without the user’s knowledge can easily lead to inadvertently overwriting commits in the remote if the user runs git push --force-with-lease after a rebase.

Error Messages/Logs

Steps to Reproduce

  1. Set up an SSH key in GitHub (or similar service) with 1Password.
  2. Configure your local Git to use 1Password for the SSH key.
  3. Ensure 1Password is locked.
  4. In the command line, navigate to a repository in your terminal that has a remote set up for the service that uses that SSH key from 1Password.
  5. Run claude.
  6. Observe that 1Password prompts you for authorization to use your SSH key.
  7. Do not authorize it.
  8. Exit Claude Code.
  9. Observe that you are once again prompted for authorization to use the SSH key.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.71

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

https://github.com/user-attachments/assets/e3a38301-1eb5-4c37-aa10-bfce9669147d

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗