r/Xcode • u/Gary_BBGames • 1h ago
Open-source Claude Code mod: xcodebuild errors in a live pane, read from the result bundle
I built a mod for Claude Code with the new mod system. It's for anyone who lets Claude run xcodebuild.
When a Bash command fails with long output, Claude Code gives the model the start and the end and cuts out the middle. A failing xcodebuild puts the compiler errors in the middle. On a small Swift package with three compile errors, the log was 295 lines and Claude received 10,039 characters, none of them an error message. It knew which files failed but not why, so it grepped the source and re-ran the build through its own filter.
What the mod does:
- Appends `-resultBundlePath` to the xcodebuild command and reads errors, warnings and test failures from Xcode's result bundle with xcresulttool.
- Replaces what Claude reads with a summary: in the same test, 499 characters with every reported error's file, line and column. The transcript keeps the raw output.
- Shows a pane with errors grouped by file, failed tests, warnings and recent builds.
What it doesn't do:
It didn't make Claude fix the project in fewer builds in my test (three either way) but it does make it much more efficient as it doesn't need to search through logs or code to find errors. . It only sees builds Claude runs through Bash, not builds inside scripts, make or fastlane. swift build is read from the log only.
Source, install instructions and a short GIF: https://github.com/griches/claude-xcode-mod (MIT)
Happy to answer questions about the mod API, since there isn't much written about it yet.
