Ravindra BagaleCourses & study guides Track your progress
AI CODING ASSISTANTS · CHAPTER 2 · SETUP

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

WHY

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

WHAT
  • Claude Code CLI: install first — the plugin runs the claude command.
  • Android Studio: current stable; JetBrains Marketplace must be reachable.
  • Paid Claude access: Pro / Max / Team / Enterprise or Claude Console — sign-in happens on first claude run.
  • Plugin name: Marketplace: Claude Code [Beta] (same family as IntelliJ / PyCharm / WebStorm).

How setup flows

1 · Install CLI claude --version 2 · Install plugin Marketplace → Claude Code 3 · Restart Studio full restart 4 · Run claude IDE terminal at project root 5 · Review diffs never auto-accept Gradle/key files

Install steps

HOW
  1. Install the CLI from Anthropic’s Claude Code quickstart. Check: claude --version.
  2. Android Studio → Settings → Plugins → Marketplace → search Claude Code → install Claude Code [Beta].
  3. Restart Android Studio completely.
  4. Open your app project. Open the Terminal tool window at the project root (where settings.gradle / settings.gradle.kts lives).
  5. Run claude and sign in when asked.
  6. Or use the Claude Code button / shortcut if shown (same family shortcuts as IntelliJ: often Ctrl+Esc / Cmd+Esc).
  7. External terminal? run claude then /ide until it says connected to Android Studio / IntelliJ.

Settings

  1. Settings → Tools → Claude Code [Beta]: set the Claude command path if Studio cannot find the CLI.
  2. On Windows + WSL, Anthropic docs often suggest a WSL wrapper as the Claude command — adjust distro name.
  3. In Claude: /config → Diff tool auto so patches open in the IDE diff viewer.
  4. 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)"
    ]
  }
}
  1. Put CLAUDE.md at the Android project root (or run /init).
  2. Deny local.properties, keystores, and google-services.json — those files often hold machine paths and keys.
  3. Start Claude from the same root Studio opened, so module paths match.

First task (5 minutes)

  1. Open one small Kotlin function (not the whole app module).
  2. Ask Claude: “Add null-safe checks and a unit test. Show the plan first. Do not touch Gradle or signing files.”
  3. Approve the plan, then review the IDE diff line by line.
  4. Run the unit test from Studio yourself.
SAFE FIRST PROMPT

In this selection only: add input checks and a unit test. Do not edit build.gradle files, local.properties, or any keystore.

FeatureAndroid note
Same plugin as IntelliJYes — JetBrains Marketplace family
Gradle editsHigh risk — demand a plan and read the diff
Emulator / deviceClaude does not replace your run configuration; you still press Run
SecretsDeny local.properties and keystores in settings
Rule: the Marketplace name may still include [Beta]. UI labels change; follow current Anthropic JetBrains docs if a menu moved.
  • 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

SMART AI USE

Select one composable or one use-case class, not the entire :app module. Keep CLAUDE.md short. New chat per feature.

Save these cards

INTERVIEW CARDAI Coding

Claude Code in Android Studio?

JetBrains Claude plugin + CLI.
Same family as IntelliJ; protect signing secrets.
Ravindra Bagale · ravindrabagale.com/ai-coding
COMPARISON CARDAI Coding

Claude vs Copilot in Android Studio

Claude Code: agent CLI + CLAUDE.md + approvals.
Copilot: GitHub plan, strong inline + chat plugin.
Ravindra Bagale · ravindrabagale.com/ai-coding
REVISION CARDAI Coding

Android Claude in 4

CLI → plugin → restart.
claude in Studio terminal.
CLAUDE.md + deny secrets.
Review Gradle diffs carefully.
Ravindra Bagale · ravindrabagale.com/ai-coding