EACCES permission denied on /tmp/claude/* on Android/Termux

Resolved 💬 9 comments Opened Jan 10, 2026 by Arielgb2 Closed Mar 2, 2026

Description

Claude Code fails with EACCES: permission denied, mkdir '/tmp/claude/...' errors on Android/Termux when running commands that take more than a few seconds. The commands execute successfully, but Claude Code's internal task tracking fails because it tries to create directories in /tmp/claude/ which is inaccessible on Android.

Environment

  • Claude Code version: 2.1.3
  • Node version: v25.2.1
  • Platform: Android 14 (Termux)
  • Shell: bash

Error Message

EACCES: permission denied, mkdir '/tmp/claude/-storage-emulated-0-ai-projects-nas-admin/tasks'

Root Cause

  1. Claude Code hardcodes /tmp/claude/... for internal task tracking
  2. On Android, /tmp is a system directory that apps cannot access
  3. Termux uses $TMPDIR (typically /data/data/com.termux/files/usr/tmp) instead of /tmp
  4. Claude Code does not respect $TMPDIR or $PREFIX/tmp

Reproduction Steps

  1. Install Claude Code on Termux (Android)
  2. Run any command that takes more than 2-3 seconds (e.g., SSH commands, API calls)
  3. Observe the EACCES error

Expected Behavior

Claude Code should use the platform-appropriate temp directory:

  • Check $TMPDIR first (set by Termux)
  • Fall back to $PREFIX/tmp on Termux
  • Only use /tmp as last resort on systems where it's accessible

Current Workaround

Run commands in the background and check results separately:

long_command > output.txt &
sleep 2
cat output.txt

Notes

  • The actual commands execute successfully - only the task tracking fails
  • This issue has been occurring since at least December 2025
  • Affects all Claude Code sessions on Termux

View original on GitHub ↗

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