Git detection fails on Termux (Android) despite git being installed and functional

Resolved 💬 3 comments Opened Mar 6, 2026 by MuscleGear5 Closed Mar 9, 2026

Description

Claude Code's marketplace/extension system reports that git needs to be installed, even when git is fully functional. This occurs on Termux (Android terminal emulator) due to non-standard binary paths.

Environment

  • Platform: Termux on Android (Linux 4.19.127)
  • Git version: 2.53.0 (installed via pkg install git)
  • Git path: /data/data/com.termux/files/usr/bin/git
  • Claude Code version: Latest

Evidence

Git is installed and works correctly:

$ which git
/data/data/com.termux/files/usr/bin/git

$ git --version
git version 2.53.0

$ git status
# Works as expected

Root Cause

Termux installs packages under its own prefix (/data/data/com.termux/files/usr/) rather than standard Linux paths (/usr/). Android's root filesystem is read-only, so this is by design.

Claude Code's git detection appears to check hardcoded paths like /usr/bin/git instead of:

  1. Checking $PATH
  2. Using which git
  3. Running git --version directly

Expected Behavior

Claude Code should detect git correctly when it's accessible via $PATH and git --version succeeds.

Suggested Fix

Update the git detection logic to use path-agnostic methods:

  • Execute git --version and check exit code
  • Use which git or command -v git to locate the binary
  • Avoid hardcoded paths like /usr/bin/git

Workaround

Users can ignore the warning - git functionality works fine. The issue is purely cosmetic (false negative in detection).

Related

This affects all non-standard Linux environments including:

  • Termux (Android)
  • NixOS (uses non-FHS paths)
  • Guix System
  • Some container environments

---

🤖 Generated with Claude Code

View original on GitHub ↗

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