skills/apple-logarchive/SKILL.md
Query and analyze Apple .logarchive files using the macOS `log show` command
npx skillsauth add benwaffle/skills apple-logarchiveInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert at analyzing macOS/iOS unified log archives (.logarchive bundles) using the /usr/bin/log command.
Activate when the user wants to:
.logarchive fileAsk the user for the path to their .logarchive if not already provided. Verify it exists:
ls <path>.logarchive/Info.plist
Get the first and last timestamps to understand the archive's span:
/usr/bin/log show --style ndjson --no-pager <archive> | head -1
/usr/bin/log show --style ndjson --no-pager <archive> | tail -1
Use /usr/bin/log show with appropriate filters. Always pass --no-pager to prevent interactive mode.
/usr/bin/log show [options] <archive>
| Option | Description |
|---|---|
| --predicate '<filter>' | Filter using NSPredicate or shorthand syntax |
| --style <format> | Output format: default, syslog, json, ndjson, compact |
| --start 'Y-M-D H:m:s' | Show events from this time |
| --end 'Y-M-D H:m:s' | Show events up to this time |
| --last <N>m\|h\|d | Show last N minutes/hours/days |
| --info | Include Info-level messages (excluded by default) |
| --debug | Include Debug-level messages (excluded by default) |
| --source | Annotate with source file and line number |
| --process <name\|pid> | Filter by process name or PID |
| --no-pager | Always use this — prevents interactive less |
| Field | Type | Description |
|---|---|---|
| process (shorthand: p) | string | Process name |
| processIdentifier (shorthand: pid) | integer | Process ID |
| subsystem (shorthand: s) | string | Subsystem (e.g. com.apple.xpc) |
| category (shorthand: c, cat) | string | Category within subsystem |
| composedMessage (shorthand: m) | string | Log message text |
| sender (shorthand: l, lib) | string | Library/sender name |
| logType | log type | default, info, debug, error, fault |
| type (shorthand only) | event type | default, info, debug, error, fault, loss, signpost |
| senderImagePath | string | Full path to sender library |
| processImagePath | string | Full path to process binary |
| threadIdentifier (shorthand: tid) | integer | Thread ID |
| eventType | string | logEvent, signpostEvent, stateEvent, activityCreateEvent, timesyncEvent, lossEvent |
# By process
'p=Safari'
'p=foo|bar' # multiple processes (OR)
# By message content
'"error loading"' # message contains (field omitted = message)
'm:"timeout"' # explicit message contains
'm~/"regex pattern"' # regex match
# By subsystem/category
's=com.apple.xpc'
'c=connection'
# By log level
'type=error'
'type>=error' # error + fault
# Combined
'p=CommCenter AND type>=error'
'pid=100 AND "connection"'
's=com.apple.xpc AND c=connection AND type=error'
'process == "Safari"'
'composedMessage CONTAINS "error"'
'subsystem == "com.apple.xpc" AND category == "connection"'
'logType == "fault" OR logType == "error"'
'composedMessage MATCHES ".*timeout.*"'
'processImagePath ENDSWITH "CommCenter"'
'eventType == "signpostEvent"'
| Operator | Description |
|---|---|
| ==, = | Equality |
| !=, <> | Inequality |
| CONTAINS, : | Contains substring |
| BEGINSWITH, :^ | Starts with |
| ENDSWITH | Ends with |
| LIKE | Wildcard match (? = 1 char, * = 0+ chars) |
| MATCHES, ~/ | Regex match |
| AND, OR, NOT | Logical operators |
--style ndjson when you need to parse or count results programmatically (pipe to wc -l, head, tail, etc.)--style default (or omit) for human-readable output to show the user--style compact for a denser human-readable viewhead -N for initial exploration to avoid overwhelming output — logarchives can contain millions of entries/usr/bin/log show --no-pager --style ndjson --predicate '...' <archive> | wc -l/usr/bin/log show --no-pager --predicate 'type>=error' <archive> | head -50
/usr/bin/log show --no-pager --predicate 'p=SpringBoard' --info --debug <archive> | head -100
/usr/bin/log show --no-pager --predicate '"crash"' <archive> | head -50
/usr/bin/log show --no-pager --start '2026-03-01 10:00:00' --end '2026-03-01 10:05:00' --predicate 's=com.apple.xpc' <archive>
/usr/bin/log show --no-pager --style ndjson --predicate 'type=error' <archive> | wc -l
/usr/bin/log show --no-pager --style ndjson --predicate 'type=fault' <archive> | wc -l
/usr/bin/log show --no-pager --style ndjson <archive> | head -1000 | python3 -c "import sys,json; procs=set(); [procs.add(json.loads(l).get('processImagePath','')) for l in sys.stdin]; print('\n'.join(sorted(procs)))"
--no-pager — interactive pagers hang in non-interactive shellshead on first query — archives can be enormousDefault and Error/Fault level messages are shown; pass --info and/or --debug to include lower-severity messages--start/--end: 'Y-M-D H:m:s' or 'Y-M-D'MATCHES, ENDSWITH, LIKE, or complex nestingeventMessage field in JSON output corresponds to composedMessage in predicatestools
Put formatted content on the macOS clipboard so it renders correctly when pasted into a Slack message composer (bold/italic/lists via HTML, tables via TSV).
development
Generate self-contained HTML slideshows for technical concepts with diagrams, code highlighting, math, and charts
tools
Generate an interactive HTML report of your Claude Code usage (sessions, messages, tokens, active days, streaks, peak times, model usage by day, top projects/tools) by parsing ~/.claude/projects/*.jsonl. Use when the user asks for their Claude stats, usage, activity, streaks, token breakdown, or wants to see how they use Claude over time.
development
Android Debug Bridge (ADB) assistant for inspecting, debugging, and managing Android devices