✳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]

查看原始來源 ↗

更多類似作品