Thanks for your interest in making crash debugging less painful for iOS/macOS engineers.
git clone https://github.com/JordanCoin/XcodeLLMToolchain.git
cd XcodeLLMToolchain
swift build
swift test- New crash type detection - See
CrashExplanation.swiftfor the current list - Better @Guide descriptions - The LLM's accuracy depends on these
- More LLDB commands - Anything that helps during debugging
- Tool calling improvements -
CodeMapToolandReadSourceToolare just the start
- Bug fixes
- Documentation improvements
- Test coverage
- Performance optimizations
- UI/menu bar app (there's a separate closed-source app for that)
- Support for non-Apple LLMs (defeats the privacy point)
Check existing issues first. If you're adding something new, open an issue to discuss before writing code.
git checkout -b feature/your-feature-nameFollow the existing code style:
- Swift: Standard Swift conventions, use
@Generablefor any LLM output types - Python: PEP 8, keep LLDB scripts simple
- Keep prompts/instructions minimal - let
@Guidedo the work
# Unit tests
swift test
# Manual testing with crash suite
swift build
lldb .build/debug/swift-crash-suite -- force_unwrap
(lldb) run
(lldb) crash_explain- Clear title describing the change
- Reference any related issues
- Include before/after if it's a behavior change
Sources/
├── XcodeLLMCore/ # Library - this is where most work happens
│ ├── XcodeLLMEngine.swift # Main engine
│ ├── CrashExplanation.swift # @Generable types + Instructions
│ ├── GeneratedCrash.swift # For battle mode
│ ├── LLMClient.swift # Protocol for future backends
│ └── Tools/ # Tool calling
├── XcodeLLM/ # CLI - thin wrapper
└── SwiftCrashSuite/ # Test crashes
lldb/
├── plugin.py # LLDB entry point
├── install.sh # One-liner installer
└── capture_lib/ # Python modules
├── commands.py # crash_explain, memory_explain, explain_here
├── analysis.py # Crash data extraction
├── formatting.py # Output formatting + trimming
├── tools.py # codemap integration
└── utils.py # LLDB helpers
- Add to enum in
GeneratedCrash.swift:
@Generable
public enum CrashType: String {
// ... existing cases
case yourNewType = "your_new_type"
}- Add to
anyOfinCrashExplanation.swift:
@Guide(description: "Category of crash", .anyOf([
// ... existing types
"your_new_type"
]))
public var crashType: String-
Add test case in
SwiftCrashSuite/main.swift -
Test it:
swift build
lldb .build/debug/swift-crash-suite -- your_new_type
(lldb) run
(lldb) crash_explainTools let the LLM take actions during analysis (read files, query codemap, etc).
- Create
Sources/XcodeLLMCore/Tools/YourTool.swift:
import Foundation
import FoundationModels
public final class YourTool: Tool {
public let name = "your_tool_name"
public let description = "What this tool does - be specific"
@Generable
public struct Arguments {
@Guide(description: "What this argument is for")
var someArg: String
}
public init() {}
public func call(arguments: Arguments) async throws -> String {
// Your implementation
return "Result for LLM to use"
}
}- Add to engine in
XcodeLLMEngine.swift:
public init(enableTools: Bool = false) {
self.tools = enableTools ? [ReadSourceTool(), CodeMapTool(), YourTool()] : []
}- Add function in
lldb/capture_lib/commands.py:
def your_command(debugger, command, result, internal_dict):
"""
LLDB command: your_command
Does XYZ.
Usage:
your_command - Basic usage
your_command --json - JSON output
"""
# Implementation- Register in
lldb/plugin.py:
def __lldb_init_module(debugger, internal_dict):
# ... existing commands
debugger.HandleCommand(
'command script add -f plugin.your_command your_command'
)- Use
@Generablefor any struct the LLM outputs - Keep
@Guidedescriptions to one sentence - Prefer structured output over free-form text
- Trim data to fit token limits
- Keep it simple - LLDB scripts should be fast
- Handle errors gracefully (don't crash the debugger)
- Use JSON for data exchange with Swift CLI
- Less is more - the
@Guidedescriptions do most of the work - Be specific about what NOT to do (e.g., "don't invent function names")
- Test with battle mode to catch hallucinations
Open an issue or reach out on Twitter/X.
Every contribution helps iOS/macOS engineers debug faster. Thanks for making that happen.