Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

axiom-hang-diagnostics

FreeNo executable scriptsNot checked

Use when app freezes, UI unresponsive, main thread blocked, watchdog termination, or diagnosing hang reports from Xcode Organizer or MetricKit

ComeOnOliverby ComeOnOliver★ 67 GitHub stars

About this skill

Hang Diagnostics

Systematic diagnosis and resolution of app hangs. A hang occurs when the main thread is blocked for more than 1 second, making the app unresponsive to user input.

Red Flags — Check This Skill When

Symptom This Skill Applies
App freezes briefly during use Yes — likely hang
UI doesn't respond to touches Yes — main thread blocked
"App not responding" system dialog Yes — severe hang
Xcode Organizer shows hang diagnostics Yes — field hang reports
MetricKit MXHangDiagnostic received Yes — aggregated hang data
Animations stutter or skip Maybe — could be hitch, not hang
App feels slow but responsive No — performance issue, not hang

What Is a Hang

A hang is when the main runloop cannot process events for more than 1 second. The user taps, but nothing happens.

User taps → Main thread busy/blocked → Event queued → 1+ second delay → HANG

Key distinction: The main thread handles ALL user input. If it's busy or blocked, the entire UI freezes.

Hang vs Hitch vs Lag

Issue Duration User Experience Tool
Hang >1 second App frozen, unresponsive Time Profiler, System Trace
Hitch 1-3 frames (16-50ms) Animation stutters Animation Hitches instrument
Lag 100-500ms Feels slow but responsive Time Profiler

This skill covers hangs. For hitches, see axiom-swiftui-performance. For general lag, see axiom-performance-profiling.

The Two Causes of Hangs

Every hang has one of two root causes:

1. Main Thread Busy

The main thread is doing work instead of processing events.

Subcategories:

Type Example Fix
Proactive work Pre-computing data user hasn't requested Lazy initialization, compute on demand
Irrelevant work Processing all notifications, not just relevant ones Filter notifications, targeted observers
Suboptimal API Using blocking API when async exists Switch to async API

2. Main Thread Blocked

The main thread is waiting for something else.

Subcategories:

Type Example Fix
Synchronous IPC Calling system service synchronously Use async API variant
File I/O Data(contentsOf:) on main thread Move to background queue
Network Synchronous URL request Use URLSession async
Lock contention Waiting for lock held by background thread Reduce critical section, use actors
Semaphore/dispatch_sync Blocking on background work Restructure to async completion

Decision Tree — Diagnosing Hangs

START: App hangs reported
  │
  ├─→ Do you have hang diagnostics from Organizer or MetricKit?
  │     │
  │     ├─→ YES: Examine stack trace
  │     │     │
  │     │     ├─→ Stack shows your code running
  │     │     │     → BUSY: Main thread doing work
  │     │     │     → Profile with Time Profiler
  │     │     │
  │     │     └─→ Stack shows waiting (semaphore, lock, dispatch_sync)
  │     │           → BLOCKED: Main thread waiting
  │     │           → Profile with System Trace
  │     │
  │     └─→ NO: Can you reproduce?
  │           │
  │           ├─→ YES: Profile with Time Profiler first
  │           │     │
  │           │     ├─→ High CPU on main thread
  │           │     │     → BUSY: Optimize the work
  │           │     │
  │           │     └─→ Low CPU, thread blocked
  │           │           → Use System Trace to find what's blocking
  │           │
  │           └─→ NO: Enable MetricKit in app
  │                 → Wait for field reports
  │                 → Check Organizer > Hangs

Tool Selection

Scenario Primary Tool Why
Reproduces locally Time Profiler See exactly what main thread is doing
Blocked thread suspected System Trace Shows thread state, lock contention
Field reports only Xcode Organizer Aggregated hang diagnostics
Want in-app data MetricKit MXHangDiagnostic with call stacks
Need precise timing System Trace Nanosecond-level thread analysis

Time Profiler Workflow for Hangs

  1. Launch Instruments → Select Time Profiler template
  2. Record during hang → Reproduce the freeze
  3. Stop recording → Find the hang period in timeline
  4. Select hang region → Drag to select frozen timespan
  5. Examine call tree → Look for main thread work

What to look for:

  • Functions with high "Self Time" on main thread
  • Unexpectedly deep call stacks
  • System calls that shouldn't be on main thread

System Trace Workflow for Blocked Hangs

  1. Launch Instruments → Select System Trace template
  2. Record during hang → Capture thread states
  3. Find main thread → Filter to main thread
  4. Look for red/orange → Blocked states
  5. Examine blocking reason → Lock, semaphore, IPC

**Threa

Full SKILL.md on GitHub

Install axiom-hang-diagnostics in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the axiom-hang-diagnostics skill do?

Use when app freezes, UI unresponsive, main thread blocked, watchdog termination, or diagnosing hang reports from Xcode Organizer or MetricKit

How do I install the axiom-hang-diagnostics skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the axiom-hang-diagnostics skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare axiom-hang-diagnostics with