Background agents fail on Termux - hardcoded /tmp path

Resolved 💬 12 comments Opened Dec 29, 2025 by hah23255 Closed Mar 2, 2026

Bug Description

Claude Code uses hardcoded /tmp/claude for background task directories. On Termux/Android, /tmp is not accessible (permission denied).

Error

EACCES: permission denied, mkdir '/tmp/claude/-data-data-com-termux-files-home/tasks'

Expected Behavior

Should use os.tmpdir() (returns /data/data/com.termux/files/usr/tmp on Termux) or respect TMPDIR environment variable.

Environment

  • Platform: Android/Termux (linux arm64)
  • Claude Code version: 2.0.76
  • Node.js os.tmpdir() returns: /data/data/com.termux/files/usr/tmp

Reproduction

  1. Install Claude Code on Termux
  2. Try to spawn background agents using Task tool with run_in_background: true
  3. Error occurs

Workaround

Using proot wrapper to bind mount tmp:

proot -b /data/data/com.termux/files/usr/tmp:/tmp claude

View original on GitHub ↗

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