A Claude Code mod that shows xcodebuild errors in a live pane and gives Claude the diagnostics instead of the raw build log
TypeScript
0
4 commits
updated Oct 3, 2026
A Claude Code mod that turns xcodebuild and swift build output into a live pane of errors grouped by file, and hands Claude the diagnostics instead of the raw log.

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, between hundreds of lines of SwiftCompile and Copy steps. Claude learns that the build failed and which files failed, but not why.
Measured on Xcode 27.1 with a five-file Swift package and three compile errors:
| Without the mod | With the mod | |
|---|---|---|
| Raw log | 295 lines, 47 KB | the same |
| What Claude reads | 10,039 characters, none of them an error message | 499 characters, every reported error with its file, line and column |

-resultBundlePath to xcodebuild commands that name none, then reads errors, warnings and test failures from the bundle with xcresulttool. The bundle goes to the temporary folder and is deleted once read.file:line:column: error: message, the failed tests, and a count of warnings per file. The transcript keeps the raw output.It also reads swift build and swift test from their log output, and a build piped through tail, xcbeautify or xcpretty is still read from the result bundle.
Xcode ships its own MCP server (xcrun mcpbridge) that lets Claude build, test and read parsed results through Xcode's tools. From Xcode 27 it can run headless, with Xcode closed, after a one-time sudo xcrun mcp-server enable.
If Claude builds through that server, you don't need this mod's log condensing: the MCP already returns structured results. The two solve the problem at different points:
| Apple's Xcode MCP | xcode-build | |
|---|---|---|
| Fixes | Builds Claude runs through the MCP's build tool | Builds Claude runs as xcodebuild or swift build in Bash |
| Setup | Enable in Xcode; headless mode needs sudo and per-agent approval | Clone and point Claude Code at the folder |
| Scope | Builds, tests, previews, project navigation, documentation | Build and test results only |
| Interface | None in Claude Code | A live pane, status line and toast in the terminal |
Use the MCP if you have it set up and Claude uses it to build. This mod helps when Claude reaches for xcodebuild in the shell, which it often does, and it adds the pane either way.
sudo, and approving an agent or folder needs it too. Many company-managed Macs don't give developers admin access.xcodebuild command Claude was already allowed to run, reads the result locally with Apple's xcresulttool, and sends nothing over the network.An MCP server returns data to the model and cannot draw interface in Claude Code. That part is specific to mods.
xcodebuild, xcrun).claude --version and update with claude update.xcresulttool has get build-results (tested on Xcode 27.1). Without it the mod falls back to reading the log.Clone the repository somewhere it can stay:
git clone https://github.com/griches/claude-xcode-mod.git ~/.claude/mods/claude-xcode-mod
cd /path/to/your/xcode/project
claude --plugin-dir ~/.claude/mods/claude-xcode-mod
Add the folder to CLAUDE_CODE_PLUGIN_DIRS in the env block of ~/.claude/settings.json. The path must be absolute; ~ is allowed.
{
"env": {
"CLAUDE_CODE_PLUGIN_DIRS": "~/.claude/mods/claude-xcode-mod"
}
}
If the variable already names other folders, separate them with :. Restart Claude Code afterwards. This also covers sessions started from the desktop app.
Type /xcode-build in a session. If the mod is loaded, the pane opens and says "No builds yet." You only need to do this once, to confirm the install.
There is nothing to switch on. Once the mod is loaded it works by itself whenever Claude runs xcodebuild, swift build or swift test, however you ask:
Build the app and fix any errors.
Each time Claude builds:
/xcode-build, and then shows above the prompt.The commands and keys are only for the pane:
| What | How |
|---|---|
| Open the pane | /xcode-build |
| Forget the builds | /xcode-build clear |
| Show or hide warnings | Focus the pane (ctrl+x then tab), press w |
| Clear from the pane | Focus the pane, press c |
| Close the pane | ctrl+x then x, or click its ✕ |
Each option is a row in Claude Code's config menu (/config).
| Option | Default | Meaning |
|---|---|---|
condense | true | Replace the raw log Claude reads with the parsed diagnostics |
warnings | count | count: Claude reads how many warnings each file has. list: every warning |
resultBundle | true | Add -resultBundlePath to xcodebuild commands that name none |
autoOpen | always | Open the pane always (when a build starts), on failure, or never |
compactRow | true | Draw the verdict in the transcript instead of the raw log |
The mod changes the command Claude runs by appending one flag: -resultBundlePath '<temporary folder>/claude-xcode-build/<id>.xcresult'. An allow rule such as Bash(xcodebuild:*) still matches. A rule that names one exact command will no longer match and Claude Code will ask; set resultBundle to false to leave commands untouched.
git -C ~/.claude/mods/claude-xcode-mod pull
To uninstall, remove the folder from CLAUDE_CODE_PLUGIN_DIRS and delete the clone.
/xcode-build is not a command. The mod did not load. Run claude plugin validate ~/.claude/mods/claude-xcode-mod, check the path in your settings, and check claude --version.autoOpen is not always. Type /xcode-build.claude --debug logs why a hook was skipped.make, fastlane, bash -c or $(...) is not recognised, and neither is one run in the background.xcodebuild invocations is read from its log only.swift build has no result bundle, so a long failing log that Claude Code cuts in the middle can still lose its errors.claude plugin validate .
claude plugin test .
hooks/register.tsx holds the hooks; shell.ts finds builds in a command, xcresult.ts and log.ts read results, and format.ts words them. The fixtures in tests/fixtures.ts are excerpts of real Xcode output.
TypeScript
100.0%
A Claude Code mod that shows xcodebuild errors in a live pane and gives Claude the diagnostics instead of the raw build log
TypeScript
0
4 commits
updated Oct 3, 2026
A Claude Code mod that turns xcodebuild and swift build output into a live pane of errors grouped by file, and hands Claude the diagnostics instead of the raw log.

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, between hundreds of lines of SwiftCompile and Copy steps. Claude learns that the build failed and which files failed, but not why.
Measured on Xcode 27.1 with a five-file Swift package and three compile errors:
| Without the mod | With the mod | |
|---|---|---|
| Raw log | 295 lines, 47 KB | the same |
| What Claude reads | 10,039 characters, none of them an error message | 499 characters, every reported error with its file, line and column |

-resultBundlePath to xcodebuild commands that name none, then reads errors, warnings and test failures from the bundle with xcresulttool. The bundle goes to the temporary folder and is deleted once read.file:line:column: error: message, the failed tests, and a count of warnings per file. The transcript keeps the raw output.It also reads swift build and swift test from their log output, and a build piped through tail, xcbeautify or xcpretty is still read from the result bundle.
Xcode ships its own MCP server (xcrun mcpbridge) that lets Claude build, test and read parsed results through Xcode's tools. From Xcode 27 it can run headless, with Xcode closed, after a one-time sudo xcrun mcp-server enable.
If Claude builds through that server, you don't need this mod's log condensing: the MCP already returns structured results. The two solve the problem at different points:
| Apple's Xcode MCP | xcode-build | |
|---|---|---|
| Fixes | Builds Claude runs through the MCP's build tool | Builds Claude runs as xcodebuild or swift build in Bash |
| Setup | Enable in Xcode; headless mode needs sudo and per-agent approval | Clone and point Claude Code at the folder |
| Scope | Builds, tests, previews, project navigation, documentation | Build and test results only |
| Interface | None in Claude Code | A live pane, status line and toast in the terminal |
Use the MCP if you have it set up and Claude uses it to build. This mod helps when Claude reaches for xcodebuild in the shell, which it often does, and it adds the pane either way.
sudo, and approving an agent or folder needs it too. Many company-managed Macs don't give developers admin access.xcodebuild command Claude was already allowed to run, reads the result locally with Apple's xcresulttool, and sends nothing over the network.An MCP server returns data to the model and cannot draw interface in Claude Code. That part is specific to mods.
xcodebuild, xcrun).claude --version and update with claude update.xcresulttool has get build-results (tested on Xcode 27.1). Without it the mod falls back to reading the log.Clone the repository somewhere it can stay:
git clone https://github.com/griches/claude-xcode-mod.git ~/.claude/mods/claude-xcode-mod
cd /path/to/your/xcode/project
claude --plugin-dir ~/.claude/mods/claude-xcode-mod
Add the folder to CLAUDE_CODE_PLUGIN_DIRS in the env block of ~/.claude/settings.json. The path must be absolute; ~ is allowed.
{
"env": {
"CLAUDE_CODE_PLUGIN_DIRS": "~/.claude/mods/claude-xcode-mod"
}
}
If the variable already names other folders, separate them with :. Restart Claude Code afterwards. This also covers sessions started from the desktop app.
Type /xcode-build in a session. If the mod is loaded, the pane opens and says "No builds yet." You only need to do this once, to confirm the install.
There is nothing to switch on. Once the mod is loaded it works by itself whenever Claude runs xcodebuild, swift build or swift test, however you ask:
Build the app and fix any errors.
Each time Claude builds:
/xcode-build, and then shows above the prompt.The commands and keys are only for the pane:
| What | How |
|---|---|
| Open the pane | /xcode-build |
| Forget the builds | /xcode-build clear |
| Show or hide warnings | Focus the pane (ctrl+x then tab), press w |
| Clear from the pane | Focus the pane, press c |
| Close the pane | ctrl+x then x, or click its ✕ |
Each option is a row in Claude Code's config menu (/config).
| Option | Default | Meaning |
|---|---|---|
condense | true | Replace the raw log Claude reads with the parsed diagnostics |
warnings | count | count: Claude reads how many warnings each file has. list: every warning |
resultBundle | true | Add -resultBundlePath to xcodebuild commands that name none |
autoOpen | always | Open the pane always (when a build starts), on failure, or never |
compactRow | true | Draw the verdict in the transcript instead of the raw log |
The mod changes the command Claude runs by appending one flag: -resultBundlePath '<temporary folder>/claude-xcode-build/<id>.xcresult'. An allow rule such as Bash(xcodebuild:*) still matches. A rule that names one exact command will no longer match and Claude Code will ask; set resultBundle to false to leave commands untouched.
git -C ~/.claude/mods/claude-xcode-mod pull
To uninstall, remove the folder from CLAUDE_CODE_PLUGIN_DIRS and delete the clone.
/xcode-build is not a command. The mod did not load. Run claude plugin validate ~/.claude/mods/claude-xcode-mod, check the path in your settings, and check claude --version.autoOpen is not always. Type /xcode-build.claude --debug logs why a hook was skipped.make, fastlane, bash -c or $(...) is not recognised, and neither is one run in the background.xcodebuild invocations is read from its log only.swift build has no result bundle, so a long failing log that Claude Code cuts in the middle can still lose its errors.claude plugin validate .
claude plugin test .
hooks/register.tsx holds the hooks; shell.ts finds builds in a command, xcresult.ts and log.ts read results, and format.ts words them. The fixtures in tests/fixtures.ts are excerpts of real Xcode output.
TypeScript
100.0%