Task agent fails on Termux: EACCES permission denied for /tmp/claude
Resolved 💬 9 comments Opened Jan 8, 2026 by bitwizlabs Closed Mar 2, 2026
Description
Task agents fail on Termux (Android) because Claude Code tries to create directories under /tmp/claude/, which doesn't exist on Termux and cannot be created without root.
Error
EACCES: permission denied, mkdir '/tmp/claude/-data-data-com-termux-files-home-donna/tasks'
Environment
- Platform: Android (Termux)
- Claude Code version: Latest from npm
Expected Behavior
Claude Code should respect $TMPDIR environment variable or use a fallback temp directory that works on Termux.
Termux Context
Termux uses /data/data/com.termux/files/usr/tmp as its temp directory. The standard /tmp doesn't exist and requires root to create.
Suggested Fix
Use $TMPDIR if set, falling back to /tmp only if $TMPDIR is not defined.
const tmpBase = process.env.TMPDIR || '/tmp';
Workaround Attempted
Setting TMPDIR in .bashrc does not resolve the issue, suggesting the path is hardcoded.
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗