Swift 6 concurrency with AI coding agents: skills, project rules and migration
To give Claude Code, Codex or Cursor Swift 6 concurrency context, install a concurrency skill and write your project's concurrency settings into CLAUDE.md or AGENTS.md. Swift Concurrency Pro by Paul Hudson and Swift Concurrency Expert by Antoine van der Lee are MIT-licensed skills for all three. For migrations in Claude Code, add the Unofficial Swift Concurrency Migration Skill.
Last updated:
Concurrency is where AI-written Swift breaks most visibly. The code looks plausible but fails strict checking with Sendable and actor-isolation errors. Or the agent "fixes" those errors by sprinkling @MainActor, @unchecked Sendable or nonisolated(unsafe) until the compiler goes quiet. That happens for two reasons. Concurrency rules changed quickly between Swift 5.5 and Swift 6.2, and the agent cannot see which settings your target uses unless you tell it. This guide covers three layers: a skill with current concurrency knowledge, project rules that state your settings, and a build loop so the agent checks its changes against the real compiler.
1. Pick a concurrency skill
All entries below are from the SwiftSkills catalog. Install commands are copied from each project's README.
| Skill | Focus (per README / catalog) | Agents (catalog) | Install (from README) | License | Stars (3 Nov 2026) | Last push |
|---|---|---|---|---|---|---|
| Swift Concurrency Expert (AvdLee) | Safe concurrency, performance, Swift 6+ migration; "based on the Swift Concurrency Course" | Claude Code, Cursor, Codex | npx skills@latest add https://github.com/avdlee/swift-concurrency-agent-skill --skill swift-concurrency | MIT | 1,703 | 14 Sep 2026 |
| Swift Concurrency Pro (Paul Hudson) | async/await, actors, Sendable, task groups, @concurrent, structured concurrency, "targeting the mistakes LLMs actually make" | Claude Code, Cursor, Codex, Gemini CLI | Claude Code: /plugin marketplace add twostraws/Swift-Concurrency-Agent-Skill, then /plugin install swift-concurrency-pro@swift-concurrency-agent-skill. Others: npx skills add https://github.com/twostraws/swift-concurrency-agent-skill --skill swift-concurrency-pro | MIT | 579 | 17 May 2026 |
| Swift Concurrency Expert (Thomas Ricouard, Dimillian/Skills) | Reviewing Swift 6.2+ concurrency: actor isolation, Sendable, main-actor annotations, data-race diagnostics | Codex | Copy the swift-concurrency-expert folder into your Codex skills folder (see section 2) | MIT | 4,024 (whole repo) | 29 Mar 2026 ⚠ |
| The Unofficial Swift Concurrency Migration Skill (Kyle Hughes) | The complete Swift Concurrency Migration Guide from swift.org, with its code examples, as a skill | Claude Code | /plugin marketplace add kylehughes/the-unofficial-swift-concurrency-migration-skill, then /plugin install migrating-to-swift-concurrency-skill@the-unofficial-swift-concurrency-migration-skill | MIT | 58 | 7 Dec 2025 ⚠ |
| Swift Modern Patterns Skill (pchelnikov) | Swift 6.0–6.4 language features: concurrency, typed throws, noncopyable types, observation, testing | Claude Code, Codex | npx skills add https://github.com/pchelnikov/swift-6-agent-skill --skill swift-6-agent-skill | MIT | 2 | 23 Sep 2026 |
Stars and last push from the GitHub API, checked on 3 Nov 2026. ⚠ = last push more than 6 months before that date. The Swift Concurrency Expert skill lives in a larger repo, so its star count covers the whole repo. The migration skill's README says it only ships a new release when the upstream guide changes, so its last push can be old.
Which one?
General Swift 6 work in Claude Code, Cursor or Codex: Swift Concurrency Expert (AvdLee) or Swift Concurrency Pro. Install one, not both. Every skill you load takes up context.
Migrating an existing Swift 5 codebase: add the migration skill (Claude Code) so the agent works from swift.org's guide instead of from memory.
Codex-only setup: the Dimillian skill is written for Codex. The two general skills above also work in Codex.
Broader packs that also contain a concurrency skill, such as iOS Agent Skills (rusel95) and iOS Development Agent Skills, are listed under Cursor rules & AGENTS.md.
2. Where the skill files go
| Agent | Where skills are read from | Source |
|---|---|---|
| Claude Code | ~/.claude/skills/ (personal) or .claude/skills/ (project), or via /plugin install | Claude Code skills docs |
| Codex | .agents/skills in the repo, $HOME/.agents/skills for the user | Codex docs: Build skills |
| Cursor and others | npx skills add … lets you pick the agents during install | the skill READMEs above |
Some Codex READMEs still say $CODEX_HOME/skills. If a skill doesn't show up, check the locations above and restart Codex. Details: Codex for iOS development.
3. Tell the agent your concurrency settings
A skill knows Swift concurrency in general. It does not know whether your target uses the Swift 6 language mode, complete checking in Swift 5 mode, or main-actor default isolation. Each of those changes which code compiles. Put the facts in the file your agent reads at startup: CLAUDE.md for Claude Code, AGENTS.md for Codex and Cursor (Claude Code also reads AGENTS.md when there is no CLAUDE.md, per the Claude Code memory docs).
The settings that matter, per swift.org:
| Setting | Where it lives | Source |
|---|---|---|
| Swift 6 language mode (full data-race checking by default) | Xcode: "Swift Language Version" = 6, or SWIFT_VERSION = 6 in an xcconfig. SwiftPM: swift-tools-version: 6.0, or per target .swiftLanguageMode(.v5) to stay on 5 | Enable data-race safety checking |
| Complete checking in Swift 5 mode (as warnings) | Xcode: "Strict Concurrency Checking" = Complete, or SWIFT_STRICT_CONCURRENCY = complete. SwiftPM: .enableUpcomingFeature("StrictConcurrency"). CLI: -strict-concurrency=complete | same page |
| Main actor by default (Swift 6.2) | compiler flag -default-isolation MainActor, SwiftPM .defaultIsolation(MainActor.self). Without it, the default is nonisolated | SE-0466, Swift 6.2 release notes |
async functions run in the caller's context; @concurrent for explicit parallelism (Swift 6.2) | upcoming feature NonisolatedNonsendingByDefault | SE-0461 |
An example block for AGENTS.md / CLAUDE.md. These are example values; replace them with your target's:
markdown
## Swift concurrency
- App target: Swift 6 language mode. Package "NetworkingKit": Swift 5 mode with complete checking (migration in progress).
- App target uses main-actor default isolation (-default-isolation MainActor). Use @concurrent only for work that must leave the main actor.
- Do not silence diagnostics with @unchecked Sendable, nonisolated(unsafe) or @preconcurrency without a comment explaining why it is safe.
- Fix the type at its source (make it Sendable, move it into an actor) before adding annotations at call sites.
- After every concurrency change: build the scheme and run the tests; report the remaining diagnostics.4. Let the agent see the real diagnostics
Concurrency errors depend on settings the agent cannot guess, so the compiler is the final judge. Give the agent a build tool and make it build after each change:
Claude Code: MobileBuildMCP or Apple's
xcrun mcpbridge. Setup: Claude Code for iOS development.Codex:
xcodebuildfirst, then MobileBuildMCP orxcrun mcpbridge. See Codex for iOS development.Full comparison: Best MCP servers for Xcode.
For Swift packages, the agent can run the checks on the command line. Per swift.org: swift build -Xswiftc -strict-concurrency=complete or swift build -Xswiftc -swift-version -Xswiftc 6.
5. Migrating to Swift 6 with an agent
swift.org's migration strategy is iterative, and that suits an agent:
Select a module, ideally an outer one that nothing else depends on, so changes stay local.
Enable stricter checking in Swift 5 mode first. Diagnostics then show up as warnings and the app keeps building.
Address the warnings, starting with unsafe global state and implicitly
Sendabletypes in your own dependencies. The guide says these are often the root cause of many warnings.Switch the module to the Swift 6 language mode, then move on to the next one.
The guide warns that complete checking "can yield many data-race safety issues", with hundreds or even thousands of warnings. Ask the agent for one module or one warning category per session and have it build after every step, not for "migrate the project to Swift 6" in one go.
Sources (checked 3 Nov 2026)
READMEs: AvdLee/Swift-Concurrency-Agent-Skill, twostraws/Swift-Concurrency-Agent-Skill, kylehughes/the-unofficial-swift-concurrency-migration-skill, pchelnikov/Swift-6-Agent-Skill, Dimillian/Skills
GitHub API (stars, license, pushed_at), 3 Nov 2026
swift.org migration guide (source: EnableDataRaceSafety.md and MigrationStrategy.md)
FAQ
- What is the best Swift concurrency skill for Claude Code?
- In the SwiftSkills catalog, the two general options are Swift Concurrency Expert by Antoine van der Lee (1,703 GitHub stars on 3 Nov 2026) and Swift Concurrency Pro by Paul Hudson (579). Both are MIT-licensed and install as Claude Code plugins. For migrations, add the Unofficial Swift Concurrency Migration Skill.
- Why does my AI agent keep adding @MainActor or @unchecked Sendable?
- It is suppressing diagnostics without knowing your settings. Put your language mode, checking level and default isolation in CLAUDE.md or AGENTS.md, forbid unexplained @unchecked Sendable and nonisolated(unsafe), and make the agent build after each change.
- Can Codex migrate my project to Swift 6?
- It can do the work step by step if it can build. Follow swift.org's strategy: one module at a time, complete checking in Swift 5 mode first, then the Swift 6 language mode. Add a concurrency skill in .agents/skills and a build tool such as xcodebuild or MobileBuildMCP.
- Does the agent need to know about Swift 6.2 approachable concurrency?
- Yes, if you use it. Main-actor default isolation (-default-isolation MainActor) and caller-context async functions (NonisolatedNonsendingByDefault) change which code compiles. State them in your project rules so the agent doesn't add unneeded annotations.