r/swift • • 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

20 comments sorted by

28

u/tevelee 13d ago • Heartwarming

6

u/flowvi_be 13d ago

Yup, Paul’s skill is quite good. Also not a bad idea to combine* it with a SwiftUI skill or at least a couple of examples of observability or when/how data loading affects view updates etc.

-3

u/CharlesWiltgen 12d ago

For anyone seeking a batteries-included solution, the skills/agents/tools in Axiom "know" how to invoke whatever other context is needed for the concurrency task or review. It covers Swift versions through 6.4.4.

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.

-2

u/Deliere-Ladyl53 13d ago

that zero compiler warning constraint is smart, otherwise it just leaves a mess for you to clean up later

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

-1

u/ElectronicGarbage246 13d ago

Really? Last time I used Gemini to conduct Claude Code directions because Gemini was so much better

2

u/rursache Expert 13d ago

gemini was never better than anything lol

claude is currently #1 at coding all around. the tooling around it is also much better

-1

u/rhysmorgan iOS 12d ago

It absolutely isn’t. Opus 5.5 rules the roost right now. Even when spouting its horrid Claude-isms, the code output of Opus 5 was still better than that of OpenAI’s models.

1

u/AnotherThrowAway_9 12d ago

right cause codex has no problems using Swift 6.4 while opus struggles with basic async await.

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/rursache Expert 13d ago

then when it build the app it will see the errors and fix them. what’s the hold up? this is the most basic dev loop which is already solved for months

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:

  • Swift 6 language mode, strict concurrency complete
  • whether default actor isolation is MainActor (new Xcode 26 projects have it on)
  • approachable concurrency on/off, so it knows nonisolated async funcs run on the caller's actor and @concurrent is how you move work off it

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.

3

u/rhysmorgan iOS 12d ago

You absolutely do not need to tell Claude anything like that. It doesn’t do anything. It’s not gonna act like junior by default, but be tricked into being an expert just by saying “you’re a hyper expect, senior staff/principle level Swift engineer”