android-coroutine-trace

Diagnose stuck or leaked Kotlin coroutines in Android apps using DebugProbes.

7|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/himattm/skills --skill android-coroutine-trace
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-coroutine-trace
Source: https://github.com/himattm/skills/tree/main/plugins/android/skills/android-coroutine-trace
Command: npx skills add https://github.com/himattm/skills --skill android-coroutine-trace

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Stuck or leaking Kotlin coroutines in Android apps can cause hangs, UI freezes, and memory creep. This Skill provides a practical approach using kotlinx.coroutines-debug and DebugProbes to snapshot active coroutines, identify suspension points, and guide fixes. After validation, remove the temporary instrumentation.

Core Features & Use Cases

  • Install DebugProbes in Application.onCreate to observe coroutine state and suspension points.
  • Dump active coroutines to identify stuck jobs, leaks after navigation, and duplicate launch points.
  • Use cases include diagnosing a launch that never emits, a flow collect that never completes, or a coroutine that continues after leaving a screen.

Quick Start

Install kotlinx-coroutines-debug and DebugProbes in the Application, reproduce the suspect flow, then dump coroutines and review the output.

Frequently Asked Questions about android-coroutine-trace

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

FAQPage Schema
How do I diagnose stuck Kotlin coroutines in my Android app?

To diagnose stuck Kotlin coroutines in your Android app, install DebugProbes in Application.onCreate to observe coroutine state and suspension points, then dump active coroutines to identify the root cause.

Why does a Kotlin coroutine continue running after I leave an Android screen?

A coroutine continuing after screen navigation indicates a leaked job. Dumping active coroutines with DebugProbes helps identify these leaked jobs and duplicate launch points that outlive the ViewModel scope.

How do I find a Kotlin flow collect that never completes in Android?

To find a flow collect that never completes, use kotlinx-coroutines-debug to snapshot active coroutines. This identifies the exact suspension points where the flow is stuck and guides the fix.

Can I use kotlinx-coroutines-debug to fix memory leaks caused by coroutines?

Yes, kotlinx-coroutines-debug can fix memory leaks caused by coroutines. It snapshots active coroutines to identify leaked jobs and suspension points causing memory creep, after which you apply fixes and remove the instrumentation.

What is the best way to inspect suspension points in Android coroutines?

The best way to inspect suspension points in Android coroutines is installing DebugProbes in Application.onCreate. It observes coroutine state and provides dumps to pinpoint exactly where suspending flows are stuck.

When should I remove DebugProbes from my Android application?

You should remove DebugProbes from your Android application after validation is complete. The instrumentation is temporary for diagnosing coroutine leaks and hangs, so remove it once fixes are applied.