anr-audit-and-fix — Claude Code skill: ANR checks
The anr-audit-and-fix Claude Code skill finds ANR risks in Android projects and examines ANR stack dumps. Run it to inspect blocking calls or investigate an unresponsive app.
Apache-2.0 694 installs ★ 10,691 updated 2026-10-23
npx skills add android/skills --skill anr-audit-and-fix -a claude-codeWhat anr-audit-and-fix does
The skill checks Android source code for calls that can stall a thread, then examines ANR traces. For a code audit, it traces the execution thread and verifies that a call blocks before grading a candidate. Rejected candidates appear separately with a brief reason.
For trace analysis, findings must come from log evidence, and the report follows a supplied template. Suggested app changes are limited to app defects and app resource overload; external bottlenecks do not receive app-level fixes. This skill does not cover other crashes, dropped frames, general CPU profiling, or Perfetto system traces.
What it helps with
- find calls that can block in Android code
- trace which thread executes a call
- diagnose an ANR stack dump from log evidence
- separate app defects from external bottlenecks
Example prompts for the agent
- Audit this Android code for ANR risks and identify calls that block a thread.
- Analyze this ANR stack dump and write up the findings.
- Check whether off-main-thread changes to attached Views could cause a Sync Barrier Leak ANR.
How to install anr-audit-and-fix
1Skills CLI (Vercel)
npx skills add android/skills --skill anr-audit-and-fix -a claude-code2Manually: put the files in place
~/.claude/skills/anr-audit-and-fix/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/anr-audit-and-fix/
1Skills CLI (Vercel)
npx skills add android/skills --skill anr-audit-and-fix -a codex2Manually: put the files in place
.agents/skills/anr-audit-and-fix/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add android/skills --skill anr-audit-and-fix -a cursor2Manually: put the files in place
.cursor/skills/anr-audit-and-fix/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install android/skills performance/anr-audit-and-fix/SKILL.md2Manually: put the files in place
.github/skills/anr-audit-and-fix/SKILL.md1Skills CLI (Vercel)
npx skills add android/skills --skill anr-audit-and-fix -a gemini-cli2Platform CLI
gemini skills install https://github.com/android/skills --path performance/anr-audit-and-fixManually: put the files in place
.devin/skills/anr-audit-and-fix/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add android/skills --skill anr-audit-and-fix -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about anr-audit-and-fix
How do I install anr-audit-and-fix in Claude Code?
Run npx skills add android/skills --skill anr-audit-and-fix -a claude-code. The skill file is at ~/.claude/skills/anr-audit-and-fix/SKILL.md.
What does anr-audit-and-fix do?
It audits Android code for ANR risks and investigates ANR traces using log evidence. The audit separates confirmed candidates from those it dismisses.
Which issues can anr-audit-and-fix analyze?
It handles ANRs, not unrelated crashes, dropped frames, general CPU profiling, or Perfetto system traces.
Source text
SKILL.md · Apache-2.0
--- name: anr-audit-and-fix description: 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. license: Complete terms in LICENSE.txt metadata: author: Google LLC last-updated: '2026-11-10' keywords: - Android - ANR - Application Not Responding - responsiveness - main thread - ANR stack dump - Sync Barrier Leak --- 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](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](references/trace_analysis_guide.md) and format the report with [references/anr_trace_report_template.md](references/anr_trace_report_template.md). - Base findings strictly on log evidence. Propose application fixes **only** for `APP_DEFECT` or `APP_RESOURCE_OVERLOAD` (never for `EXTERNAL_BOTTLENECK`).
© Google LLC · Apache-2.0 · android/skills