穆再排尔·穆合塔尔
← Field notes

Systems / 11 Jun 2026

An Agent in Your Pocket

Designing an Android agent around latency, permissions, and a very small screen.

2 min read Published 11 Jun 2026 Nanjing, China

Most coding agents assume a desk. They assume a terminal, a keyboard, a stable connection, and a user who can wait. Nuclear Boy assumes a pocket, a touchscreen, a connection that comes and goes, and a user who is walking.

That constraint is the design. The phone is not a smaller laptop; it is a different instrument. It has a camera, a microphone, a battery, and a permission model. It also has a screen that cannot hold a diff and a keyboard that cannot hold a function signature. Everything in the product follows from those facts.

The shape of the thing

The app is Kotlin and Jetpack Compose, with Hilt for dependencies and Room for local state. The agent talks to DeepSeek over SSE, so tokens arrive as they are produced rather than after the whole answer is finished. The interface is built around a single stream: what the agent is doing, what it is about to do, and what it needs from you.

The agent loop is deliberately small. A turn has three parts: observe the current state, choose a tool, and record the result. Tools are registered in a registry rather than hard-coded into the loop, so adding a capability does not mean rewriting the scheduler. Skills are longer procedures layered on top of tools. The model can call a skill the same way it calls a tool; the difference is that a skill can contain a sequence of steps and its own instructions.

The sandbox

The Python sandbox was the hardest part. A phone is not a server: there is no privileged container, no reliable process isolation, and no expectation that a long-running job will survive. The sandbox is therefore narrow on purpose. It runs short programs, returns text, and treats the filesystem as a small, explicit workspace. It is useful for the things a phone is bad at — parsing, plotting, a quick numerical check — and it refuses the things a phone should not do.

The hardware controls are the opposite bet. Vibration, Wi-Fi, Bluetooth, brightness, clipboard, notifications: twenty-odd capabilities that a laptop agent does not have. They make the agent feel native. They also make permission design the product's real interface. A tool that can turn off Wi-Fi is not a feature; it is a trust decision.

What I would change

The first version optimized for capability. The second version would optimize for interruption. A pocket agent is used in fragments: thirty seconds in a queue, two minutes on a train. It should be able to stop, summarize what it knows, and resume without losing the thread. That is a state-machine problem, not a prompt problem.

The other change is evaluation. I tested tools individually. I did not test the composition of tools under the latency and permission constraints of a real phone. The next version needs traces from actual use, not a demo script.

The project is open source because the interesting questions are not proprietary. What does an agent look like when it lives where you live? The answer is smaller, stranger, and more physical than the desktop version.