Claude Code Termux banner
Ishabdullah Ishabdullah

Claude Code Termux

Development community

Description

Termux workaround for running Claude Code CLI on Android. The npm package no longer includes a global CLI, so this guide shows how to set it up and run claude globally using an alias.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Claude Code CLI for Termux

**Termux workaround for running Claude Code CLI on Android.**

The npm package `@anthropic-ai/claude-code` no longer includes a global CLI, so this guide shows how to set it up and run `claude` globally in Termux using an alias.


Features

  • Run Claude Code CLI from anywhere in Termux.
  • Avoids the npm deprecation warning.
  • Easy to update with npm.

Prerequisites

  • Termux installed on your Android device.
  • Basic familiarity with terminal commands.
  • Node.js and npm installed in Termux.

Installation Steps

  1. **Update Termux and install dependencies** \`\`\`bash pkg update -y pkg upgrade -y pkg install nodejs git -y \`\`\`

  2. **Install Claude Code npm library globally** \`\`\`bash npm install -g @anthropic-ai/claude-code \`\`\`

  3. **Find your global npm path** \`\`\`bash npm root -g \`\`\`

Typical path in Termux: \`\`\` /data/data/com.termux/files/usr/lib/node_modules \`\`\`

  1. Test running the CLI directly ```bash node /data/data/com.termux/files/usr/lib/node_modules/@anthropic-ai/claude-code/cli.js --version ```

You should see something like: \`\`\` 2.1.63 (Claude Code) \`\`\`

  1. Create a global alias

Open your shell configuration: \`\`\`bash nano ~/.bashrc # for bash

or

nano ~/.zshrc # for zsh \`\`\`

Add the following line at the bottom: \`\`\`bash alias claude='node /data/data/com.termux/files/usr/lib/node_modules/@anthropic-ai/claude-code/cli.js' \`\`\`

Save and exit.

  1. **Apply the changes** \`\`\`bash source ~/.bashrc \`\`\`

  2. **Test the alias** \`\`\`bash claude --version claude \`\`\`

You should now be able to run `claude` globally in Termux without seeing the deprecation warning.


Updating Claude Code

To update to the latest npm version: \`\`\`bash npm install -g @anthropic-ai/claude-code \`\`\`

Verify the version: \`\`\`bash claude --version \`\`\`


Notes

  • The official native installer for Claude Code does not work on Termux due to Android AB