using-efficient-effects

using-efficient-effects is a skill for Claude Code, Codex from skydoves/compose-performance-skills. It costs 145 tokens per session (3,085 once invoked), scanned A, original, Apache-2.0.

A guide to choosing Jetpack Compose effect APIs, which run work in response to composition, key changes, or successful UI updates.

In plain words
What is it for?
Use it to choose among LaunchedEffect, DisposableEffect, SideEffect, rememberUpdatedState, RememberedEffect, and ViewModelStoreScope for subscriptions, callbacks, and row-specific ViewModels.
Why use it?
It helps avoid restarting coroutines unexpectedly, using a coroutine when synchronous work is enough, leaking listeners, or calling an outdated callback.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to choose among LaunchedEffect, DisposableEffect, SideEffect, rememberUpdatedState, RememberedEffect, and ViewModelStoreScope for subscriptions, callbacks, and row-specific ViewModels.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skydoves/compose-performance-skills/using-efficient-effects
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 skydoves/compose-performance-skills --skill using-efficient-effects
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 using-efficient-effects

README.md
[![agentmods](https://agentmods.dev/badge/skills/skydoves/compose-performance-skills/using-efficient-effects/github.svg)](https://agentmods.dev/skills/skydoves/compose-performance-skills/using-efficient-effects)
Your own site
<a href="https://agentmods.dev/skills/skydoves/compose-performance-skills/using-efficient-effects"><img src="https://agentmods.dev/badge/skills/skydoves/compose-performance-skills/using-efficient-effects/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 using-efficient-effects

Your own site · 80×15
<a href="https://agentmods.dev/skills/skydoves/compose-performance-skills/using-efficient-effects"><img src="https://agentmods.dev/badge/skills/skydoves/compose-performance-skills/using-efficient-effects.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 145 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,085 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.00145 $0.03085
Opus 5.5 $0.00058 $0.01234
Sonnet 5.5 $0.00029 $0.00617
Haiku 4.5 $0.00015 $0.00309

Measured 1mo ago against content hash f5f891478683, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

using-efficient-effects 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 1mo 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.

side-effects/using-efficient-effects/SKILL.md · 236 lines

How it starts

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

Using Efficient Effects — pick the cheapest correct effect API

Compose ships three effect APIs by default: LaunchedEffect (coroutine, restarts on key change), DisposableEffect (setup/teardown with a cleanup block), and SideEffect (runs on every successful composition). The skydoves/compose-effects library adds RememberedEffect — a non-coroutine analog of LaunchedEffect. Picking the wrong API wastes a coroutine scope, leaks a listener, or silently drops the latest version of a callback. This skill is the decision tree.

When to use this skill

  • The user asks which effect API to choose, or why a LaunchedEffect restarts unexpectedly.
  • A long-lived LaunchedEffect calls a stale version of a callback that the parent has updated.
  • A non-Compose subscriber (listener, observer, broadcast receiver, GL surface) needs setup at composition entry and teardown on key change or exit.
  • A composable just needs to react to a key change synchronously and a coroutine scope is overkill.
  • A LazyColumn row needs its own ViewModel instance (e.g. one VM per chat row, one VM per feed card) and the parent VM store would leak state across rows.
  • The user is debugging unexpected effect restarts, leaked listeners, or per-frame allocations from SideEffect.

When NOT to use this skill

  • Pure derivation of one State<T> from another — use derivedStateOf. See ../../recomposition/choosing-derivedstateof/SKILL.md.
  • Collecting a flow that originates outside the composition — use collectAsStateWithLifecycle. See ../collecting-flows-safely/SKILL.md.
  • One-shot computation that must survive recomposition without re-running — use remember { ... }, not LaunchedEffect(Unit).

Prerequisites

  • Familiarity with Compose's composition lifecycle: enter, recompose, leave. Effects run after composition commits.
  • Compose UI 1.4+.
  • For RememberedEffect, add com.github.skydoves:compose-effects (latest GA — see https://github.com/skydoves/compose-effects).
  • For ViewModelStoreScope, also depend on com.github.skydoves:compose-effects-viewmodel. Import path: com.skydoves.compose.effects.viewmodel.ViewModelStoreScope.
  • For ViewModelStoreScope with Hilt, also androidx.hilt:hilt-navigation-compose for hiltViewModel().

Read the full file on GitHub · 236 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. 1mo ago First seen · 236 lines · 145 tokens per session scan A f5f891478683

Subscribe to this mod's changes

using-efficient-effects is a skill published in the GitHub repository skydoves/compose-performance-skills (515 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 145 tokens to every session and 3,085 once invoked, about $0.0006 per session on Opus 5.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

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-android

Use when building or fixing a native Android app in Kotlin and Jetpack Compose on the UDF layered architecture — ViewModel/StateFlow, Hilt, Room, Retrofit, coroutines, type-safe Navigation, and the Gradle/AGP surface. NOT shared Android and iOS UI from one Kotlin codebase (that is compose-multiplatform).

ericrisco/rsc-harness · 78 tokens

compose-side-effects

Use when writing or reviewing Jetpack Compose code with LaunchedEffect, DisposableEffect, SideEffect, rememberCoroutineScope, rememberUpdatedState, snapshotFlow, snackbar, navigation, focus requests, analytics, or event Flow collection.

ashtanko/compose-android-template · 49 tokens

compose-state-authoring

Use when writing or reviewing Jetpack Compose code with bare local var in a @Composable, remember { mutableStateOf(...) }, mutableStateListOf/mutableStateMapOf, or @ReadOnlyComposable.

ashtanko/compose-android-template · 46 tokens