/peekie:peekie-attachmentsfrom peekie
Extracts test attachments (screenshots, logs, blobs) from Xcode .xcresult bundles to a directory and prints a manifest with metadata. Use when debugging test failures or inspecting attached files.
Ships in peekie. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
peekie attachmentsExtract attachment files from a .xcresult bundle to a directory and print a manifest with qualifiedName, file path, content type, and failure-association metadata.
peekie attachments <xcresult-path> --output-dir <dir> [flags]
--output-dir is required — there is no inspect-only mode; the underlying xcrun xcresulttool export attachments always writes files to disk.
| Flag | Default | Notes |
|---|---|---|
<xcresult-path> | — | Required positional. Path to the .xcresult bundle. |
--output-dir <dir> | — | Required. Directory where attachment files are extracted. Created if missing. |
--test-id <id> | — | Limit extraction to a single test. Accepts the bare identifier (ExampleSUITests/foo()) or the full test://com.apple.xcode/... URL. This DOES filter files on disk — xcresulttool only writes that test's attachments. |
--include <statuses> | all 6 (success,failure,expectedFailure,skipped,mixed,unknown) | Comma-separated test statuses. Filters the printed JSON / list manifest only — does NOT filter files on disk. |
--format json|list | json | Output format for the printed manifest. |
-v, --verbose | false | Debug-level logging to stderr. |
--format json (default)Flat array, sorted by qualifiedName:
[
{
"qualifiedName": "ExamplesTests / ExampleSUITests / failureWithAttachment()",
"name": "Failure context.txt",
"exportedFileName": "DA864376-…-FDD5.txt",
"path": "/tmp/att/DA864376-…-FDD5.txt",
"contentType": "text/plain",
"isAssociatedWithFailure": false,
"repetitionNumber": 1,
"configurationName": "Test Scheme Action"
},
{
"qualifiedName": "ExamplesTests / ExampleSUITests / withAttachment()",
"name": "Calculation Result.txt",
"exportedFileName": "67676173-…-396.txt",
"path": "/tmp/att/67676173-…-396.txt",
"contentType": "text/plain",
"isAssociatedWithFailure": false,
"repetitionNumber": 1,
"configurationName": "Test Scheme Action"
}
]
qualifiedName matches the same convention as peekie tests — / joined, module → suite path → test name.name is the human-facing attachment label (often the original filename or XCTAttachment name).exportedFileName is the UUID-based filename xcresulttool actually writes to disk.path is <output-dir>/<exportedFileName> — ready to read or upload.contentType is derived from the extension via UTType.preferredMIMEType — null when exportedFileName has no extension.isAssociatedWithFailure is set by XCTAttachment.lifetime = .deleteOnSuccess or an equivalent explicit hint; it's often false even for attachments captured inside a failing test (see "Don't" below).repetitionNumber is 1 unless test repeated under retry-on-failure.--format listGrouped by test (one section per qualifiedName, one line per attachment). Good for terminal scanning.
peekie attachments Tests.xcresult --output-dir "$CI_ARTIFACTS/attachments"
--include failure on its own leaves every attachment from every test in --output-dir. To get a directory tree where each failing test has its own subdir of attachments, use the bundled helper script:
scripts/extract-failure-attachments.sh Tests.xcresult /tmp/failed-attachments
The script (in this skill's scripts/ directory) iterates over failing test IDs, sanitizes each into a safe directory name, and runs peekie attachments --test-id per failure into its own subdirectory. Inline equivalent — useful if you want to inspect or adapt the loop:
OUT=/tmp/failed-attachments
mkdir -p "$OUT"
peekie tests Tests.xcresult --format json --include failure \
| jq -r '.modules[].tests[].qualifiedName | split(" / ") | .[1:] | join("/")' \
| while read -r id; do
slug=$(printf '%s' "$id" | tr '/()' '___' | tr -s '_')
mkdir -p "$OUT/$slug"
peekie attachments Tests.xcresult --output-dir "$OUT/$slug" --test-id "$id" --format json >/dev/null
done
Two non-obvious bits:
jq expression drops the leading module segment from each qualifiedName. xcresulttool --test-id (which peekie attachments invokes under the hood) expects the bare suite-path identifier (e.g. ExampleSUITests/failureWithAttachment()), not the module-prefixed full path. Passing the prefixed form returns Error: Failed to find test with the provided identifier.manifest.json directly into --output-dir. Reusing one shared $OUT across iterations fails on the second --test-id with Failed to generate manifest.json: file already exists — that's why both the script and the inline loop create a per-test subdirectory.Apple's own xcresulttool export attachments --only-failures looks like it should solve this, but it filters on isAssociatedWithFailure — a field that's frequently false even for attachments recorded inside a failing test (only set by XCTAttachment.lifetime = .deleteOnSuccess or the equivalent explicit hint). So --only-failures often returns an empty manifest. The per---test-id loop above is what actually surfaces "attachments belonging to failing tests".
peekie attachments Tests.xcresult \
--output-dir /tmp/att \
--test-id "ExampleSUITests/failure()"
cp/scp/uploadpeekie attachments Tests.xcresult --output-dir /tmp/att | jq -r '.[].path'
peekie attachments Tests.xcresult --output-dir /tmp/att --include failure
Use this when you want the JSON narrowed but don't care that the directory holds everything. For a clean directory, use the per---test-id loop above.
--output-dir — it's required. There's no inspect-only mode.--include failure to leave only failure-test attachments on disk — it only filters the printed manifest. Use --test-id per test for a clean disk subset.xcrun xcresulttool export attachments --only-failures as a shortcut — it filters on isAssociatedWithFailure, which is rarely set unless you've used XCTAttachment.lifetime = .deleteOnSuccess. Use the per---test-id loop instead.--test-id and --include together expecting them to AND-combine on disk — --test-id scopes extraction to one test, --include filters the printed JSON manifest. They operate at different layers; combining them is fine but rarely useful.xcrun xcresulttool export attachments and parse the resulting manifest by hand — peekie attachments already runs that and adds contentType and qualifiedName.peekie-tests — test results, including the qualifiedName values you'd pass to --test-id. Also supports --attachments export --attachments-to <dir> to inline attachments inside the test JSON.peekie (umbrella) — cross-subcommand recipe for saving failure attachments as CI artifacts.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub dodobrands/peekie --plugin peekie6 skills in this plugin
/peekieRoute Xcode `.xcresult` parsing work to the right `peekie` subcommand. Trigger on broad bundle intent — e.g. "look at this xcresult: /tmp/Build.xcresult", "parse this test bundle", "what's in this build artifact?", "can you summarize this `.xcresult`?", "I have an xcresult from CI, what should I do with it?". Five dedicated sub-skills (`peekie-tests`, `peekie-warnings`, `peekie-errors`, `peekie-coverage`, `peekie-attachments`) cover the data axes; this umbrella picks the right one./peekie-coverageExtract code coverage from an Xcode `.xcresult` bundle via `peekie coverage`. Trigger when the user asks about coverage from a bundle — e.g. "what's the coverage in /tmp/Tests.xcresult?", "coverage per module please", "covered vs total lines for each file", "give me overall coverage as a percentage I can print in CI", "is coverage above 70%?", "JSON of coverage per file for a custom report". One subcommand, hierarchical modules → files JSON with covered/total line counts./peekie-errorsList build errors from an Xcode `.xcresult` bundle via `peekie errors`. Trigger when the user asks about why a build broke or wants structured error output — e.g. "why is the build broken in /tmp/Build.xcresult?", "show me build errors from this CI run", "how many errors are there in this xcresult?", "give me JSON of compilation errors I can pipe to jq", "fail my CI step if errors > 0", "first three errors with file and line, please". One subcommand, flat sorted array per error, same shape as `peekie warnings`./peekie-testsParse and format test results from an Xcode `.xcresult` bundle via `peekie tests`. Trigger when the user asks anything about test outcomes from a bundle — e.g. "did the tests pass in /tmp/Tests.xcresult?", "show me failing tests from this build", "what tests failed?", "which tests were skipped?", "give me a JSON list of every test in this xcresult", "generate a SonarQube test report from this bundle", "I need the fully-qualified names of failing tests for CI", "extract test results plus their attachments". Covers the `tests` subcommand exhaustively: filtering by status, device labels for matrix runs, attachments export, sonar generic-test format./peekie-warningsList build warnings from an Xcode `.xcresult` bundle via `peekie warnings`. Trigger when the user asks about warnings — e.g. "what warnings did this build produce?", "show me deprecation warnings in /tmp/Build.xcresult", "group warnings by type", "how many warnings are in this xcresult?", "find all `#warning(...)` markers in my build", "give me JSON of build warnings I can pipe to jq", "are there any actor-isolation warnings?". One subcommand, flat sorted array per warning. Note Apple's `#warning(...)` directives are mis-tagged as `Swift Compiler Error` but appear here, not in `peekie errors`.Other plugins' skills for the same job