tracing-recompositions-at-runtime

Instruments Jetpack Compose composables with @TraceRecomposition to log per-recomposition diffs in release builds.

1|Updated Jul 6, 2026
One-click install
npx skills add https://github.com/citytexi/team-yg-pesonal-agent --skill tracing-recompositions-at-runtime-citytexi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tracing-recompositions-at-runtime
Source: https://github.com/citytexi/team-yg-pesonal-agent/tree/main/.claude/skills/tracing-recompositions-at-runtime
Command: npx skills add https://github.com/citytexi/team-yg-pesonal-agent --skill tracing-recompositions-at-runtime-citytexi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Layout Inspector only works in debug builds, where Live Literals and the interpreted Compose runtime inflate recomposition counts, so developers cannot confirm stability fixes in release-like builds. This Skill instruments composables with @TraceRecomposition from skydoves/compose-stability-analyzer so per-recomposition diffs (which parameter or state changed, and the value transition) print to logcat under the Recomposition tag in any build, including release-with-debug-symbols. ## Core Features & Use Cases - Runtime recomposition tracing: Apply the compose-stability-analyzer Gradle plugin, annotate suspect composables with @TraceRecomposition(traceStates = true), and read per-recomposition diffs via adb logcat -s Recomposition:D. - Production-safe gating: Gate emission with ComposeStabilityAnalyzer.setEnabled(BuildConfig.DEBUG) or a dedicated BuildConfig.ENABLE_RECOMPOSITION_TRACE flag so production APKs stay silent. - Live heatmap: Pair with the IntelliJ / Android Studio plugin to see color-coded recomposition badges (green under 10, yellow 10-50, red 50+) in the editor gutter. - Use Case: A PriceTicker composable recomposes on every parent tick in release. Annotate it, ship a release-with-debug-symbols build, run the user journey, and read logcat lines showing whether the price parameter changed or strong-skipping equals matched, then confirm the fix drops the count to one entry. ## Quick Start Instrument my PriceTicker composable with @TraceRecomposition, set up the compose-stability-analyzer Gradle plugin with a BuildConfig.DEBUG runtime gate, and show me how to read the recomposition diffs in logcat.

Frequently Asked Questions about tracing-recompositions-at-runtime

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I trace recompositions in a Jetpack Compose release build?▼

Apply the com.github.skydoves.compose.stability.analyzer Gradle plugin, annotate the suspect composable with @TraceRecomposition(traceStates = true), and call ComposeStabilityAnalyzer.setEnabled with a build flag in Application.onCreate. Then run adb logcat -s Recomposition:D to read per-recomposition diffs.

What is the difference between Layout Inspector and @TraceRecomposition?▼

Layout Inspector works only in debug builds, where Live Literals and the interpreted Compose runtime inflate counts. @TraceRecomposition instruments composables at compile time and emits ground-truth per-recomposition diffs to logcat in any build, including release-with-debug-symbols.

Does @TraceRecomposition work in production release builds?▼

The annotation can remain on composables, but ComposeStabilityAnalyzer.setEnabled must resolve to false in production, typically via BuildConfig.DEBUG or a dedicated ENABLE_RECOMPOSITION_TRACE flag. Shipping with tracing enabled adds logcat I/O overhead and can leak parameter values into logs.

Why is my composable recomposing even though the parameter did not change?▼

The logcat diff shows whether the parameter was reported changed or unchanged. An unchanged entry with a parent restart reason means strong-skipping equals matched and the body was skipped, which is the desirable shape; a changed entry points to an unstable type or captured lambda.

When should I not use runtime recomposition tracing?▼

Use Layout Inspector instead for quick debug-build counts, since it is faster to set up. For preventing future regressions, use the stabilityCheck CI gate rather than runtime tracing, and for frame timing or user-perceived performance use Macrobenchmark with Baseline Profiles.