✳ClaudeModsClaude Code 模组目录
☰
● 0 人在线 · 浏览 0 次
+ 提交作品
← 返回作品集
Reddit 帖子 · 开发与调试 / 工具与集成 / 工作流与 CI

Claude Code Xcode 构建错误提取 mod

作者为 Claude Code 新 mod 系统开发的扩展:把 xcodebuild 失败日志中段的编译器错误提取出来替代截断日志,让 Claude 直接读到错误文件、行号和列号。

GGary_BBGames@Gary_BBGames
已翻译

关于这个 mod

该 mod 针对 Claude Code 调用 xcodebuild 时的一个痛点:Bash 命令输出过长时,Claude Code 只把开头和结尾交给模型,掐掉中间部分,而失败的 xcodebuild 恰好把编译错误放在中间。作者的测试中,一个只有三处编译错误的 Swift 包日志长达 295 行,Claude 收到 10,039 字符却一条错误信息都没有,只知道哪些文件失败、不知道为什么,只能自己 grep 源码并重新过滤构建输出。mod 的做法是给 xcodebuild 命令追加 -resultBundlePath,再用 xcresulttool 从 Xcode 的 result bundle 中读取错误、警告和测试失败,用摘要替换 Claude 读到内容——同一测试中降到 499 字符且包含每条错误的文件、行、列;transcript 仍保留原始输出。另有一个面板按文件分组展示错误、失败测试、警告和近期构建。局限:并未减少修复所需的构建次数(测试中都是三次),但省去了翻日志和搜索;只能看到 Claude 通过 Bash 运行的构建,脚本、make 或 fastlane 内的构建看不到;swift build 只能从日志读取。源码与安装说明见 GitHub(MIT)。

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

参见 https://github.com/griches/claude-xcode-mod 的安装说明
原文 / README

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 did make you fix it more efficiently as it didn't need to go through the logs and search. 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. submitted by /u/Gary_BBGames [link] [comments]

查看原始来源 ↗

更多类似作品