debugging-recompositions

debugging-recompositions is a skill for Claude Code, Codex from skydoves/compose-performance-skills. It costs 163 tokens per session (3,825 once invoked), scanned A, original, Apache-2.0.

A guide to finding and explaining recompositions in Jetpack Compose, where screen-building code runs again after inputs change. It uses Android Studio’s Layout Inspector and optional runtime tracing to show counts and change reasons.

In plain words
What is it for?
Use it when a screen updates more often than expected, skips less than expected, or becomes slow during scrolling and animation. It helps decide whether to investigate unstable data, remembered lambdas, or state reads in the wrong rendering phase.
Why use it?
It makes invisible repeated work visible and helps distinguish changed, unchanged, uncertain, static, and unknown inputs. It identifies the cause without claiming to fix it automatically.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/skydoves/compose-performance-skills/debugging-recompositions
Any agent
npx skills add skydoves/compose-performance-skills --skill debugging-recompositions
Clone the repo
git clone --depth 1 https://github.com/skydoves/compose-performance-skills

Made for: Claude Code, Codex.

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 debugging-recompositions

README.md
[![agentmods](https://agentmods.dev/badge/skills/skydoves/compose-performance-skills/debugging-recompositions.svg)](https://agentmods.dev/skills/skydoves/compose-performance-skills/debugging-recompositions)
Your own site
<a href="https://agentmods.dev/skills/skydoves/compose-performance-skills/debugging-recompositions"><img src="https://agentmods.dev/badge/skills/skydoves/compose-performance-skills/debugging-recompositions.svg" alt="Measured on agentmods" height="20"></a>
Per session 163 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,825 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00163 $0.03825
Opus 5 $0.00081 $0.01912
Sonnet 5 $0.00033 $0.00765
Haiku 4.5 $0.00016 $0.00382

Measured 4d ago against content hash 29088ac7525f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debugging-recompositions 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 4d 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.

recomposition/debugging-recompositions/SKILL.md · 216 lines

How it starts

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

Debugging Recompositions — make the invisible visible, then map status to action

Recomposition is invisible by default. A composable that re-runs sixty times a second to redraw an animation looks identical in source to one that should re-run zero times when its parent ticks. Three layers of instrumentation make it visible: Layout Inspector recomposition counts and skip counts (Android Studio, debug build), Layout Inspector Argument Change Reasons (Hedgehog and later, per-parameter Changed / Unchanged / Uncertain / Static / Unknown classifications), and runtime @TraceRecomposition from compose-stability-analyzer for release / R8 / real-device measurement.

This skill is the diagnostic layer. It does not fix recompositions; it tells the developer which composable is recomposing and which parameter is responsible. Once the param is named, the fix lives in a sibling skill — stability for unstable types, strong skipping for lambda capture, or phase deferral for state reads in the wrong phase.

When to use this skill

  • The developer says "this should be skipping but it's not" or "this re-runs every time the parent ticks".
  • The developer wants to count recompositions of a specific composable to confirm a fix worked.
  • The developer asks what "Uncertain", "Unknown", "Static", or "Unchanged" means in the Layout Inspector recomposition reasons panel.
  • A PR claims a stability or strong-skipping fix; the reviewer needs to confirm the recomposition actually went away in release.
  • The user mentions "recomposition count", "Layout Inspector", "Argument Change Reasons", "Hedgehog", "@TraceRecomposition", or "why is this recomposing".

When NOT to use this skill

  • The composable is recomposing because of an unstable type — once this skill names the offender, the actual fix is in ../../stability/diagnosing-compose-stability/SKILL.md and ../../stability/stabilizing-compose-types/SKILL.md.
  • The composable is recomposing because of a lambda capture or non-skippable scope — fix work lives in ../using-strong-skipping-correctly/SKILL.md.
  • The composable is recomposing because a state read happened in the wrong phase (Composition vs Layout vs Draw) — fix work lives in ../deferring-state-reads/SKILL.md.
  • The team needs a CI gate against future regressions — use ../../stability/enforcing-stability-in-ci/SKILL.md.

Read the full file on GitHub · 216 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. 4d ago First seen · 216 lines · 163 tokens per session scan A 29088ac7525f

Subscribe to this mod's changes

debugging-recompositions is a skill published in the GitHub repository skydoves/compose-performance-skills (496 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 163 tokens to every session and 3,825 once invoked, about $0.0008 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

claude-android-ninja

Build and migrate Android apps with Kotlin, Jetpack Compose, MVVM, Hilt, Room 3 (KSP, SQLiteDriver, Flow/suspend DAOs), Navigation3, and multi-module Gradle. Use for new projects or modules, Compose screens and ViewModels, Room 3 and RemoteMediator, API 37 / targetSdk migration, Play Integrity client wiring…

Drjacky/claude-android-ninja · 123 tokens

rebrand

Rebrand a fresh clone of android-clean-template into a new app. Asks for the app name, application id, sample-feature and networking decisions, then executes docs/CLONECHECKLIST.md end to end. Use on a fresh un-rebranded clone (application id still com.mkchtv.cleantemplate) or when the user asks to set up, rename, or…

mykola-kichatov/android-clean-template · 85 tokens

sceneview

Build 3D and AR apps with the SceneView SDK in Jetpack Compose, SwiftUI (iOS/macOS/visionOS via SceneViewSwift), Web (Filament.js), Flutter and React Native. Use whenever the user asks for "3D in Compose", "AR with ARCore in Compose", a model viewer, or any cross-platform 3D/AR app where the dependency is…

sceneview/sceneview · 156 tokens

sceneview-ios

Build 3D and AR apps on Apple platforms (iOS, macOS, visionOS) with SceneViewSwift — the SwiftUI wrapper around RealityKit. Use whenever the user asks for "3D in SwiftUI", "AR with ARKit in SwiftUI", a model viewer for iOS, or any Apple-platform 3D/AR app where the dependency is the SceneViewSwift Swift Package from…

sceneview/sceneview · 148 tokens

kotlin-control-flow

Use when writing or reviewing Kotlin branching and control flow: when expressions, guard conditions, sealed type exhaustiveness, smart casts, nullable branching, early returns, or replacing complex if/else chains.

chrisbanes/skills · 44 tokens

roborazzi

Use when working with Roborazzi screenshot tests on Android/JVM — setting up the Roborazzi Gradle plugin, running record/compare/verify tasks, writing tests with captureRoboImage or RoborazziRule, Compose Preview screenshot testing (ComposablePreviewScanner), Compose Multiplatform (iOS/desktop) screenshots, AI-powered…

takahirom/roborazzi · 95 tokens