Skip to content

friuns2/claw-code-android

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

566 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฆ€ Claw Code Mobile

๐Ÿš€ Claude Code on Your Phone โ€” Full Linux, No Server, No PC ๐Ÿš€

Android Claw Code Kotlin Python Rust Status License


They said you can't run Claude Code on a phone. They said you need a Mac, a server, SSH, a terminal. We put an entire Linux distro inside an APK and proved them wrong.


 โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•—      โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—    โ–ˆโ–ˆโ•—     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•”โ•โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•
โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ•— โ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘    โ–ˆโ–ˆโ•‘     โ–ˆโ–ˆโ•‘   โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•
โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘  โ–ˆโ–ˆโ•‘โ•šโ–ˆโ–ˆโ–ˆโ•”โ–ˆโ–ˆโ–ˆโ•”โ•    โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
 โ•šโ•โ•โ•โ•โ•โ•โ•šโ•โ•โ•โ•โ•โ•โ•โ•šโ•โ•  โ•šโ•โ• โ•šโ•โ•โ•โ•šโ•โ•โ•     โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•
              M O B I L E  ยท  O N  ยท  Y O U R  ยท  P H O N E

Download APK ยท Claw Code Website ยท Google Play ยท Project Spec


๐Ÿคฏ What Is This?

People run Claude Code on MacBooks. On cloud servers. On expensive Linux workstations with 64GB RAM.

We run it on a phone.

This project takes the Claw Code agent framework โ€” the open-source clean-room rewrite of Claude Code's architecture with 48K+ stars โ€” and packages it into a single Android APK with a complete embedded Linux environment. No root. No Termux. No server. No SSH tunnels. No second device.

You pull your phone out of your pocket, open the app, and start coding with an AI agent. That's it. That's the product.

๐Ÿง  TL;DR โ€” Full Claw Code + AI coding agent running natively on Android in an embedded Linux environment extracted from the APK. One app. Zero dependencies. Your pocket is now a dev workstation.


๐Ÿ“ฑ Screenshots


๐Ÿ’ฌ AI Coding Agent
Full conversational coding with streaming responses, reasoning visibility, and danger-full-access mode.

๐Ÿงฉ Dashboard & Sessions
Multi-thread sessions, agent routing, skills, Canvas โ€” all running locally on your phone.

Yes, that's a full AI coding agent. Yes, it's running on a phone. Yes, it writes and executes code.


๐ŸŒ What Can You Do With This?

Feature Description
๐Ÿฆ€ Claw Code Agent Full Claude Code architecture agent โ€” reads codebase, writes code, runs commands autonomously
๐Ÿง Embedded Linux Complete Linux userland extracted from APK โ€” sh, apt, Node.js, Python, SSL certs
โšก Rust Core Native Rust binary (aarch64-musl) โ€” 73MB of raw performance running on ARM64
๐Ÿ’ฌ Conversational Coding Streaming responses with reasoning visibility and multi-thread sessions
๐Ÿ”“ Full Auto-Approval No permission popups โ€” danger-full-access sandbox mode by default
๐Ÿ”‹ Background Execution Foreground service keeps everything alive when you switch apps
๐Ÿ”‘ OAuth Login One-time browser-based auth โ€” shared across all agent sessions
๐Ÿ“ด Offline Bootstrap Linux environment extracted from APK โ€” works without internet after setup
๐Ÿ› ๏ธ 19 Built-in Tools File I/O, shell execution, Git operations, web scraping, notebook editing
๐Ÿง  Query Engine LLM API calls, response streaming, caching, multi-step orchestration
๐Ÿ”Œ MCP Support Model Context Protocol with 6 transport types โ€” connect external tool servers
๐Ÿ—๏ธ Multi-Agent Spawn sub-agents to parallelize complex tasks in isolated contexts

โšก Quick Start

# ๐Ÿ”“ Just download and install
adb install -r claw-code-mobile.apk
adb shell am start -n com.codex.mobile/.MainActivity
# โœˆ๏ธ and you're flying

Or download the APK directly. Open it. Login. Code.

๐Ÿ”ง Build from Source

git clone https://github.com/friuns2/claw-code-android.git
cd claw-code-android

npm install && npm run build

cd android && bash scripts/download-bootstrap.sh
bash scripts/build-server-bundle.sh && ./gradlew assembleDebug

adb install -r app/build/outputs/apk/debug/app-debug.apk

๐Ÿ“ Project Structure

๐Ÿฆ€ claw-code-android/
โ”œโ”€โ”€ ๐Ÿ“ฑ android/
โ”‚   โ”œโ”€โ”€ app/src/main/
โ”‚   โ”‚   โ”œโ”€โ”€ AndroidManifest.xml
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ฆ assets/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ proxy.js                 # ๐Ÿ”Œ CONNECT proxy (DNS/TLS bridge)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ bionic-compat.js         # ๐Ÿค– Android platform shim
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ server-bundle/           # ๐ŸŒ Pre-built Vue + Express + deps
โ”‚   โ”‚   โ””โ”€โ”€ java/com/codex/mobile/
โ”‚   โ”‚       โ”œโ”€โ”€ BootstrapInstaller.kt    # ๐Ÿง Linux environment setup
โ”‚   โ”‚       โ”œโ”€โ”€ CodexForegroundService.kt # ๐Ÿ”‹ Background persistence
โ”‚   โ”‚       โ”œโ”€โ”€ CodexServerManager.kt    # ๐Ÿ”ง Install, auth, proxy, server
โ”‚   โ”‚       โ””โ”€โ”€ MainActivity.kt         # ๐Ÿ“ฑ WebView + setup orchestration
โ”‚   โ””โ”€โ”€ ๐Ÿ› ๏ธ scripts/
โ”‚       โ”œโ”€โ”€ download-bootstrap.sh        # ๐Ÿ“ฅ Fetch Termux bootstrap
โ”‚       โ””โ”€โ”€ build-server-bundle.sh       # ๐Ÿ“ฆ Bundle frontend into APK assets
โ”œโ”€โ”€ ๐Ÿฆ€ rust/                             # Rust performance core (6 crates)
โ”œโ”€โ”€ ๐Ÿ src/                              # Python agent workspace
โ”‚   โ”œโ”€โ”€ commands.py                      # โŒ˜ 15 slash commands
โ”‚   โ”œโ”€โ”€ tools.py                         # ๐Ÿ”ง 19 built-in tools
โ”‚   โ”œโ”€โ”€ query_engine.py                  # ๐Ÿง  Core query engine
โ”‚   โ”œโ”€โ”€ models.py                        # ๐Ÿ”ฎ LLM provider abstraction
โ”‚   โ””โ”€โ”€ main.py                          # ๐Ÿš€ Entry point
โ”œโ”€โ”€ ๐ŸŒ docs/                             # GitHub Pages website
โ””โ”€โ”€ ๐Ÿ“– README.md                         # You are here

๐Ÿ—๏ธ Architecture

Four layers. One APK. Your phone is a Linux workstation now.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      Android APK                          โ”‚
โ”‚                                                           โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚  WebView   โ”‚  โ”‚  APK Assets                          โ”‚ โ”‚
โ”‚  โ”‚  (Vue.js)  โ”‚  โ”‚  bootstrap-aarch64.zip               โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚  server-bundle/ (Vue + Express)      โ”‚ โ”‚
โ”‚        โ”‚         โ”‚  proxy.js / bionic-compat.js          โ”‚ โ”‚
โ”‚        โ”‚         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚             CodexServerManager                        โ”‚ โ”‚
โ”‚  โ”‚  Bootstrap โ†’ Node.js โ†’ Claw Code Agent โ†’ Auth         โ”‚ โ”‚
โ”‚  โ”‚  Proxy โ†’ Query Engine โ†’ Tool System โ†’ Web Server      โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚        โ”‚                                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚  โ”‚             Embedded Linux ($PREFIX)                   โ”‚ โ”‚
โ”‚  โ”‚                                                       โ”‚ โ”‚
โ”‚  โ”‚  claw-code agent โ†’ :18923 (HTTP, WebView target)      โ”‚ โ”‚
โ”‚  โ”‚    โ””โ”€ Rust core  (native aarch64-musl, JSON-RPC)      โ”‚ โ”‚
โ”‚  โ”‚                                                       โ”‚ โ”‚
โ”‚  โ”‚  gateway         โ†’ :18789 (WebSocket)                 โ”‚ โ”‚
โ”‚  โ”‚  control UI      โ†’ :19001 (static file server)        โ”‚ โ”‚
โ”‚  โ”‚                                                       โ”‚ โ”‚
โ”‚  โ”‚  proxy.js        โ†’ :18924 (CONNECT proxy, DNS/TLS)    โ”‚ โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”Œ Services

Port Service Purpose
๐Ÿ”— 18789 Gateway WebSocket control plane for agents, sessions, tools
๐ŸŒ 18923 Web Server HTTP server with Vue.js UI (WebView target)
๐Ÿ”Œ 18924 CONNECT Proxy DNS/TLS bridge for musl-linked Rust binary
๐Ÿ“Š 19001 Control UI Static file server for agent dashboard

๐Ÿ”ฅ How It Works

They shipped an entire operating system inside an Android app. Absolute madlads.

๐Ÿง Embedded Linux

The APK bundles Termux's bootstrap-aarch64.zip โ€” a minimal Linux userland with sh, apt-get, dpkg-deb, SSL certificates, and core libraries. On first launch, it's extracted to the app's private storage. No root required.

๐Ÿฆ€ Native Rust Binary

The Claw Code framework ships a 73MB native Rust binary compiled for aarch64-unknown-linux-musl. npm refuses to install it on Android, so we download the tarball directly from the npm registry and extract it manually. Because we don't take "no" for an answer.

๐Ÿ”Œ DNS/TLS Proxy

The musl-linked binary reads /etc/resolv.conf for DNS โ€” which doesn't exist on Android. A Node.js CONNECT proxy on port 18924 bridges this gap: Node.js uses Android's Bionic DNS resolver, and the native binary routes all HTTPS through HTTPS_PROXY.

๐Ÿค– Android Compatibility Layer

The bionic-compat.js shim patches process.platform to return "linux", fixes os.cpus() and os.networkInterfaces() for Android's non-standard formats. Android thinks it's running Linux. We don't correct it.

๐Ÿ”“ W^X Bypass

Android 10+ enforces SELinux W^X (Write XOR Execute) policies. We use targetSdk = 28 to bypass this โ€” same approach as Termux (F-Droid). Security researchers love this one.


๐Ÿš€ Startup Sequence

  1. ๐Ÿ”‹ Battery optimization exemption + foreground service
  2. ๐Ÿง Bootstrap extraction (Termux userland)
  3. ๐Ÿ“ฆ Node.js + Python installation
  4. ๐Ÿ”ง Build tools (clang, cmake, make, lld)
  5. ๐Ÿฆ€ Claw Code agent + native Rust binary installation
  6. โš™๏ธ Full-access config (approval_policy = "never")
  7. ๐Ÿ”Œ CONNECT proxy startup
  8. ๐Ÿ”‘ OAuth login via browser
  9. ๐Ÿ—๏ธ Gateway + Control UI + Web Server
  10. ๐Ÿ“ฑ WebView loads http://127.0.0.1:18923/

๐ŸŽฏ Requirements

  • ๐Ÿ“ฑ Android 7.0+ (API 24) โ€” ARM64 device
  • ๐ŸŒ Internet connection โ€” for first-run setup + API calls
  • ๐Ÿ”‘ API key โ€” for your chosen LLM provider
  • ๐Ÿ’พ ~500MB storage โ€” for Linux environment + Node.js + Rust core + agent framework

๐Ÿงฌ Tech Stack

Layer Technology Version
๐Ÿฆ€ Agent Framework Claw Code (Python + Rust) latest
๐Ÿง  Rust Core 6-crate workspace, 16 runtime modules โ€”
๐Ÿ”ง Tool System 19 built-in, permission-gated tools โ€”
โŒ˜ Commands 15 slash commands โ€”
๐Ÿ”ฎ LLM Support Provider-agnostic (Claude, OpenAI, local) โ€”
๐ŸŒ Runtime Node.js (Termux) 24.x
๐Ÿ–ฅ๏ธ Frontend Vue.js 3 + Vite + TailwindCSS 3.x
๐Ÿ“ฑ Android Kotlin + WebView 2.1.0
๐Ÿง Linux Termux bootstrap (aarch64) โ€”

๐Ÿ†š Claw Code Mobile vs. Desktop

Aspect Desktop (Mac/Linux/Server) Mobile (This App)
๐Ÿ–ฅ๏ธ Platform macOS, Linux, WSL Android 7.0+ (ARM64)
๐Ÿ“ฆ Installation pip install + terminal Download APK โ†’ open โ†’ done
๐Ÿ”ง Dependencies Python, Rust, terminal emulator Nothing. Zero. Nada.
๐Ÿง Linux Native OS Embedded in APK
๐Ÿฆ€ Rust Binary Native install Extracted from npm registry
๐ŸŒ DNS System resolver CONNECT proxy bridge
๐Ÿ”‹ Background Terminal stays open Foreground service
๐Ÿ’ฐ Server Costs $0-โˆž depending on cloud $0. It's your phone.
๐Ÿ“ Portability Carry your laptop Carry your pocket

๐Ÿ› Troubleshooting

Problem Solution
๐Ÿ’ฅ App crashes on launch Check adb logcat for errors
๐Ÿ”’ "Permission denied" executing binaries Ensure targetSdk = 28 in build.gradle.kts
๐Ÿฆ€ Rust binary fails to start Verify aarch64 architecture, check CONNECT proxy
๐ŸŒ "No address associated with hostname" Check internet; CONNECT proxy may not be running
๐Ÿ”‘ Login page doesn't open Ensure a default browser is set on the device
๐Ÿ”‹ App killed in background Grant battery optimization exemption in Android settings
๐Ÿงฐ Build tools fail Verify clang/cmake/make are installed and binary-patched

๐Ÿค Contributing

Found a bug? Want a feature? Have a wild idea about running more things on phones that shouldn't run on phones?

Open an issue ยท Submit a PR


โญ Star This Repo

If you believe AI coding agents should run everywhere โ€” not just on expensive machines behind SSH tunnels โ€” smash that star button. โญ

If you ever wished you could code on the bus, in a coffee shop, or while waiting at the dentist with a full AI agent that reads your codebase and writes code autonomously โ€” this is for you.

Stars Forks


๐Ÿ“œ Credits

  • ๐Ÿฆ€ Claw Code โ€” Open-source AI coding agent framework (48K+ โญ)
  • ๐ŸŒ Claw Code Website โ€” Architecture docs & comparison
  • ๐Ÿ“ฑ AidanPark/openclaw-android โ€” Android patches and bionic-compat.js
  • ๐Ÿง Termux โ€” Linux environment bootstrap for Android

Built by shoving an entire Linux distro + AI agent framework into an APK ๐Ÿ”ฌ Your pocket called. It wants to write some code. ๐Ÿ˜

Download APK ยท Claw Code ยท Google Play

About

๐Ÿฆ€ Claude Code on your phone โ€” Full Linux environment, Rust core, 19 tools, zero dependencies. No server. No PC. Just your pocket.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Rust 80.1%
  • Vue 6.9%
  • TypeScript 5.6%
  • Python 3.5%
  • Kotlin 3.4%
  • JavaScript 0.3%
  • Other 0.2%