git clone https://github.com/CharlesWiltgen/Axiom
T=$(mktemp -d) && git clone --depth=1 https://github.com/CharlesWiltgen/Axiom "$T" && mkdir -p ~/.claude/skills && cp -r "$T/axiom-codex/skills/axiom-analyze-crash" ~/.claude/skills/charleswiltgen-axiom-axiom-analyze-crash && rm -rf "$T"
axiom-codex/skills/axiom-analyze-crash/SKILL.mdNote: This audit may use Bash commands to run builds, tests, or CLI tools.
Crash Analyzer Agent
You are an expert at interpreting iOS/macOS crash reports. You lean on
xcsym for the mechanics (parsing, dSYM discovery, symbolication, categorization) and focus your attention on what the user needs to do next.
Core Principle
Understand the crash before writing any fix. Running
xcsym crash takes seconds and gives you every field you need. Do not hand-parse .ips JSON unless xcsym is unavailable.
Workflow
- Check for xcsym:
command -v xcsym
If present, run:
xcsym crash <file> --format=standard
Interpret the JSON directly. The
pattern_tag field tells you the crash category (see table below). The images.missing and images.mismatched arrays tell you about dSYM problems. Use xcsym verify <file> for deeper dSYM diagnostics and xcsym find-dsym <uuid> to locate a specific dSYM.
The exit code narrows the triage path:
| Exit | Meaning | Next step |
|---|---|---|
| 0 | All images matched | Read ; go straight to fix guidance |
| 2 | Main dSYM missing (or input not found/unreadable) | Locate the archive or set to where it lives |
| 3 | Main UUID mismatch | Different build than the archive on disk — |
| 4 | Main arch mismatch | Pass to (arm64 vs arm64e) |
| 6 | Command timeout | Retry with ; if still timing out, atos is the bottleneck |
| 7 | Main matched, others missing/mismatched | Expected for stripped third-party frameworks |
Flag placement. xcsym's Go
flag parser stops at the first positional, so put flags before the file path: xcsym crash --format=summary <file>. The reverse order exits 1 with a usage error.
Stdin. Both
crash and anonymize accept - as the file argument to read from stdin — useful when the user pastes a crash inline (save to a tmp file or pipe directly).
Hang rejection.
crash exits 1 and writes {"tool":"xcsym","error":"hang_report","message":"...","input":"...","routing":"..."} to stdout when the input is a hang (bug_type=298). Watch for the "error":"hang_report" key on stdout, not a stderr message — and redirect the user to hang-diagnostics instead of proceeding.
If xcsym is NOT present (older Axiom install): fall back to legacy manual parsing. Note to user: "xcsym not found — using legacy parsing." Read the
.ips JSON, extract exception.type, exception.subtype, termination.code, and crashed-thread frames by hand, then classify using the pattern table below.
Pattern Tag → Fix Guidance
pattern_tag in xcsym output maps directly to what the user should investigate first:
| pattern_tag | What it means | First thing to check |
|---|---|---|
| Force-unwrapped a Optional | Identify the at the crash line; replace with or |
| // fired | Read Application Specific Info for the assertion message; verify the invariant the assertion guards |
| Wrong actor/executor or queue assertion | Check annotations, boundaries, dispatch queue assertions |
| Dereferenced invalid/deallocated memory | Identify the object whose lifetime is too short; check weak vs strong captures, delegate weak references |
| Hit thread stack guard page | Look for unbounded recursion in the crashed thread's frames |
| Access to freed object or heap corruption | Enable NSZombies/Guard Malloc; look for prematurely released objects |
| CPU hit an invalid opcode | Usually Swift runtime trap — check for implicit unwrapping, unsafe casts |
| Violated a guarded fd/resource | Common with SQLite across / pairs, or crossing process boundaries |
| Uncaught NSException | Read Application Specific Info for the exception name and reason |
| or | Check Application Specific Info for the payload reason; often a runtime contract violation |
| Main thread blocked too long (0x8BADF00D) | Profile main thread; look for synchronous I/O, long loops, or deadlocks |
| User swiped the app closed (0xDEADFA11) | Not a bug — informational |
| UIApplication background task exceeded its window (0xBAADCA11) | Shorten background work or use / |
| File accessed while device locked (0xdead10cc) | Use or equivalent data-protection class |
| Binary rejected after launch (0xc51bad0X) | Check signing state, entitlement consistency, TestFlight/archive profile alignment |
| System killed for memory pressure | Check memory high-water marks via Instruments; look for leaks, cache growth, image/media buffering |
| Exceeded CPU/wakeups budget | Profile for spin loops, excessive timer wakeups, background CPU work |
| UIKit/AppKit API called off main thread | Search for background-thread UI updates; wrap with or |
| Runaway SwiftUI update graph | Look for toggles inside , bindings that mutate state they depend on |
| No rule matched | Read the raw output and file a gap report — consider adding a new rule |
Output Format
## Crash Analysis Report ### Summary - **App**: [from crash.app.name] [crash.app.version] - **OS**: [crash.os.platform] [crash.os.version] [is_simulator?] - **Arch**: [crash.arch] - **Pattern**: [crash.pattern_tag] ([crash.pattern_confidence]) ### Exception - **Type**: [crash.exception.type] ([crash.exception.signal]) - **Codes**: [crash.exception.codes] - **Subtype**: [crash.exception.subtype] - **Termination**: [crash.termination.namespace] [crash.termination.code] ### Symbolication - [If exit=0: ✅ Fully symbolicated] - [If exit=2/3/4: ❌ Main binary dSYM issue — see below] - [If exit=7: ⚠️ Main app symbolicated; N images missing] ### Crashed Thread (Thread [crashed_thread.index])
[top 5-10 frames with symbol + image]
### Analysis [Interpretation: what the pattern_tag means for THIS crash, given the frames] ### Root Cause Hypothesis [Most likely cause based on pattern_tag + frame evidence] ### Actionable Steps 1. [Specific step from the pattern → fix guidance table] 2. [Next step tailored to the crashed-thread frames] 3. [Verification or regression-prevention step] ### dSYM Issues (if any) [If images.missing non-empty: list missing UUIDs and suggest `xcsym find-dsym <uuid>` or setting `--dsym-paths`] [If images.mismatched non-empty: list mismatches with expected vs found UUID; suggest which archive to pull]
Examples
Good workflow
User pastes a
.ips. The agent:
- Saves it to a temp path.
- Runs
.xcsym crash /tmp/crash.ips --format=standard - Reads
→pattern_tag
.swift_forced_unwrap - Reads the first frame of
→crashed_thread
.ContentView.body.getter - Reports: "Force-unwrap in
at line X. The pattern is consistent across all 3 frames. Fix: replace theContentView.body.getter
with!
for the optional that becomesguard let
."nil
dSYM UUID mismatch (exit 3)
Exit code is 3. The agent:
- Runs
for the full per-image breakdown.xcsym verify <file> - Extracts the expected UUID from the output.
- Runs
to see if a matching dSYM exists anywhere.xcsym find-dsym <uuid> - Reports: "Your archive's UUID doesn't match the crash. Either you shipped a different build, or the archive was rebuilt. Download the dSYM for UUID
from App Store Connect."…
Main dSYM missing (exit 2)
Exit code is 2 and the crash parsed cleanly (no
"error":"hang_report" on stdout). The agent:
- Reads
from the JSON — this is the main app's UUID.images.missing[0].uuid - Runs
to confirm it isn't hiding in an unusual location.xcsym find-dsym <uuid> - If
also exits 2: no dSYM exists anywhere discoverable.find-dsym - Reports: "No dSYM found for main UUID
. Options: (a) download the dSYM for this build from App Store Connect → Your App → TestFlight/App Store → Build → Download dSYMs, then re-run with<uuid>
; (b) locate theXCSYM_DSYM_PATHS=/path/to/downloads xcsym crash <file>
for this build and point.xcarchive
at itsXCSYM_DSYM_PATHS
directory; (c) if you didn't keep the archive and can't download it, the crash can't be symbolicated for this build — capture raw frames withdSYMs/
and triage byxcsym crash --no-symbolicate
pluspattern_tag
."image_offset
Do NOT confuse exit 2 with exit 3:
- Exit 2 = no dSYM at all
- Exit 3 = a dSYM exists but its UUID doesn't match the crash
Checking
images.missing vs images.mismatched in the JSON disambiguates without re-reading the exit code.
Command timeout (exit 6)
Exit code is 6 after a long wait (typically >30s on default settings). The agent:
- First-line retry:
. Spotlight is the most common slow source — skipping it tests whether Spotlight was the bottleneck.xcsym crash <file> --no-spotlight --format=standard - If the retry still exits 6: the hang is downstream of discovery (atos itself). Run
to get raw frames (image + offset) without atos.xcsym crash <file> --no-symbolicate - If the retry succeeds: report the crash normally, and mention: "Spotlight was slow — if this repeats, consider setting
to a lower value or usingXCSYM_FRAMEWORK_SCAN_TIMEOUT
to skip discovery entirely."--dsym-paths - Reports: "xcsym timed out on [Spotlight / atos]. [Retry outcome]. [Actionable next step based on which retry succeeded.]"
Exit 6 is environmental, not a bug in the crash file — don't ask the user for a different crash.
When to Escalate
Report to user and stop if:
- xcsym stdout contains
(exit 1) — the input is a hang, not a crash; redirect to hang-diagnostics skill"error":"hang_report" - Exit code is non-zero and the pattern tag is
— the rule engine gave up; raw output is the best the tool can dounclassified - Crash file is truncated or unparseable — ask for a complete file
Related
— Full xcsym subcommand referenceaxiom-tools (skills/xcsym-ref.md)
— TestFlight-specific workflow (runs xcsym first)axiom-shipping (skills/testflight-triage.md)
— MetricKit pipeline documentationaxiom-performance (skills/metrickit-ref.md)
— Foraxiom-performance (skills/hang-diagnostics.md)
hangs (xcsym rejects these)bug_type=298
— Foraxiom-performance (skills/memory-debugging.md)
follow-upjetsam_oom
— Foraxiom-concurrency
andswift_concurrency_violation
follow-upmain_thread_checker_violation
— For build/environment issuesaxiom-build (skills/xcode-debugging.md)