Skip to content

How to Run AI Coding Agents on Your Phone

By Cosyra Editorial Team

Published Last updated 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. If you want the broader context first (any terminal, not just AI agents), the mobile coding terminal pillar sets the stage. 1 hour free on signup, no credit card.

Quick decision — pick the agent you came for:

  • Claude Code — deep codebase understanding, multi-file refactors, PR review. How to run it ↓
  • Codex CLI — quick edits, sandboxed execution, OpenAI models. How to run it ↓
  • Gemini CLI — 1M-token context, large-codebase navigation, Google's free tier (60 rpm / 1000 rpd). How to run it ↓
  • OpenCode — open-source, 75+ providers including local models for private code. How to run it ↓

Or run all four in one container in about two minutes — setup section ↓.

What do the four mobile AI coding agents actually do?

Claude Code is best for deep codebase understanding and multi-file refactors; Codex CLI is best for quick edits and sandboxed execution; OpenCode is the open-source option that works with 75+ providers including local models; Gemini CLI brings Google's 1M-token context window for large codebase navigation. Cosyra pre-installs all four and all four use BYOK, so you pay Anthropic, OpenAI, or Google directly at their standard rates.

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.

Why do AI coding agents change the phone equation?

Because you direct the agent in short prompts instead of typing code character by character, and agents do most of the typing for you. Your job shifts to review and approve, which is a reading-heavy, tap-heavy interaction that fits a 6-inch screen. The standard "phone keyboards are too small to code on" objection is fair only when you are the one writing every semicolon. Agents flip that ratio, and the phone becomes viable for real engineering work.

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:

What are the three approaches to AI agents on your phone?

The three approaches are SSH from your phone to a desktop or VPS that runs the agent, installing the agent directly in a local terminal app like Termux, or running the agent in a mobile cloud terminal like Cosyra. Each has a real trade-off: SSH needs an always-on machine, Termux hits x86_64 ABI issues and Android's phantom process killer, and a cloud terminal costs a subscription but removes both problems.

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. 1 hour on signup, no credit card. Extend with a 10-hour, 7-day trial when you want more. App Store / Google Play / Pricing details

How do you set up each AI agent on Cosyra?

You set up each agent in about two minutes: install Cosyra, open the app to land in the Ubuntu container, paste the corresponding provider API key into your shell, and run the agent's command (claude, codex, opencode, or gemini). All four are already on PATH. You pay the provider directly at their standard token rates; Cosyra never touches your AI billing.

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.

Step 4: Switch between agents in the same container

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?

What does a real mobile AI coding session look like?

A real session looks like six minutes of phone time: open the app, the container is already running, cd into the project, run claude with a short "review the diff between main and this branch" prompt, read the structured review, approve the PR, and push a small fix. The agent does the heavy reading; you make the decisions. Below is a PR review we ran on the 8:40 AM train before standup at 9.

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.

What are the best tips for phone-based AI agent work?

The best tips are: let the agent do the typing with short descriptive prompts, bring an external keyboard only for sessions longer than twenty minutes, use tmux for split panes, commit and push from inside the container instead of switching devices, and rely on session hibernation so you can come back hours later with everything intact. Those five habits cut phone session friction more than any app setting.

How does mobile agent work on Cosyra compare to other mobile coding options?

Cosyra wins on pre-installed AI agents, native iOS and Android apps, persistent cloud compute that does not depend on your laptop being awake, and zero Android phantom-process-killer risk. SSH plus Blink or Termux is cheaper if you already run a server; Codespaces is deeper on GitHub integration; Termux is free but exposes you to ABI issues and phantom process killer on Android 12+. The table below lays them side by side.

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, or the matching walkthrough for Codex CLI. For Google's free-tier agent (60 rpm / 1000 rpd on Gemini 2.5 Pro), see Gemini CLI on your phone; for the open-source agent that pairs with any provider key you already have, see OpenCode on your phone. On iPad with a Magic Keyboard, the workflow opens up with Split View and Stage Manager — covered separately in Claude Code on iPad. On Android, the Bionic-vs-glibc ABI gap and Android 12+ phantom process killer change the setup story enough to deserve its own walkthrough — Pixel, Galaxy, foldables, and Samsung DeX are covered in Claude Code on Android. Zoomed out one level, the question "which AI pair programmer fits a phone" splits into three working paradigms (remote-control your desktop, cloud container, local Termux), compared honestly in AI pair programmer on your phone. And if you arrived here searching for "vibe coding," we untangle the developer version of that term — agents editing your real repo — from the no-code app builders in vibe coding 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. Sign up — 1 hour free, no credit card. Extend with a 10-hour, 7-day trial when you want more.

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

See pricing