How to Build Mobile Apps with Claude Code
Point Claude Code at a mobile repo, give it the framework and target platforms in CLAUDE.md, and describe screens in plain language. It scaffolds React Native, Expo, or Flutter projects, edits components, and runs build commands. Keep a simulator open so you can screenshot results back to it, and index your framework docs so it uses current APIs.
Why mobile is different from web work in Claude Code
Claude Code treats a mobile repo the same way it treats any project. It reads files, edits them, runs commands, and shows diffs. The difference is the feedback loop and the surface area.
On the web the agent can often reason about a page from the markup alone. On mobile the output only exists after a build lands on a simulator or device. There is a compile step, a native toolchain, and two platforms that disagree about layout, permissions, navigation, and fonts. The agent cannot see the rendered screen unless you show it.
So mobile work with Claude Code is a tighter loop of describe, build, run, screenshot, correct. Your job is to keep that loop fast and to give the agent the context it cannot infer: which framework, which version, which platforms, and what your existing components look like. Get those four things right and the agent behaves like a strong mobile developer who already read your codebase.
Set up a mobile project the agent can drive
Start in a real project folder and make the toolchain runnable from the terminal, because that is the only place Claude Code can act. Then write a CLAUDE.md that removes the guesswork.
Scaffold or open the app
For a fresh app, ask for the exact stack you want. "Scaffold an Expo app with TypeScript and file based routing" or "Create a Flutter project targeting iOS and Android with null safety." The agent runs the create command, then you confirm it builds:
# React Native / Expo
npx create-expo-app@latest my-app
cd my-app && npx expo start
# Flutter
flutter create my_app
cd my_app && flutter run
If you are opening an existing app, just launch Claude Code from the repo root. It will read your package.json or pubspec.yaml and infer most of the stack, but do not rely on inference for versions.
Write a CLAUDE.md that names the platform truth
The single highest leverage file for mobile is CLAUDE.md at the repo root. Put the durable, easy to get wrong facts there: the framework and exact version, the target platforms, the package manager, how to run on each simulator, and any native modules that need special handling.
Without this, the agent guesses. It will reach for a navigation API from a major version you are not on, or write an iOS only permission flow for an Android build. With it, the agent knows you are on Expo Router, that you run npx expo run:ios, and that push notifications go through your existing service wrapper. Run /init to draft the file, then trim it to what actually changes behavior.
Iterate on UI with a screenshot loop
Layout is the part where the agent is blind, so you close the gap by feeding it pixels. Keep a simulator running the whole session. When you ask for a screen, let the agent write the components, then build and run it, capture the simulator screenshot, and paste that image back into the conversation.
The agent reads the screenshot and adjusts. "The header overlaps the notch, move content below the safe area" becomes a concrete fix once it can see the overlap. This loop is far more reliable than describing a layout in words. On iOS, watch for safe area insets, dynamic type, and the home indicator. On Android, watch for the status bar, back gesture, and elevation shadows that do not translate from iOS design.
Work one screen at a time. Approve the diff, run it, screenshot, correct. A focused loop on a single screen produces better output than asking for five screens at once and debugging a pile of layout errors together.
Handle the platform gotchas that break agent output
Mobile has sharp edges that a general model does not always respect. Name them up front and the agent stops making the same class of mistake.
- Navigation: React Navigation, Expo Router, and Flutter's Navigator all differ by major version. Pin the version in CLAUDE.md so the agent stops mixing patterns.
- Permissions: camera, location, and notifications need platform specific declarations in
Info.plistandAndroidManifest.xml. Ask the agent to update both, and verify it did. - Native dependencies: a library that needs a pod install or a Gradle change will not just work after
npm install. Tell the agent when a dependency has a native step. - Async storage and secure storage: the correct package changes between framework versions, and this is a common place the agent picks a deprecated one.
The underlying issue is version drift. Framework APIs move quickly, and the model's built in knowledge trails the current release. That mismatch is where most of your rework and wasted tokens come from on mobile, because the agent confidently writes an API that no longer exists and you spend a round trip correcting it.
Cut rework by grounding the agent in current APIs
The fix for version drift is retrieval. Instead of hoping the model remembers the current React Native, Expo SDK, or Flutter surface, give the agent a place to look it up.
RDK is built for this. You index the material the agent keeps getting wrong as encrypted private chunks: your framework's official docs for the version you actually ship, the release notes that mark what changed, and your own component library so the agent reuses your Button and Screen primitives instead of inventing new ones. The agent searches those chunks before it calls the model, so it emits the correct current API and your real component names rather than a plausible hallucination.
The payoff is fewer correction rounds. Private vault retrieval alone answers 40 to 65 percent of everyday queries, and the public network adds another 15 to 20 percent, leaving the model as fallback for the rest. On mobile, where a single wrong navigation import can cost several build and fix cycles, retrieving the settled answer instead of regenerating it removes the most expensive failure mode. You do not need this to ship a first screen. Reach for it once the same framework mistakes keep reappearing across sessions.
Frequently asked questions
- Can Claude Code build both React Native and Flutter apps?
- Yes. Claude Code is framework agnostic because it works by editing files and running your CLI. It builds React Native, Expo, and Flutter projects, and can work on native iOS or Android code too. Tell it which stack you use in CLAUDE.md so it writes idiomatic code for that framework instead of mixing conventions across them.
- How does Claude Code see what my app looks like on screen?
- It cannot see the rendered screen on its own. You keep a simulator running, capture a screenshot of the result, and paste that image into the conversation. The agent reads the screenshot and adjusts layout and styling. This screenshot loop is the most reliable way to iterate on mobile UI, since layout only exists after a build.
- Why does the agent keep using APIs that do not exist in my framework?
- Mobile framework surfaces change fast, and the model's built in knowledge trails the current release. It writes an API that was valid in an older version. Pin your exact framework version in CLAUDE.md, and index your version's official docs as retrieval chunks so the agent looks up the current API instead of guessing from stale memory.
- Do I need retrieval to build a mobile app with Claude Code?
- No. You can scaffold and ship a first screen with just CLAUDE.md and the screenshot loop. Retrieval matters once the same framework mistakes keep reappearing across sessions. Indexing your docs and component library then cuts the correction rounds that cost the most tokens, especially around navigation, permissions, and native dependencies.