Skip to content

fix: SSH signing/auth fallback fails in Claude Code remote sessions #12

@mkhnsn

Description

@mkhnsn

Problem

When connected to a Mac remotely via Claude Code (or similar tools), the SSH signing wrapper at ~/.config/git/ssh-sign and the SSH agent auth both fail because:

  1. Signing wrapper checks SSH_CONNECTION / SSH_CLIENT env vars to decide whether to use the 1Password agent or the fallback key. Claude Code doesn't set these vars even when the user is remote — so the wrapper tries 1Password, which can't do biometric approval remotely, and fails with communication with agent failed.

  2. SSH transport for git push also routes through the 1Password SSH agent. When it's unresponsive, there's no automatic fallback to the remote signing key for authentication — only signing has a fallback path.

  3. The fallback key (~/.ssh/id_ed25519_remote) is only registered with GitHub as a signing key, not an authentication key. So even when forced via GIT_SSH_COMMAND, GitHub rejects it.

What happened

During a Claude Code session, git commit and git push both failed. Had to work around it by:

  • Committing with -c user.signingkey=~/.ssh/id_ed25519_remote
  • Pushing via HTTPS (git push https://github.com/...) since SSH auth was dead

Fix needed

  1. Register id_ed25519_remote as both a signing AND authentication key on GitHub
  2. Update ssh-sign wrapper to detect Claude Code sessions (check for CLAUDE_CODE env var or absence of a TTY) as a fallback trigger
  3. Add SSH config fallback: IdentityFile ~/.ssh/id_ed25519_remote as a secondary identity for github.com so SSH transport works when 1Password is unavailable
  4. Or: configure git to fall back to HTTPS protocol when SSH agent is unresponsive

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions