Skip to content
Back to skills

Termux Safe

ASecurity

Android/Termux constraints reference. Prevents Claude Code from suggesting commands that fail silently on Android (sudo, systemd, /tmp without proot, etc.).

  • 222 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added May 26, 2026
developmentgobashnodedocker

Works with

  • claude code

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add ferrumclaudepilgrim/claude-code-android --skill termux-safe --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Termux Safe?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Termux Safe
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ferrumclaudepilgrim-termux-safe/badge)](https://www.skillsdirectory.com/skills/ferrumclaudepilgrim-termux-safe)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: termux-safe
description: Android/Termux constraints reference. Prevents Claude Code from suggesting commands that fail silently on Android (sudo, systemd, /tmp without proot, etc.).
user-invocable: false
disable-model-invocation: false
# No allowed-tools field: this skill is content-only and grants no additional tool access.
---

# Android / Termux Environment Constraints

> **Scope:** These constraints apply to native Termux only. Inside a proot-distro guest (Path B), standard Linux rules apply: `apt` works normally, `/tmp` is writable, paths are standard.

You are running inside Termux on Android (aarch64). These constraints produce **silent failures, not errors.** Every suggestion must account for them.

## Hard Rules: Never Suggest These

- **No `sudo`.** Root does not exist. No `su`, no `doas`, no privilege escalation of any kind.
- **No `systemctl` or `systemd`.** Android does not use systemd. No `journalctl`, no `service`, no unit files.
- **No standard Linux paths.** `/usr/bin`, `/etc`, `/var` do not exist or are not writable. Termux paths:
  - Home: `/data/data/com.termux/files/home`
  - Prefix: `/data/data/com.termux/files/usr`
  - Binaries: `$PREFIX/bin`
  - Config: `$PREFIX/etc`
- **No ports below 1024.** No root = no binding to 80, 443, etc. Use 1024+.
- **Prefer `pkg` over `apt`.** Both work, but `pkg` auto-updates the package index before installing.
- **No Docker, no containers.** The kernel does not support them without root.

## Silent Failure Modes

- **`/tmp` is not writable from plain Termux.** Tools that hardcode `/tmp` for IPC may need a `proot -b $PREFIX/tmp:/tmp <cmd>` wrapper, or to honor a `TMPDIR` / tool-specific `_TMPDIR` environment variable. Claude Code 2.1.112 itself does not need the wrapper (empirically verified Android 8 / 10 / 13 / 17 Beta 2026-05-16).
- **`TMPDIR` must be set** before npm operations: `export TMPDIR=$PREFIX/tmp`
- **Node.js v24 had a startup hang** on ARM64 under native Termux (resolved in v25). Require v25+.
- **File descriptor limits vary by device.** Check with `ulimit -n`. Avoid spawning many concurrent processes.
- **Android phantom process killer** limits background processes to ~32 across all apps. If "Disable child process restrictions" is enabled in Developer Options, this limit is lifted and up to 6 concurrent subagents are safe. Otherwise limit to 2-3.
- **proot crash = /tmp mount gone.** Never store persistent state in `/tmp`.
- **`process.platform` returns `"android"`**, not `"linux"`. Some tools check for `linux` specifically and fail.

## Package Installation

Prefer `pkg` (auto-updates the index before install). `apt` and `apt-get` also work but skip the auto-update:
```bash
pkg install <package> -y
pkg upgrade
pkg search <query>
```

## When Unsure

If you're about to suggest a command that assumes standard Linux, stop and verify it works on Termux first. When in doubt, prefix with `command -v <tool> >/dev/null 2>&1` to check availability.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.