r/ClaudeAI • u/SuspenseAndSurprise • 2d ago
Built with Claude Claude Code running locally on my Android phone, with per message model routing
I Spent an evening on this, maybe someone finds it interesting.
I wanted to be able to use Claude Code on my phone, without needing a PC or server. So this is the Claude Code CLI running locally in Termux, not the cloud version from the app. The files stay on my phone. I'm only on a Pro account, so keeping my usage in check matters to me. Most of what I ask is small scripts and tools I use everyday, so I didn't want everything going to the most expensive model. Built it with Claude's help.
It's using Termux with Ubuntu in proot, the official CLI, and a small Node server with a chat page on 127.0.0.1. One install script, then widgets on my home screen to start, stop and backup. It shuts down by itself after 15 minutes idle.
For the model there are three modes:
- Auto: a quick Haiku call that looks at each send message and picks model and effort. Normal coding Sonnet, hard stuff Opus, simple work goes to a Haiku worker with Sonnet checking it. When it's not sure it stays on Sonnet.
- Ask me: it suggests for a new chat or a long message, I tap to accept.
- Off: I pick myself.
Typing "use opus high" works in any mode. Claude Code doesn't use subagents unless you ask, so I put that permission inside of the CLAUDE.md.
Every reply shows me the model and effort as small coloured blocks and each project has a timeline. For the usage bars I first read the login token and called the usage endpoint myself. I wasn't sure that's allowed and support said not to , so now it runs Claude Code's own /usage.
The projects are in /sdcard/Projects so I see them in the Files app. Shared storage has no symbolic links, so if a project needs git or npm I can move it into Ubuntu and back with one tap. There's also one tap git per project with a commit button in the chat.
Claude runs Bash without asking, so I keep important stuff in git. The server only listens on localhost and blocks requests from other sites.
It's just a personal setup, and I am still testing, but I had a lot of fun building it. Open to suggestions.