Skip to main content
Guide · AI & LLM

Claude Code for Flutter Developers: Setup, Skills and MCP

Set up Claude Code for Flutter: install the official dart-flutter plugin, write a CLAUDE.md, add skills, hooks and the Dart MCP server. Examples inside.

Afaq Zahir, author

Afaq Zahir

Flutter mobile product engineer

Published Updated 15 min read

On this page
  1. What does Claude Code actually do in a Flutter project?
  2. How do you set up Claude Code for Flutter in five minutes?
  3. What should a Flutter CLAUDE.md contain?
  4. Which Claude Code skills should a Flutter developer add?
  5. How do you connect the Dart MCP server to Claude Code?
  6. Which Flutter commands should Claude Code be allowed to run?
  7. How do hooks stop Claude Code from breaking a Flutter repo?
  8. When should you use subagents and plan mode on a Flutter task?
  9. Claude Code or Cursor for Flutter: which should you pick?
  10. What does a Claude Code session look like with this setup?
  11. Frequently Asked Questions

Quick answer

Install Claude Code, run /init in your Flutter repo, then add the official Flutter plugin with claude plugin marketplace add flutter/agent-plugins and claude plugin install dart-flutter@dart-flutter. Keep CLAUDE.md under 200 lines, put multi-step procedures in .claude/skills, enforce hard rules with hooks, and let the Dart MCP server handle analysis, hot reload and runtime errors.

Key takeaways

  • The Flutter team publishes an official Claude Code plugin, dart-flutter, that installs 25 Dart and Flutter skills and registers the Dart and Flutter MCP server.
  • Claude Code plugins do not load the plugin's rules automatically, so copy the official hot reload rule into CLAUDE.md or a path-scoped rule yourself.
  • CLAUDE.md holds facts for every session and should stay under 200 lines; multi-step procedures belong in skills, and hard rules belong in hooks.
  • Several MCP tools, including run_tests and dart_format, are off by default, so Claude usually runs flutter test and dart format through Bash. Set permission rules for them.
  • Use plan mode before multi-file changes and hand verbose work like test runs to a subagent to keep the main context small.

Claude Code is Anthropic's agentic coding tool: it reads your repo, edits files and runs commands. For Flutter, the setup that works is the Flutter team's official dart-flutter plugin, a CLAUDE.md under 200 lines, two or three project skills, two hooks and the Dart and Flutter MCP server. In the Flutter team's Q2 2026 developer survey (over 3,500 responses), Claude Code was the most used AI coding agent at 32%. I have already compared Claude Code, Antigravity and Cursor; this guide is the Claude Code Flutter setup itself.

Versions checked on 24 October 2026: dart-flutter plugin 1.0.7, dart_mcp_server 1.2.1, Flutter docs 3.47, Dart docs 3.13.3.

What does Claude Code actually do in a Flutter project?

Claude Code is Anthropic's agentic coding tool. It reads your codebase, edits files, runs commands and connects to your development tools. In a Flutter repo that means it can open your widgets, change Dart files, and run flutter analyze or flutter test, asking for permission according to the rules you set.

It runs in the terminal, VS Code (the extension also installs in Cursor), JetBrains IDEs, a desktop app and the web. Every surface uses the same engine, so CLAUDE.md, settings and MCP servers carry over (Claude Code overview).

  • Install: curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux or WSL, brew install --cask claude-code, or winget install Anthropic.ClaudeCode on Windows.
  • Check it: claude --version prints the version, and claude doctor prints install and settings diagnostics.
  • Windows: install Git for Windows so Claude Code can use its Bash tool; otherwise it falls back to PowerShell (Claude Code setup docs).
  • Plan: Claude Code needs a Pro, Max, Team, Enterprise or Console account. The free plan does not include it.

How do you set up Claude Code for Flutter in five minutes?

Open your Flutter repo, generate a CLAUDE.md with /init, then install the official Flutter plugin with two commands. That gives Claude your project's build and test commands plus the Flutter team's skills and MCP server configuration, before you write any custom rules.

  1. Start a session. cd into the repo root and run claude.
  2. Run /init. Claude analyses the codebase and writes a starting CLAUDE.md with build commands, test instructions and conventions it finds.
  3. Add the marketplace. claude plugin marketplace add flutter/agent-plugins
  4. Install the plugin. claude plugin install dart-flutter@dart-flutter
  5. Verify. claude plugin list shows your installed plugins (Claude Code plugin docs). The Flutter docs use claude plugin marketplace list, which lists the marketplaces you have added.

What does the dart-flutter plugin install?

dart-flutter is the Flutter team's official Claude Code plugin (version 1.0.7, from the flutter/agent-plugins repo). It installs 25 skills, 10 flutter-* and 15 dart-* mirrored from the Dart team's repo, and its manifest registers the Dart and Flutter MCP server, which runs dart mcp-server. It does not load the repo's hot reload rule for you.

Flutter's Get started with AI page says so directly: "Claude Code plugins discover skills and MCP servers, but don't automatically load plugin rules." The repo has one rule, rules/flutter-hot-reload.md, plus a Cursor-format copy, flutter-hot-reload.mdc. It targets **/lib/**/*.dart.

The rule tells the agent to find running apps through the Dart MCP server after an edit. It calls hot_reload for UI or simple method changes, and hot_restart when initState, global or static state, or main() changes. Edits outside lib/ and comment-only edits are skipped. Copy this guidance into CLAUDE.md yourself; the CLAUDE.md sample in this guide does that.

Also note that an enabled plugin's skill names and descriptions sit in context on every turn, even when unused. /skill-doctor shows the cost per skill.

What should a Flutter CLAUDE.md contain?

Only the facts Claude needs in every session: build and test commands, project layout, conventions and "always do this" rules. Anthropic's Claude Code memory docs say to keep each CLAUDE.md under 200 lines and to move multi-step procedures into skills and file-specific instructions into path-scoped rules.

  • Where it lives: ./CLAUDE.md or ./.claude/CLAUDE.md for the team, CLAUDE.local.md for personal notes (gitignore it), ~/.claude/CLAUDE.md for all your projects.
  • AGENTS.md: Claude Code (v2.1.277 or later) reads AGENTS.md only when no CLAUDE.md exists. If your team already keeps one, import it with @AGENTS.md. Imports can nest up to four hops. My AGENTS.md sample for Flutter lives in the comparison post.
  • It is context, not enforcement. Claude Code's memory docs say it plainly: "To block an action regardless of what Claude decides, use a PreToolUse hook instead." The hooks section of this guide shows the two hooks I use on Flutter repos.

This is the CLAUDE.md I start from on a feature-first app with Clean MVVM layer separation and Riverpod. Every command in it is from the Flutter and Dart CLI docs; the hot reload section paraphrases the official rule.

# CLAUDE.md

## Project
Flutter app for iOS and Android. Feature-first layout:
lib/features/<feature>/{data,domain,presentation}
Architecture: Clean MVVM. State: Riverpod only.

## Commands
- Install deps: flutter pub get
- Analyze: flutter analyze
- Format: dart format .
- Test: flutter test
- Codegen: dart run build_runner build --delete-conflicting-outputs
- Localization: flutter gen-l10n

## Rules
- Never edit *.g.dart or *.freezed.dart; run build_runner instead.
- Dispose every controller, stream subscription and focus node.
- Theme values come from ThemeData tokens, no hard-coded colors.
- No new packages without asking.
- No API keys in Dart; AI calls go through the backend proxy.
- Done means: flutter analyze is clean and flutter test passes.

## Hot reload
After editing files under lib/, use the dart MCP hot_reload tool.
Use hot_restart after changes to initState, global state or main().

@AGENTS.md

The proxy rule matters for any app with AI features. I explain why AI keys belong behind a backend proxy in a separate guide.

How do path-scoped rules work in Claude Code?

Markdown files in .claude/rules/ are rules. A rule without paths: frontmatter loads at launch, like CLAUDE.md. A rule with a paths: glob list loads only when Claude reads or edits a matching file. That makes it the native home for the hot reload rule if you want a shorter CLAUDE.md. Move the "Hot reload" section into .claude/rules/flutter-hot-reload.md:

---
paths: ["lib/**/*.dart"]
---

After editing files under lib/, use the dart MCP hot_reload tool.
Use hot_restart after changes to initState, global state or main().

Which Claude Code skills should a Flutter developer add?

Start with the 25 official skills that come with the dart-flutter plugin, then write two or three project skills for procedures you repeat in your own codebase. Skills load their full instructions only when used, so they cost less context than the same text in CLAUDE.md.

Which official skills come with the plugin?

Flutter's How AI tools work page describes agent skills as "task-oriented blueprints that teach assistants how to perform specific workflows (such as creating responsive layouts or writing tests)," while the Dart and Flutter MCP server exposes "real-time SDK diagnostics, symbol resolution, and runtime introspection to assistants." Its "When to use what" table pairs skills with multi-step recipes and patterns, and the MCP server with local SDK tools for diagnostics, tests and runtime. My own shorthand: MCP gives Claude the tools, skills give it the recipes. The 10 Flutter skills are:

  • flutter-add-widget-test, flutter-add-integration-test, flutter-add-widget-preview
  • flutter-apply-architecture-best-practices, flutter-build-responsive-layout, flutter-fix-layout-issues
  • flutter-implement-json-serialization, flutter-setup-declarative-routing, flutter-setup-localization, flutter-use-http-package

The 15 Dart skills from dart-lang/skills cover unit tests, mocks, coverage, runtime errors, package conflicts, FFI and documentation. dart-run-static-analysis, for example, runs dart analyze and dart fix --apply.

How does a project skill work?

A skill is a SKILL.md file with YAML frontmatter and markdown instructions, stored at .claude/skills/<name>/SKILL.md (commit it for the team) or ~/.claude/skills/ for personal use. Every frontmatter field is optional in Claude Code; write description well, because Claude loads a skill automatically when it matches the task. You can also call it with /skill-name, and arguments arrive in $ARGUMENTS. Keep it under 500 lines. Old .claude/commands/ files now work as skills (Claude Code skills docs).

Here is my feature scaffold skill, saved as .claude/skills/flutter-feature/SKILL.md:

---
name: flutter-feature
description: Scaffold a new feature-first module with data, domain and presentation layers, a Riverpod notifier and a widget test. Use when asked to add a new screen or feature.
argument-hint: <feature-name>
---

Create the feature $ARGUMENTS under lib/features/$ARGUMENTS/:

1. data/: repository + DTOs (json_serializable). Do not hand-write *.g.dart.
2. domain/: entity + use case.
3. presentation/: screen widget + Riverpod notifier.
4. test/features/$ARGUMENTS/: one widget test with WidgetTester.
5. Run: dart run build_runner build --delete-conflicting-outputs
6. Run: flutter analyze, then flutter test. Stop and report if either fails.

A second skill I would add is a flutter-release-check that runs flutter analyze, flutter test and dart format -o none --set-exit-if-changed ., with disable-model-invocation: true so it only runs when I call it.

Which community Flutter skills are worth a look?

GitHub API snapshot, 24 October 2026
RepoStarsLast pushWhat it isStatus
flutter/agent-plugins3,1022026-10-2125 skills, MCP config, 1 ruleOfficial
dart-lang/skills5302026-10-1615 Dart skillsOfficial
Jeffallan/claude-skills12,0322026-10-2167 skills, including flutter-expertActive
affaan-m/ECC287,5612026-10-20General skill collection with a flutter-dart-code-review skillActive
thienqo/flutter-skills72026-10-0637 skills with evaluation casesSmall, active
cleydson/flutter-claude-code532026-03-0419 agents and 1 skillStale

Stars and last-push dates are from the GitHub API on 24 October 2026. My opinion: install the official plugin first and read any community skill before enabling it.

How do you connect the Dart MCP server to Claude Code?

Install the dart-flutter plugin as shown above. Its manifest registers the Dart and Flutter MCP server (dart mcp-server), so the plugin sets it up for you. Then run /mcp inside a session to confirm the server is connected.

For other MCP clients, the Flutter MCP server docs give this generic entry for the client's MCP configuration file:

{
  "mcpServers": {
    "dart": {
      "command": "dart",
      "args": ["mcp-server"]
    }
  }
}

If you skip the plugin, Claude Code's MCP docs cover project-scoped servers in .mcp.json, and Claude Code asks for approval before using servers from a project .mcp.json. You can also add a local stdio server with claude mcp add [options] <name> -- <command> [args...]. I use the plugin route. My Dart and Flutter MCP server setup guide covers every tool and the other clients.

The server needs Dart 3.9.0-163.0.dev or later (dart_mcp_server README). The pub.dev package is at 1.2.1 and still says "This package is still experimental and is likely to evolve quickly." Its README lists which tools are on by default:

  • On by default: analyze_files, lsp, pub, pub_dev_search, hot_reload, hot_restart, widget_inspector, get_runtime_errors, dtd, vm_service, flutter_driver_command, read_package_uris, rip_grep_packages, roots.
  • Off by default (turn on with --enable): run_tests, dart_format, dart_fix, launch_app, stop_app, list_devices, list_running_apps, get_app_logs, create_project, get_active_location.

Two practical points. A Flutter app running in debug or profile mode registers with the Dart Tooling Daemon automatically unless you pass --no-dds, which is what lets Claude hot reload it. And because run_tests and dart_format are off by default, Claude will usually run flutter test and dart format through Bash. That is why permissions matter.

Which Flutter commands should Claude Code be allowed to run?

Allow the commands that read, check and generate code, ask before anything that builds, runs or cleans, and deny pushes. Per Claude Code's permissions docs, permission rules live in .claude/settings.json, are enforced by Claude Code rather than the model, and deny rules always win over allow rules.

Bash rules match a command prefix followed by *; manage them with /permissions. My starting allowlist (every command is from the Flutter and Dart CLI docs; the split is my choice):

{
  "permissions": {
    "allow": [
      "Bash(flutter analyze *)",
      "Bash(dart analyze *)",
      "Bash(dart format *)",
      "Bash(dart fix --dry-run *)",
      "Bash(flutter test *)",
      "Bash(flutter pub get *)",
      "Bash(flutter pub add *)",
      "Bash(dart run build_runner *)",
      "Bash(flutter gen-l10n *)",
      "Bash(flutter doctor *)",
      "Bash(flutter devices *)"
    ],
    "ask": [
      "Bash(dart fix --apply *)",
      "Bash(flutter run *)",
      "Bash(flutter build *)",
      "Bash(flutter clean *)"
    ],
    "deny": [
      "Bash(git push *)"
    ]
  }
}

For CI, dart pub get --enforce-lockfile fails when pubspec.lock does not match, which the Dart pub get docs recommend.

Permission modes sit on top of these rules: default, acceptEdits, plan, auto, dontAsk and bypassPermissions, the last meant only for isolated containers or VMs. Shift+Tab cycles default, acceptEdits and plan. I use plan mode for any refactor.

How do hooks stop Claude Code from breaking a Flutter repo?

For Flutter, use two hooks: a PostToolUse hook that runs dart format on every edited Dart file, and a PreToolUse hook that blocks edits to *.g.dart and *.freezed.dart. PreToolUse runs before a tool call and can block it with exit code 2; PostToolUse runs after the call and cannot block it.

When a PreToolUse hook exits with code 2, Claude Code stops the action and shows Claude the hook's stderr as the reason (Claude Code hooks reference). Both hooks below are shell commands configured under a hooks key in .claude/settings.json.

Hook 1, format every Dart edit. The official hooks guide example pipes the edited file path into Prettier. Swapping in dart format is my adaptation, and so is the *.dart filter, which skips edits to CLAUDE.md, JSON or YAML files so the formatter only sees Dart:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "f=$(jq -r '.tool_input.file_path // empty'); case \"$f\" in *.dart) dart format \"$f\" ;; esac"
          }
        ]
      }
    ]
  }
}

Hook 2, protect generated files. The rule "never edit *.g.dart" in CLAUDE.md is only advice. This PreToolUse hook enforces it: it reads .tool_input.file_path with jq and exits 2 when the path ends in .g.dart or .freezed.dart, printing the reason to stderr. This is my own example built from the documented pieces, so test it on a scratch file first.

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "f=$(jq -r '.tool_input.file_path // empty'); case \"$f\" in *.g.dart|*.freezed.dart) echo 'Generated file. Run build_runner instead.' >&2; exit 2 ;; esac"
          }
        ]
      }
    ]
  }
}

Put PostToolUse and PreToolUse side by side inside one hooks object, and merge that hooks key into the same object as permissions: settings.json has one top-level object, so pasting the blocks one after another gives invalid JSON.

When should you use subagents and plan mode on a Flutter task?

Use plan mode before any multi-file change, so Claude researches and proposes without editing your source. Use subagents for verbose, self-contained work like test runs and log reading. Each subagent has its own context window, so the noise stays out of your main session.

  • Subagents are markdown files with name and description frontmatter in .claude/agents/ (project) or ~/.claude/agents/ (Claude Code subagents docs). My first one is a flutter-test-runner that runs flutter test and reports only failures, which is the kind of delegation the costs docs recommend.
  • Cost hygiene: /clear between tasks, /compact on long ones, skills instead of a long CLAUDE.md, and /usage to see session cost. For scale, Anthropic's Claude Code costs docs report an enterprise average of around $13 per developer per active day.

Here is that subagent, saved as .claude/agents/flutter-test-runner.md:

---
name: flutter-test-runner
description: Runs flutter test and reports only failing tests. Use after code changes or when asked to run the test suite.
tools: Bash, Read
---

Run flutter test from the repo root.
If every test passes, reply with the number of tests that passed.
If tests fail, list each failing test's name and file with the first lines of its error.
Do not edit any files.

The task loop itself is the same one I describe in the prompt, plan, edit, verify, review loop for Antigravity. For crash and leak work, pair Claude with how I diagnose Flutter crashes and memory leaks.

Claude Code or Cursor for Flutter: which should you pick?

Pick Claude Code for terminal-first, multi-file agentic work where you approve commands, and Cursor for fast in-editor completion. It is not either-or: the Claude Code VS Code extension also installs in Cursor, so you can use both on the same project.

In the Flutter Q2 2026 developer survey, Claude Code led at 32%, ahead of Antigravity at 23%, GitHub Copilot 19%, Cursor 18% and Codex 17% (setup is in my OpenAI Codex for Flutter guide), with respondents able to pick several tools. The full breakdown is in Claude Code vs Cursor vs Antigravity for Flutter.

What does a Claude Code session look like with this setup?

With this setup, adding a feature is one skill call and a review. The setup targets codebases like TourVista, which I architected with Riverpod, Clean MVVM, Drift caching and AI calls streamed through a Cloud Functions proxy, and which reached both stores in 28 days.

  1. Plan mode on, then /flutter-feature landmarks. I read the plan before accepting.
  2. Claude creates the layers and runs build_runner, flutter analyze and flutter test without prompting, since they are allowlisted.
  3. The format hook formats each written Dart file. If Claude tries to patch a .g.dart file, the PreToolUse hook blocks it.
  4. Claude hot reloads the running debug app through the MCP server, and I check the screen on a device.
  5. I read every diff before committing. Claude cannot push, because of the deny rule.

The wider pipeline, from idea to store release, is in my full AI Flutter workflow.

Frequently Asked Questions

Is Claude Code good for Flutter development?

Yes. In the Flutter team's Q2 2026 developer survey, 32% of respondents used Claude Code, the most of any AI coding agent, and it had 86% top-two-box satisfaction. It reads your repo, edits Dart files and runs flutter analyze and flutter test, and the official dart-flutter plugin adds Flutter-specific skills and the Dart MCP server.

What should a Flutter CLAUDE.md file contain?

Your build, test, format and codegen commands, the folder layout, your state management choice and a short list of always-do rules, such as never editing generated files. Claude Code's memory docs say to keep it under 200 lines. Put multi-step procedures in skills and rules that only apply to some files in .claude/rules/ with a paths list.

Which Claude Code skills should a Flutter developer install?

Start with the official dart-flutter plugin from flutter/agent-plugins, which ships 25 skills covering widget and integration tests, layout fixes, JSON serialization, routing, localization and Dart analysis. Then write project skills for your own repeated procedures.

Does Flutter have an official MCP server, and how do I add it to Claude Code?

Yes. The Dart and Flutter MCP server runs with dart mcp-server and needs Dart 3.9.0-163.0.dev or later. For Claude Code, the Flutter docs recommend the official plugin: claude plugin marketplace add flutter/agent-plugins, then claude plugin install dart-flutter@dart-flutter, which installs the skills and the MCP configuration. The package is still marked experimental.

Can Claude Code hot reload a running Flutter app?

Yes, through the Dart and Flutter MCP server, whose hot_reload and hot_restart tools are on by default. A Flutter app running in debug or profile mode registers with the Dart Tooling Daemon automatically unless you start it with --no-dds (dart_mcp_server README). Copy the official hot reload rule into CLAUDE.md so Claude calls them after edits.

Does Claude Code work on Windows for Flutter development?

Yes. Claude Code supports Windows 10 1809 or later and installs with winget install Anthropic.ClaudeCode or the PowerShell installer. Install Git for Windows as well, so Claude Code can use its Bash tool; without it, Claude Code uses PowerShell as its shell tool (Claude Code setup docs).

How do I stop Claude Code from editing generated files like *.g.dart?

A CLAUDE.md rule helps, but Claude Code treats CLAUDE.md as context, not enforcement. To block the edit, add a PreToolUse hook on Edit and Write that checks the file path and exits with code 2 for .g.dart and .freezed.dart files. The stderr message tells Claude to run build_runner instead.

Claude Code or Cursor for Flutter, which is better?

Neither is better for everything. Claude Code suits terminal-first, multi-file agentic work where you approve each command, while Cursor suits fast in-editor completion. The Claude Code VS Code extension also installs in Cursor, so you can use both on one project. See my Flutter AI coding tools comparison.

Which state management works best with Claude Code, Riverpod or BLoC?

Either works. What matters is naming one in CLAUDE.md so the agent stops mixing patterns across features. I use Riverpod on feature-first apps, but that is a project choice, not an AI one. If you are still deciding, see my Riverpod vs BLoC comparison.

Which Claude plan do I need for Claude Code?

Claude Code needs a Pro, Max, Team, Enterprise or Console account; the free plan does not include it. Claude's pricing page lists Pro at $17 a month billed annually or $20 billed monthly, and says Claude Code is included in all paid plans. Check the pricing page before you buy, since plans change.

If you want your Flutter team set up with Claude Code and the guardrails that keep agent output shippable, or need an AI feature built into your app, see my Flutter AI development service or get in touch.

Afaq Zahir

Written by

Afaq Zahir

Flutter mobile product engineer with 4+ years shipping 20+ apps to the App Store and Google Play. Led Flutter teams at Metasense and Apptex.

GitHub ↗LinkedIn ↗Last reviewed
Book a call