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
- Claude Code hardcodes
/tmp/claude/...for internal task tracking - On Android,
/tmpis a system directory that apps cannot access - Termux uses
$TMPDIR(typically/data/data/com.termux/files/usr/tmp) instead of/tmp - Claude Code does not respect
$TMPDIRor$PREFIX/tmp
Reproduction Steps
- Install Claude Code on Termux (Android)
- Run any command that takes more than 2-3 seconds (e.g., SSH commands, API calls)
- Observe the EACCES error
Expected Behavior
Claude Code should use the platform-appropriate temp directory:
- Check
$TMPDIRfirst (set by Termux) - Fall back to
$PREFIX/tmpon Termux - Only use
/tmpas 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
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗