Skip to content

How to Run AI Coding Agents on Your Phone

· 12 min read

You can run Claude Code, Codex CLI, OpenCode, and Gemini CLI on your phone right now. Install Cosyra for iOS or Cosyra for Android, add your API keys, and you get a full Ubuntu container with all four agents pre-installed. No SSH setup, no always-on laptop, no browser tabs that time out. We built this because we kept wanting to check on agent work from the couch or approve a Claude Code permission request while walking the dog, and the existing options were either fragile SSH chains or monitor-only dashboards.

This guide covers why phone-based AI coding works, how each agent runs on mobile, three approaches you can take, and step-by-step setup on Cosyra. Free trial, 10 hours, no credit card.

Why AI coding agents change the phone equation

The standard objection to coding on a phone is the keyboard. Fair point, if you're the one typing every semicolon. But AI coding agents flipped the ratio. With Claude Code or Codex CLI, you describe what you want in plain language and the agent writes the code, runs the tests, and proposes a diff. Your job is to direct, review, and approve. That interaction model, short prompts in, long outputs out, works on a phone because you're reading more than you're typing.

We think the phone keyboard is fine for agent-driven coding. Most developers who disagree haven't tried it with a properly set up agent that handles the boilerplate. When you're on the train reviewing a PR, or between meetings approving a Codex refactor, the phone is not a compromise. It's the fastest path between "I have five minutes" and "that shipped."

The practical scenarios where this matters:

The four agents: what each one does

Cosyra pre-installs four AI coding agents. All of them use BYOK (bring your own key), you connect your own Anthropic, OpenAI, or Google API key and pay the provider directly at their standard rates. Cosyra itself charges for compute, not AI tokens.

Agent Provider Best for API key needed Docs
Claude Code Anthropic Deep codebase understanding, multi-file refactors, PR review Anthropic API key Official docs
Codex CLI OpenAI Quick edits, code generation, sandboxed execution OpenAI API key GitHub repo
OpenCode Any (75+ providers) Open-source flexibility, works with any LLM provider Varies by provider GitHub repo
Gemini CLI Google 1M token context, large codebase navigation, Google ecosystem Google AI API key GitHub repo

You don't have to pick one. All four are installed in the same container. Start a task with Claude Code, try a different approach with Codex, use OpenCode with a local model for private code. The container state is shared , they all see the same files, same git history, same environment variables.

Three approaches to AI agents on your phone

Before we walk through the Cosyra setup, here's how the landscape breaks down. Each approach has real trade-offs.

1. SSH from phone to a desktop or VPS

The classic approach: run the agent on a "real" machine and SSH in from Blink Shell (iOS) or Termux (Android). Add Tailscale for networking and tmux for session persistence.

This is the approach described in most existing guides, SSH + Tailscale + tmux + Blink. It works if you have a reliable server. We used it ourselves for months before building Cosyra.

2. Browser-based cloud IDEs on mobile

GitHub Codespaces and code-server run VS Code in a mobile browser. You get a full editor, terminal, and extensions.

3. Native cloud terminal with agents pre-installed

This is what we built with Cosyra. A native iOS and Android app that connects to a persistent Ubuntu container in the cloud. Claude Code, Codex CLI, OpenCode, and Gemini CLI are pre-installed. The terminal UI is designed for touch, with larger tap targets, swipe gestures, and a toolbar row for common keys.

Try it free. 10 hours of compute, no credit card required. App Store / Google Play / Pricing details

Setting up each agent on Cosyra

The setup takes about two minutes per agent. Here's what it looks like.

Architecture diagram: phone connects to Cosyra cloud container running Claude Code, Codex CLI, OpenCode, and Gemini CLI with your own API keys
Cosyra architecture: your phone connects to a persistent Ubuntu container with all four agents pre-installed. Diagram created 2026-04-15.

Step 1: Install and start a container

Download Cosyra from the App Store or Google Play. Create an account (email or Sign in with Apple/Google). The app provisions your Ubuntu container on first launch. In our testing, that took about 15 seconds.

Step 2: Add your API keys

Each agent needs its own API key. In the Cosyra terminal, set them as environment variables. They persist across sessions.

cosyra, setting up API keys

$ # Claude Code (Anthropic)

$ echo 'export ANTHROPIC_API_KEY="sk-ant-..."' >> ~/.bashrc

 

$ # Codex CLI (OpenAI)

$ echo 'export OPENAI_API_KEY="sk-..."' >> ~/.bashrc

 

$ # Gemini CLI (Google)

$ echo 'export GEMINI_API_KEY="AIza..."' >> ~/.bashrc

 

$ source ~/.bashrc

For OpenCode, configure your provider in its config file, it supports 75+ LLM providers including local models. See the OpenCode docs for provider setup.

Step 3: Clone a repo and start coding

cosyra, cloning and launching Claude Code

$ git clone https://github.com/your-org/your-project.git

Cloning into 'your-project'...

Receiving objects: 100% (2847/2847), done.

$ cd your-project

$ claude

Claude Code v1.0.33

Type your prompt, or type "/" for commands.

 

> Review the open PR #42 and suggest improvements

That's it. The container has git, node, python, go, rust, and common dev tools pre-installed. Your files persist on 30 GB of storage. If the app goes to background, session hibernation keeps your work intact.

Switching between agents

All four agents are regular CLI tools. Switch between them like you would on a laptop:

cosyra, switching agents

$ # Start with Claude Code for a deep refactor

$ claude

> Refactor the auth module to use JWTs instead of sessions

 

$ # Try Codex for a quick fix

$ codex 'fix the broken test in auth.test.ts'

 

$ # Use Gemini CLI to navigate a large codebase

$ gemini

> Where is the rate limiter middleware defined?

A real workflow: reviewing a PR from the train

Here's a scenario we run through regularly. It's 8:40 AM, you're on the train to the office, and a teammate tagged you on a PR that needs review before standup at 9.

  1. Open Cosyra on your phone. Your container is still running from yesterday.
  2. cd into the project. git fetch && git checkout pr-branch.
  3. Run claude and ask: "Review the diff between main and this branch. Focus on security issues and missing tests."
  4. Claude Code reads every changed file, checks the test coverage, and gives you a structured review with specific line references.
  5. You read the review on your phone, approve the PR with a comment referencing Claude's findings, and push a small fix Claude suggested.
  6. You walk into standup at 9 having already reviewed and improved the PR. Total phone time: 6 minutes.

The agent did the heavy reading. You made the decisions. That's why the phone works, it's a command interface for an agent that does the actual typing.

Tips for phone-based agent work

How this compares to other mobile coding options

Feature Cosyra SSH + Blink/Termux Codespaces (mobile browser) Termux (local)
AI agents pre-installed 4 agents ready Manual install on server Manual install Limited (ARM, no Claude Code)
Setup time ~2 min 15-30 min per machine 5-10 min 10-20 min
Requires own server No Yes No (GitHub hosts) No (runs locally)
Native mobile app iOS + Android Blink (iOS) / Termux (Android) Browser only Android only
Persistent storage 30 GB Depends on server 32 GB (free tier) Device storage
Offline capable No No (SSH needs network) No Yes
x86_64 Linux Yes (Ubuntu) Depends on server Yes No (ARM userland)
Price $29.99/mo after trial Free + server cost Free 120 hrs/mo Free

Each option wins somewhere. Termux is unbeatable on price and offline capability. Codespaces is free and integrates with GitHub. SSH gives you maximum control. Cosyra's edge is that the agents work out of the box on a phone, no server maintenance, no browser compromises, no ARM compatibility issues. For a deeper look at Claude Code specifically, see our guide on how to run Claude Code on your phone.

Frequently asked questions

What is the best way to use Claude Code from my phone?

The most direct way is a cloud terminal like Cosyra that runs Claude Code in a persistent Ubuntu container accessible from the iOS or Android app. Alternatives include SSH into a desktop via Tailscale + tmux, or Claude's built-in Remote Control feature for monitoring and approvals only. Each approach has trade-offs , see the three approaches section above.

How do I use Codex CLI remotely from my mobile device?

Codex CLI needs a Linux or macOS environment. On a phone, you either SSH into a machine running Codex or use a cloud container with Codex pre-installed. Cosyra includes Codex CLI, add your OpenAI API key and run codex. Community alternatives like CC Pocket exist but require self-hosting.

Can you actually code on an iPhone?

Yes, and with AI agents it's more practical than you'd expect. The agent writes code; you review and approve. Short prompts work fine with the iPhone keyboard. For manual code editing, an external keyboard helps. Apps like PlayJs and Swift Playgrounds handle simple projects. For full-stack development with AI agents, you need a cloud terminal.

How do I approve Claude Code permission requests from my phone?

Claude Code's Remote Control shows permission prompts in a mobile browser, but requires a running desktop session. With Cosyra, Claude Code runs directly in your mobile terminal, permissions appear inline and you approve with a tap. No desktop required. Community tools like claude-remote-approver also exist for push-notification approval.

How can I run a Linux terminal on my Android phone?

Three options: Termux (free, local ARM Linux), Android's built-in Linux Terminal (Debian VM on supported devices), or a cloud terminal like Cosyra (full x86_64 Ubuntu with AI tools). Termux is the most popular for local use. Cosyra is the fastest path if you need AI coding agents and don't want to deal with ARM compatibility.

Do I need an external keyboard to code on my phone?

Not for agent-driven workflows. When Claude Code or Codex CLI does the typing, you're sending short prompts and approving changes, the phone keyboard handles that fine. For sessions over 20 minutes or manual code editing, a Bluetooth keyboard makes a real difference. We've shipped production fixes from a waiting room with just a thumb keyboard.

tl;dr

AI coding agents (Claude Code, Codex CLI, OpenCode, Gemini CLI) work well on phones because the agent types and you direct. Cosyra gives you a persistent Ubuntu container with all four pre-installed, install the app, add your API keys, start coding.

App Store / Google Play, Free trial, 10 hours, no credit card.

Get started now. Download Cosyra and run your first AI agent from your phone in two minutes.

Download for iOS · Download for Android · See pricing