compose-recomposition-performance

compose-recomposition-performance is a skill for Claude Code, Codex from ashtanko/compose-android-template. It costs 78 tokens per session (730 once invoked), scanned A, original, MIT.

A routing guide for investigating Jetpack Compose recomposition performance. Recomposition is Compose running composable code again after relevant state or input changes.

In plain words
What is it for?
Use it to investigate compiler reports, recomposition counts, Layout Inspector results, unstable parameters, frame-rate state reads, and cross-phase state updates.
Why use it?
It helps identify whether slow or excessive updates come from unstable parameters, state read in the wrong rendering stage, or state written across stages. It then points to the focused guide for the suspected cause.

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/ashtanko/compose-android-template/compose-recomposition-performance
Any agent
npx skills add ashtanko/compose-android-template --skill compose-recomposition-performance
Clone the repo
git clone --depth 1 https://github.com/ashtanko/compose-android-template

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 compose-recomposition-performance

README.md
[![agentmods](https://agentmods.dev/badge/skills/ashtanko/compose-android-template/compose-recomposition-performance.svg)](https://agentmods.dev/skills/ashtanko/compose-android-template/compose-recomposition-performance)
Your own site
<a href="https://agentmods.dev/skills/ashtanko/compose-android-template/compose-recomposition-performance"><img src="https://agentmods.dev/badge/skills/ashtanko/compose-android-template/compose-recomposition-performance.svg" alt="Measured on agentmods" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 730 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.00078 $0.00730
Opus 5 $0.00039 $0.00365
Sonnet 5 $0.00016 $0.00146
Haiku 4.5 $0.00008 $0.00073

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

Security

Grade A, and why

compose-recomposition-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 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.

.agents/skills/compose-recomposition-performance/SKILL.md · 56 lines

How it starts

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

Compose recomposition performance

Router only — deep fixes live in focused skills below.

Three axes

  1. Parameter stability / skipping — can Compose skip this restartable composable; are arguments stable and comparable?
  2. Where State is read — is frame-rate State read during composition vs layout/draw?
  3. Back-writing across phases — does a later phase write snapshot state that invalidates an earlier phase? Examples: map/list mutation during composition that re-invalidates the same composition; onSizeChanged (layout phase) writing state read by a sibling in composition.

Axes 2 and 3 often overlap (a sibling reading measured size in composition is both a deferred-read violation and a layout → composition back-write). Axis 1 is independent.

Route here → focused skill

Primary suspicion Next skill
Skipping, unstable params, compiler/composables.txt churn compose-stability-diagnostics
Frame-rate State read phase (composition vs layout/draw) compose-state-deferred-reads
putAll / map rebuild / cross-row height(state) during composition compose-state-deferred-reads — § back-writing
Focus-driven side work in composable body compose-side-effectssnapshotFlow
Evidence for multiple axes Apply matching skills in parallel

Review order

  1. Reproduce one transition (focus move, insertion, scroll) and note which composables recompose.
  2. If counts spike on unchanged lazy items, check back-writing (composition mutations and cross-row measurement) before blaming stability.
  3. If counts climb every frame during scroll/animation, check deferred reads.
  4. If skipping fails despite stable data, check parameter stability and compiler reports.
  5. Re-measure after each fix.

False leads

These changes often do not reduce recomposition count:

Read the full file on GitHub · 56 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 · 56 lines · 78 tokens per session scan A 0578fcfd2f29

Subscribe to this mod's changes

compose-recomposition-performance is a skill published in the GitHub repository ashtanko/compose-android-template (10 stars, last pushed today), licensed MIT. It adds 78 tokens to every session and 730 once invoked, about $0.0004 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-31.

Related

Other skills, from other repositories

sceneview-web

Build 3D and WebXR (AR/VR) experiences in the browser with SceneView for Web — Filament.js (WebGL2/WASM) wrapped in a Kotlin/JS DSL and a plain-JavaScript API on window.sceneview. Use whenever the user asks for "3D in the browser", "a web model viewer", "WebXR AR/VR", or any browser 3D/AR app where the dependency is…

sceneview/sceneview · 147 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

to-plan

Use when one ready GitHub issue or an in-chat task needs a repository-aware implementation plan for a later implementation workflow.

chrisbanes/skills · 27 tokens

compose-animations

Use when writing or reviewing Jetpack Compose motion: visibility enter/exit, animating one property toward a target, color or size transitions, multiple properties from one state, switching composable content, or choosing between AnimatedVisibility, animateAsState, rememberTransition, AnimatedContent, and Crossfade.

chrisbanes/skills · 64 tokens

compose-focus-navigation

Use when writing or reviewing Jetpack Compose UI for TV, keyboard, desktop, accessibility focus, D-pad navigation, FocusRequester, focusProperties, key events, or initial focus behavior.

chrisbanes/skills · 41 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