anr-audit-and-fix
What it does
This skill checks Android code for risks of Application Not Responding freezes, and explains ANR stack dumps. It is for Android developers who see freezes or ANR reports in their app.
When to use it
- ✓When you want to scan Android code for work that blocks the main thread.
- ✓When you have an ANR stack dump or trace and want to know what caused it.
- ✓When Google Play or your crash tool reports ANR errors and you need the likely fix.
Skill link
https://github.com/android/skills/blob/main/performance/anr-audit-and-fix/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Here is an ANR trace from our app. Tell me what caused it and what to fix.”
5 new skills a week. 1 minute to read.
How it works
For code, the skill lists risky calls, proves which thread runs them and whether they really block, then grades each one. For traces, it follows a set trace analysis guide and writes a report based only on the log evidence.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Select the execution path matching the user's request:
1. Path A: Static codebase ANR risk audit
When auditing source files or scanning for thread-blocking operations:
- Follow references/risk_analysis_guide.md step by step: list candidates, prove the executing thread (trace callers when the thread depends on them), prove the call blocks, then attribute and grade. Report only candidates that pass these checks; list the dismissed ones separately with a one-line reason.
- Evaluate off-main-thread mutations of attached Views not merely as crash risks (
CalledFromWrongThreadException), but as Sync Barrier Leak ANR risks with their own proof (off-main execution plus an attached View).
2. Path B: Trace-driven diagnosis and remediation
When analyzing ANR traces or stack dumps:
- Diagnose systematically using references/trace_analysis_guide.md and format the report with references/anr_trace_report_template.md.
- Base findings strictly on log evidence. Propose application fixes only for
APP_DEFECTorAPP_RESOURCE_OVERLOAD(never forEXTERNAL_BOTTLENECK).
FAQ
Does it list every slow call?
No. It reports only risks it can prove, and lists the dismissed ones separately with a short reason.
Will it propose fixes for every ANR?
Only for problems in the app itself. Causes outside the app, such as external bottlenecks, are not given app fixes.
Does it cover crashes and frame drops?
No. Non-ANR crashes, dropped frames and system traces are outside this skill.
Details
Original description by the author
Audits Android codebases for ANR risks and diagnoses ANR stack dumps. Use this skill when scanning Android code for ANR risks or triaging ANR stack dumps. Don't use for non-ANR crashes, dropped frames, general CPU profiling, or Perfetto system traces.
repo: android/skills
Popularity
- GitHub stars
- 10k
- Ranking position
- #11926
- License
- Apache-2.0
- Updated
- 10/29/2026
Comments
- …
More skills from this repository
agp-9-upgrade
10kHelps your agent upgrade an Android app to Android Gradle Plugin 9 and work through its breaking changes. Not for multiplatform projects.
camerax
10kHelps your agent build Android camera features with CameraX, including video recording, hardware controls, ML Kit and Media3 effects.
android-for-cars-parked-apps
10kHelps your agent adapt an Android video, game or browser app to run as a parked app on Android Auto and Android Automotive.
appfunctions
10kHelps your agent find key workflows in an Android app and expose them as AppFunctions that AI agents and voice commands can run.
Similar skills
android-clean-architecture
280kMakes your agent organize Android projects efficiently. It structures the code to make maintenance and new feature development easier.
compose-multiplatform-patterns
280kHelps your agent use Compose Multiplatform and Jetpack Compose patterns in KMP projects, covering state, navigation, theming, and performance.
dart-flutter-patterns
280kMakes your agent write code for Dart and Flutter apps. It uses modern patterns to create robust and manageable apps.