Experiments · No. 02 ·

Claude runs on the phone, with root

Claude Code runs inside a small Linux system on the phone itself, with root. Asked to call someone, it looks the contact up and places the call with Android's own commands.

Working

What it does

In Experiment 01, Claude ran on a laptop and reached the phone over USB. This time the agent runs on the phone. A small Debian Linux system lives inside the phone, Claude Code is installed there, and you open it from a terminal app on the phone's own screen.

It also has root. Instead of a fixed set of tools, Claude runs Android's own commands, the ones a developer would type: content query to read contacts, am start to place a call, input tap to touch the screen.

What you are watching

The phone's screen, mirrored to a laptop with scrcpy for recording.

  1. The terminal app (Termux) opens. debian logs in to the phone's Debian, and claude starts Claude Code there. The header shows it's running in /home/rethink, on the phone.
  2. Can you call Gaurav. Claude searches the phone's contacts, finds the number, and places the call. The dialer comes up, then Claude reports that the call has started.

These are the two commands it ran, from the phone's own log:

16:18:10  content query --uri content://com.android.contacts/data/phones --projection display_name:data1
16:18:16  am start -a android.intent.action.CALL -d tel:+91XXXXXXXXXX
Model Claude Opus 5.5, in Claude Code v2.1.330, running on the phone
Permissions Auto mode was on, so Claude Code ran both commands without asking
Typing Typed on the laptop's keyboard through scrcpy, which forwards keystrokes to the phone. Claude, its tools and the call all ran on the phone
Takes One earlier run at 15:17, the first time it worked, which also placed and ended a call. Before that, calls failed: see below
Ending The call ended on its own after about 8 seconds. Claude did not hang up, and the take stops with "hang up" typed but not sent
Edits Cropped to the phone. The number is covered in the dialer and in Claude's replies, and the transcript is covered for 6 seconds while the command with the number scrolled by. Re-encoded at 30 fps. No cuts, no speed changes
Log android-commands.log, number redacted

How it works

The whole setup is three scripts in phone/linux/.

What went wrong first

Claude's first attempts to call failed with Failed transaction. The kernel's SELinux log showed why. Claude Code saves each command's output to a file. am passes that file to Android's system service, and SELinux won't let the service write into Debian's files. Our tests over SSH used pipes instead of files, so they passed. The fix: android now always passes output through a pipe.

Root versus the MCP server

Experiment 01 gave Claude 13 named tools through an MCP server. This one gives it root.

We're keeping both for now and will write up which one we keep, and why.

Try it

You need a phone where adb root works, such as a LineageOS build with rooted debugging enabled. The repository is private while we prepare it, and will be public soon.

./phone/linux/setup.sh     # once: Debian, SSH and Claude Code on the phone (~3 min)
./phone/linux/termux.sh    # once: the terminal app
./phone/linux/start.sh     # after each reboot

Then on the phone, open Termux and type debian, then claude.

Limits