process.platform === 'android' breaks platform detection in native Termux

Resolved 💬 4 comments Opened Mar 23, 2026 by ferrumclaudepilgrim Closed Apr 20, 2026

Environment

  • Platform: Android 16 (Samsung Galaxy S26 Ultra)
  • Terminal: Termux (native, not proot-distro guest)
  • Claude Code version: 2.1.81
  • Node.js: v25.8.1
  • process.platform: "android"

Description

When Claude Code runs in native Termux on Android, process.platform returns "android" instead of "linux". Any code that checks process.platform === "linux" fails silently.

Known affected functionality:

  • PDF reading: Claude Code uses which pdftoppm to detect poppler. The which binary doesn't ship with Termux, but the detection may also be gated behind a platform check. The workaround (creating a which shim at $PREFIX/bin/which) resolves the immediate issue, but the root cause is that platform detection doesn't account for Android.

Reproduction

// In native Termux:
console.log(process.platform); // "android"

// In proot-distro Ubuntu guest:
console.log(process.platform); // "linux"

Expected Behavior

Platform checks should treat "android" as a Linux-compatible platform, or Claude Code should explicitly handle "android" as a supported platform alongside "linux" and "darwin".

Suggested Fix

Wherever platform detection gates functionality:

// Instead of:
if (process.platform === "linux") { ... }

// Use:
if (process.platform === "linux" || process.platform === "android") { ... }

Impact

This affects any Claude Code user running in native Termux (the simpler, lighter installation path). Users running inside proot-distro Ubuntu are unaffected since process.platform returns "linux" in the guest.

Notes

Filed from a working Claude Code installation on Android that has verified: MCP servers (both transports), PDF reading (with shim), 6 concurrent subagents, cron headless sessions, hooks, skills, and plugins all working. The platform detection is the primary remaining compatibility gap.

Related: #16615 (closed, not planned) covered a similar platform detection issue for hooks.

View original on GitHub ↗

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