A mobile app project is a token-hungry place for an agent. Build logs from Xcode and Gradle run to thousands of lines, test output is long, and a Flutter or React Native codebase has many small files to read. Anthropic’s cost guide puts one fact at the center: “Claude Code sends your full conversation with every request.” Everything that lands in the conversation is paid for again on each turn.
This post covers the habits and files that cut that cost, with skills at the center. For the broader skills setup, see Claude Code skills and subagents for mobile.
Measure first
Two commands show where tokens go:
/contextshows what fills the context window right now./usageshows the session’s usage. Anthropic says that on subscription plans it can also break usage down by skills, subagents, plugins and MCP servers and offer recommendations.
For scale, Anthropic reports enterprise use averages “around $13 per developer per active day and $150-250 per developer per month”, with costs “below $30 per active day for 90% of users.” Check your own numbers before and after each change below. For budgeting a whole app, see the cost to build an app with Claude Code.
1. Move CLAUDE.md content into skills
CLAUDE.md loads into every session. Skills do not. Anthropic’s skills docs say “Unlike CLAUDE.md content, a skill’s body loads only when it’s used, so long reference material costs almost nothing until you need it.”
The cost guide gives the target: “Aim to keep CLAUDE.md under 200 lines.” The memory docs add that “Longer files consume more context and reduce adherence.”
A good split for an app:
| Keep in CLAUDE.md | Move to a skill |
|---|---|
| Build and test commands | Release procedure |
| Folder layout in a few lines | Full architecture guide |
| Hard rules (do not touch signing) | Design system and tokens |
| Stack and minimum OS versions | Localization steps, store checklists |
See CLAUDE.md for Flutter for what the short file should hold.
2. Write a codebase overview skill
Exploring the codebase is expensive: Claude reads file after file to learn where things are. Anthropic’s cost guide suggests a “codebase-overview” skill that describes “your project’s architecture, key directories, and naming conventions”, so Claude “gets this context immediately instead of spending tokens reading multiple files.”
---
name: codebase-overview
description: Map of this Flutter app. Use before exploring code or when looking for where something lives.
---
- lib/features/<name>/data|domain|presentation, one folder per feature
- State: Riverpod providers in presentation/<name>_providers.dart
- Shared widgets: lib/core/widgets. Theme tokens: lib/core/theme
- Repositories wrap Firebase; widgets never import firebase_* directly
- Tests mirror lib/ under test/
A layout like feature-first architecture makes this file short, because the pattern repeats.
3. Keep skills themselves lean
Skills also have a cost, just a smaller one:
- Each auto-invocable skill’s name and description sits in context on every turn. Anthropic says the combined description is “truncated at 1,536 characters in the skill listing”, so short is better anyway.
- Once invoked, a skill “enters the conversation as a single message and stays there across later turns.”
- After compaction, Claude Code re-attaches “the first 5,000 tokens of each” invoked skill, within a “combined budget of 25,000 tokens.”
So keep SKILL.md focused. Anthropic recommends “Keep SKILL.md under 500 lines. Move detailed reference material to separate files.” Use paths so a skill only activates for matching files, and disable-model-invocation: true for manual skills like a release; Anthropic notes that with it set, the “Description not in context.”
4. Send verbose work to a subagent
Build and test logs are the biggest single waste on app projects. Anthropic’s advice is to delegate “Running tests, fetching documentation, or processing log files” to subagents “so the verbose output stays in the subagent’s context while only a summary returns to your main conversation.”
---
name: build-runner
description: Runs builds and tests and reports only errors. Use for flutter build, flutter test or xcodebuild.
tools: Bash, Read
model: haiku
---
Run the requested command. Return only the failing tests or the first compiler errors with file and line.
The subagent docs list “Control costs by routing tasks to faster, lower-cost models like Haiku” as a benefit, and the cost guide suggests model: haiku for simple subagent tasks. One warning: Anthropic says agent teams use “approximately 7x more tokens”, so one helper is cheap and a crowd is not.
5. Trim output with hooks
A hook can cut output before Claude sees it. Anthropic’s cost guide shows a PreToolUse hook that trims test output to the last 100 lines, and describes a hook that greps a 10,000-line log, “reducing context from tens of thousands of tokens to hundreds.” For a Flutter project, a hook that filters flutter test output to failures does the same job. See Claude Code hooks for Flutter.
6. Prefer CLI tools and fewer MCP servers
Anthropic recommends “Prefer CLI tools” such as gh over servers that add tool definitions. MCP tool definitions are “deferred by default”, but each server still adds overhead. Use /mcp to disable servers you are not using in a session. Code intelligence plugins also help, since Claude can jump to a definition instead of reading files to find it.
7. Session habits
The free wins:
/clearbetween unrelated tasks. Anthropic notes “/clearcosts nothing.”/compact Focus on ...when you want to keep the thread but drop detail.- Plan mode (Shift+Tab) before big changes, so a wrong direction costs one plan, not a pile of edits.
- Specific prompts. Vague requests make Claude explore.
- Model and effort. Anthropic says “Sonnet handles most coding tasks well and costs less than Opus”, and thinking tokens “are billed as output tokens”, so lowering
/efforton simple work saves output.
A checklist for your app repo
- CLAUDE.md under 200 lines.
- A codebase overview skill.
- Procedures moved to skills, manual ones marked with
disable-model-invocation. - A build and test subagent on a small model.
- A hook that trims test output.
- Unused plugins and MCP servers disabled.
MobileKit’s Flutter skills follow this split, with a short CLAUDE.md and the long guides in skills.
Sources read on the day this post was written: Claude Code: Manage costs, Claude Code: Skills, Claude Code: Subagents and Claude Code: Memory and CLAUDE.md.