gradle-build-performance

gradle-build-performance is a skill for Claude Code from rcosteira79/android-skills. It costs 44 tokens per session (692 once invoked), scanned A, original, MIT.

A guide for finding and reducing the time taken by Android builds run with Gradle, the build system used by Android projects. It covers measuring clean and incremental builds and identifying whether configuration, task execution, or dependency loading is slow.

In plain words
What is it for?
Use it to investigate slow local or continuous-integration builds, configure Gradle’s configuration cache, move from kapt to KSP, and test one build optimization at a time.
Why use it?
It replaces guesswork with measurements and helps avoid changes that do not improve build time. It also addresses common causes such as repeated configuration work, cache misses, and work done too early.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the android-skills plugin — 21 skills shipped together

Good fit Use it to investigate slow local or continuous-integration builds, configure Gradle’s configuration cache, move from kapt to KSP, and test one build optimization at a time.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rcosteira79/android-skills/gradle-build-performance
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add rcosteira79/android-skills --skill gradle-build-performance
Clone the repo
git clone --depth 1 https://github.com/rcosteira79/android-skills

Made for: Claude Code.

Or install android-skills, the plugin that ships this one along with the rest of its 21 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gradle-build-performance

README.md
[![agentmods](https://agentmods.dev/badge/skills/rcosteira79/android-skills/gradle-build-performance/github.svg)](https://agentmods.dev/skills/rcosteira79/android-skills/gradle-build-performance)
Your own site
<a href="https://agentmods.dev/skills/rcosteira79/android-skills/gradle-build-performance"><img src="https://agentmods.dev/badge/skills/rcosteira79/android-skills/gradle-build-performance/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gradle-build-performance

Your own site · 80×15
<a href="https://agentmods.dev/skills/rcosteira79/android-skills/gradle-build-performance"><img src="https://agentmods.dev/badge/skills/rcosteira79/android-skills/gradle-build-performance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 692 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00044 $0.00692
Opus 5 $0.00022 $0.00346
Sonnet 5 $0.00009 $0.00138
Haiku 4.5 $0.00004 $0.00069

Measured 10d ago against content hash 54028baac667, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

gradle-build-performance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/android-skills/skills/gradle-build-performance/SKILL.md · 37 lines

How it starts

The opening of the file, as written. The whole thing — 37 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Gradle Build Performance

This reference covers the workflow discipline plus the patterns that move the needle and are easy to get wrong, not the standard knobs (org.gradle.caching, org.gradle.parallel, org.gradle.jvmargs, android.nonTransitiveRClass, kaptksp).

Workflow: measure a baseline (clean + incremental) → ./gradlew assembleDebug --scan (or --profile for a no-upload report) → find the slow phase (configuration / execution / dependency resolution) in the Build Scan timeline → apply one optimization at a time → measure again. Batching changes means you never learn what helped.

Configuration phase — the cheapest wins

  • Configuration cache (org.gradle.configuration-cache=true, AGP 8+) skips the entire configuration phase when inputs are unchanged. Start with org.gradle.configuration-cache.problems=warn, move to fail once clean.
  • No I/O during configuration. A file("version.txt").readText(), a network call, or exec {} at configuration time breaks the configuration cache and slows every build — defer it to execution: providers.fileContents(layout.projectDirectory.file("version.txt")).asText.
  • Lazy task registrationtasks.register("x") { … } (configured only if it's in the execution graph), never tasks.create("x") { … } (eager).
  • Convention plugins, not subprojects {} / allprojects {} — those root-build blocks eagerly evaluate every subproject. Move shared config into convention plugins (see android-skills:android-gradle-logic).

kapt → KSP (mandatory on AGP 9)

KSP is ~2× faster than kapt, and AGP 9 makes the migration mandatory — it has built-in Kotlin support and org.jetbrains.kotlin.kapt is incompatible with it. Migrate to KSP (requires KSP 2.3.1+ on AGP 9; Hilt / Room / Moshi all support it), or fall back to com.android.legacy-kapt (same version as AGP) for annotation processors with no KSP equivalent. See JetBrains' kotlin-tooling-agp9-migration skill for the broader AGP 9 mechanics.

Read the full file on GitHub · 37 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 37 lines · 44 tokens per session scan A 54028baac667

Subscribe to this mod's changes

gradle-build-performance is a skill published in the GitHub repository rcosteira79/android-skills (136 stars, last pushed 16d ago), licensed MIT. It adds 44 tokens to every session and 692 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories