r/swift • u/ElectronicGarbage246 • 13d ago
Anyone using Claude Code with Swift 6.2 lately?
Hey folks,
Is anyone here using Claude Code for work? I remember at the start of the year it struggled to understand Swift 6.2's parallelism and concurrency concepts. I was really disappointed and ended up fixing a lot of things manually.
What’s the situation like today?
12
Upvotes
28
u/tevelee 13d ago •
Use a skill like https://github.com/twostraws/Swift-Concurrency-Agent-Skill or https://github.com/AvdLee/Swift-Concurrency-Agent-Skill
4
u/mosaic_hops 11d ago
Claude can’t handle sytems level stuff at all. Lots of its output has deadlocks and race conditions. It’s getting better but you still have to be really careful with it.
7
u/zzunkie 13d ago
Yeah, I use Claude Code (and Codex) every day for work building a native macOS app, with swift-tools-version 6.2 and no language mode override so the whole thing compiles in Swift 6 mode with full strict concurrency checking. The repo's instructions file for agents says product targets have to build with zero compiler warnings and CI fails on a single warning, so any concurrency warning the agent introduces has to be fixed before it lands. That same file also tells agents to fix a cause where it lives in the shared rule or path instead of just patching the one case that showed it.
3
u/DrDeniseWilliams 11d ago
it's a lot better than it was, but concurrency is still where it slips. biggest help is putting your concurrency rules in the agent instructions file (what's MainActor, no unchecked Sendable, no random detached tasks) so it stops guessing. and always let the compiler be the judge. if it fixes a warning by sprinkling nonisolated or @unchecked Sendable everywhere, that's usually a smell.
2
u/razorfox 13d ago
It can be a lot better with Swift but It’s not actually bad.
2
u/clichekiller 12d ago
Yes and it performs very well. I have a set of structured skills with code samples, patterns, and other conventions. I use linters, regard, agents, and tests to confirm the code is properly written. The end result is I have an application that receives 5 to 6 new features a day, and no bugs, which is what really shocked me.
0
u/AnotherThrowAway_9 13d ago
Codex is better still
2
u/crookedstreetmap 13d ago
I feel like it's gotten better at understanding async/await, but I'd still double-check anything involving actors or shared mutable state. It can write code that looks perfectly fine until the compiler starts complaining.
1
u/jacobs-tech-tavern 7d ago
Opus 5.5 is basically AGI at this point, I think it should be fine. Even skills are mostly unnecessary at this point
0
u/ThanhDongNguyen 13d ago
I think a lot depends on telling it your exact setup, because Swift 6.2 code looks different depending on the build settings. Put this in CLAUDE.md:
Then make it build with xcodebuild (or swift build) after every change and fix the real compiler errors instead of guessing. Otherwise I think the easy "fix" is sprinkling @MainActor or Task.detached to make errors go away, so that's what I'd watch for in review.
-6
u/KingPonzi 13d ago
Use Sosumi - https://sosumi.ai and tell Claude it’s the SME on Swift.