Git detection fails on Termux (Android) despite git being installed and functional
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:
- Checking
$PATH - Using
which git - Running
git --versiondirectly
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 --versionand check exit code - Use
which gitorcommand -v gitto 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
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗