Bash tool fails on Termux due to hardcoded /tmp path

Resolved 💬 2 comments Opened Mar 7, 2026 by dennispg Closed Mar 7, 2026

Bash tool fails on Termux due to hardcoded /tmp path

Description

Claude Code's Bash tool fails to execute any commands on Termux (Android) because it attempts to create directories under /tmp/, which is not writable in Termux's sandboxed environment.

Environment

  • Platform: Android (Termux)
  • Shell: zsh
  • Claude Code install method: npm (/data/data/com.termux/files/usr/bin/claude)

Steps to Reproduce

  1. Install Termux on Android
  2. Install Claude Code: npm install -g @anthropic-ai/claude-code
  3. Launch claude and attempt to run any shell command via the Bash tool

Expected Behavior

Bash commands should execute successfully, using Termux's writable temp directory (typically $PREFIX/tmp or $TMPDIR).

Actual Behavior

Every Bash tool invocation fails with:

EACCES: permission denied, mkdir '/tmp/claude-10407'

Claude Code attempts to use /tmp/ which does not exist or is not writable in Termux's sandboxed Android environment.

Root Cause

Termux does not have access to /tmp. The correct temporary directory in Termux is /data/data/com.termux/files/usr/tmp (available via $PREFIX/tmp or the $TMPDIR environment variable). Claude Code appears to hardcode /tmp rather than respecting $TMPDIR or detecting the platform's temp directory.

Suggested Fix

Use $TMPDIR, os.tmpdir(), or similar platform-aware methods to resolve the temporary directory instead of hardcoding /tmp.

View original on GitHub ↗

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