Experiments · No. 02 · Source on GitHub

Reproduce Experiment 02: Claude runs on the phone, with root

Warning

Highly experimental. Proceed with caution. Reproducing this means flashing a new operating system and running code as root. One wrong step can brick your phone or erase everything on it. Use a spare phone you can afford to lose.

Claude Code runs on the phone itself, in a small Debian, with root. You open it in a terminal app on the phone and ask it to call a contact. Write-up and video: Experiment 02.

You need

Steps

  1. Install the terminal app, with the phone on USB:

    ./phone/linux/termux.sh
    

    It installs Termux v0.118.3 (checksum-verified), gives it its own SSH key, and adds a debian command. Termux is an ordinary app without root; it reaches the phone's Debian over SSH on 127.0.0.1. You can unplug USB afterwards.

    Rather work from your computer? Skip this and SSH in instead: ssh -i ~/.ssh/rethink_phone -p 2222 rethink@<phone's Wi-Fi address>.

  2. Open Termux on the phone and type:

    debian
    claude
    

    Claude Code starts in /home/rethink, on the phone. A CLAUDE.md there tells it it's on the phone and lists the Android commands it can use.

  3. Ask it to call someone in your contacts:

    Can you call <contact name>
    

    It looks the contact up with content query and dials with am start -a android.intent.action.CALL. The dialer comes up. Claude Code asks before each command; approve them, or press Shift+Tab for auto mode, as in the video.

  4. Hang up by asking hang up, or on the phone.

  5. Read the log of every root command Claude ran, in Debian:

    cat /var/log/android-commands.log
    

Typing on the phone

The video was typed on a laptop keyboard through scrcpy, which mirrors the phone's screen and forwards keystrokes (brew install scrcpy, then scrcpy). The phone's own keyboard works too.

If something's off

Code

phone/linux/: setup.sh and provision.sh (Debian, SSH, Claude Code, the android helper, CLAUDE.md), boot.sh (mounts and services on the phone), termux.sh.