How to Set Up Claude Code in Android Studio (Step by Step)
Android Studio is a JetBrains IDE. Claude Code uses the same Claude Code [Beta] Marketplace plugin plus the Claude CLI that IntelliJ uses — with Android-specific safety for keys, keystores and local.properties.
In short: install the Claude Code CLI, install the JetBrains Claude Code [Beta] plugin inside Android Studio, restart, run claude in the IDE terminal at the project root, add a short CLAUDE.md, and deny secret files.
Why Claude Code in Android Studio
Mobile students already live in Android Studio for Kotlin/Compose. The plugin keeps Claude next to Gradle modules and the IDE diff viewer, so you review APK-breaking edits before you accept them.
What you need
- Claude Code CLI: install first — the plugin runs the
claudecommand. - Android Studio: current stable; JetBrains Marketplace must be reachable.
- Paid Claude access: Pro / Max / Team / Enterprise or Claude Console — sign-in happens on first
clauderun. - Plugin name: Marketplace: Claude Code [Beta] (same family as IntelliJ / PyCharm / WebStorm).
How setup flows
Install steps
- Install the CLI from Anthropic’s Claude Code quickstart. Check:
claude --version. - Android Studio → Settings → Plugins → Marketplace → search Claude Code → install Claude Code [Beta].
- Restart Android Studio completely.
- Open your app project. Open the Terminal tool window at the project root (where
settings.gradle/settings.gradle.ktslives). - Run
claudeand sign in when asked. - Or use the Claude Code button / shortcut if shown (same family shortcuts as IntelliJ: often Ctrl+Esc / Cmd+Esc).
- External terminal? run
claudethen/ideuntil it says connected to Android Studio / IntelliJ.
Settings
- Settings → Tools → Claude Code [Beta]: set the Claude command path if Studio cannot find the CLI.
- On Windows + WSL, Anthropic docs often suggest a WSL wrapper as the Claude command — adjust distro name.
- In Claude:
/config→ Diff tool auto so patches open in the IDE diff viewer. - File refs: Alt+Ctrl+K (Mac: Cmd+Option+K) inserts
@File.kt#L…style references when available.
Configuration
CLAUDE.md (Android-oriented)# Android project rules for Claude Code - Prefer Kotlin. Match existing package names and Gradle modules. - Never invent or hard-code API keys, tokens, or signing passwords. - Do not modify local.properties, keystore files, or google-services.json secrets. - Ask before adding new Gradle dependencies. - Prefer ViewModel + repository patterns already used in this app.~/.claude/settings.json (deny secrets)
{
"permissions": {
"deny": [
"Read(./.env)",
"Read(./local.properties)",
"Read(**/*keystore*)",
"Read(**/google-services.json)"
]
}
}- Put
CLAUDE.mdat the Android project root (or run/init). - Deny
local.properties, keystores, andgoogle-services.json— those files often hold machine paths and keys. - Start Claude from the same root Studio opened, so module paths match.
First task (5 minutes)
- Open one small Kotlin function (not the whole app module).
- Ask Claude: “Add null-safe checks and a unit test. Show the plan first. Do not touch Gradle or signing files.”
- Approve the plan, then review the IDE diff line by line.
- Run the unit test from Studio yourself.
In this selection only: add input checks and a unit test. Do not edit build.gradle files, local.properties, or any keystore.
| Feature | Android note |
|---|---|
| Same plugin as IntelliJ | Yes — JetBrains Marketplace family |
| Gradle edits | High risk — demand a plan and read the diff |
| Emulator / device | Claude does not replace your run configuration; you still press Run |
| Secrets | Deny local.properties and keystores in settings |
- Never paste Play Console passwords, keystore passwords, or API keys into chat.
- Company policy may ban cloud AI on client apps — ask first.
Quick quiz
1. What must exist before the Android Studio plugin works?
The Claude Code CLI on PATH (or a full path in plugin settings).
2. Same plugin as IntelliJ?
Yes — Claude Code [Beta] JetBrains family.
3. Which files should deny rules cover?
local.properties, keystores, google-services.json / .env-style secrets.
4. External terminal connect command?
/ide after starting claude.
Save tokens and money
Select one composable or one use-case class, not the entire :app module. Keep CLAUDE.md short. New chat per feature.