[BUG] Desktop (macOS): app git sets GIT_CONFIG_NOSYSTEM when /etc/gitconfig is missing, dropping Apple's osxkeychain helper; Continue in Cloud push fails

Status Open
Reported on v2.1.284
Maintainer reply None cached
Activity 0 comments · opened Oct 1, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

On macOS, the Desktop app's own git (Continue in > Claude Code on the Web, and the background refreshSourceRef fetch of origin/main) cannot authenticate to GitHub over HTTPS, while the same repo pushes and fetches fine from any shell on the same Mac.

Cause, traced in the app code (Desktop 2.16120.0, .vite/build/index.chunk-DiHnStOT.js, the "Desktop global config" builder used for the gated git spawns):

  1. The app runs git config --system --list --show-origin -z to collect the system config.
  2. On a Mac with no /etc/gitconfig, that command exits 128 (fatal: unable to read config file '/etc/gitconfig'). This is the normal state of a Mac where git comes from Xcode or the Command Line Tools.
  3. The app treats the failure as "system config unreadable", sets noSystem, and spawns git with GIT_CONFIG_NOSYSTEM=1, GIT_TERMINAL_PROMPT=0 and GIT_CONFIG_GLOBAL=<git-shadow>/<hash>-gitconfig (whose only content is [include] path = ~/.gitconfig).
  4. Apple Git ships its credential helper in <Xcode or CLT>/usr/share/git-core/gitconfig (credential.helper = osxkeychain). Git reports that file with scope "unknown", but GIT_CONFIG_NOSYSTEM=1 suppresses it. Many Mac users have no helper anywhere else, so the app's git ends up with no credential helper and no way to prompt.

Two problems in that logic:

  • A missing /etc/gitconfig is not "unreadable"; git config --system --list also fails when the file simply does not exist.
  • Apple's toolchain gitconfig is not listed by --system --list at all, so it can never be carried into the synthetic global config, yet GIT_CONFIG_NOSYSTEM=1 still drops it.

What Should Happen?

The app's git should see the same credential helper the user's shell git sees. For example: treat a missing /etc/gitconfig as an empty system config (do not set GIT_CONFIG_NOSYSTEM), and/or carry Apple's usr/share/git-core/gitconfig (or at least its credential.helper) into the synthetic global config.

Error Messages/Logs

[error] Git command failed: git fetch --porcelain --verbose --no-write-fetch-head --no-prune --no-tags --no-prune-tags --refmap= origin +refs/heads/main:refs/remotes/origin/main { code: 128, stderr: "fatal: could not read Username for 'https://github.com': terminal prompts disabled\n" }
[info] [refreshSourceRef] single-ref fetch of origin/main failed (continuing with on-disk ref): fatal: could not read Username for 'https://github.com': terminal prompts disabled
[error] [TeleportToCloud] Transport push failed (auth)

Steps to Reproduce

On a Mac with Apple Git (Xcode or CLT), no /etc/gitconfig, no credential.helper in ~/.gitconfig, a GitHub login stored in the keychain, and a private repo with an HTTPS remote:

  1. git config --show-origin --get-all credential.helper shows osxkeychain only from .../usr/share/git-core/gitconfig.
  2. git config --system --list exits 128.
  3. GIT_TERMINAL_PROMPT=0 git ls-remote origin succeeds.
  4. GIT_CONFIG_NOSYSTEM=1 GIT_TERMINAL_PROMPT=0 git ls-remote origin fails with "could not read Username for 'https://github.com': terminal prompts disabled", which is exactly what the app hits.
  5. In the Desktop app, open a local session on that repo and use Continue in > Claude Code on the Web: "Transport push failed (auth)".

Workaround: git config --global credential.helper osxkeychain (the synthetic config includes ~/.gitconfig). After that, the app's exact env and config authenticate.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude Desktop 2.16120.0 (bundled Claude Code 2.1.284)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

The Desktop app's git is spawned through Claude.app/Contents/Helpers/disclaimer; that helper is not involved (it keeps HOME and PATH, and the keychain is reachable through it). Apple Git 2.54.0 (Apple Git-157), macOS 26.6.2.

View original on GitHub ↗