concurrency-patterns

concurrency-patterns is a skill for Claude Code from rshankras/claude-code-apple-skills. It costs 48 tokens per session (1,413 once invoked), scanned A, original, MIT.

Swift concurrency guidance explains how to run asynchronous work, protect shared data, and connect older callback-based APIs to newer async/await code. Concurrency means doing multiple operations safely without blocking the program.

In plain words
What is it for?
Use it to review async code, choose between tasks and actors, bridge completion handlers, and migrate projects to Swift 6 concurrency rules.
Why use it?
It helps diagnose data races, actor-isolation errors, cancellation problems, and freezes while building or migrating Swift applications.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the apple-skills plugin — 182 skills shipped together , and of apple-skills

Good fit Use it to review async code, choose between tasks and actors, bridge completion handlers, and migrate projects to Swift 6 concurrency rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rshankras/claude-code-apple-skills/concurrency-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add rshankras/claude-code-apple-skills --skill concurrency-patterns
Clone the repo
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills

Made for: Claude Code.

Or install apple-skills, the plugin that ships this one along with the rest of its 182 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for concurrency-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/concurrency-patterns/github.svg)](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/concurrency-patterns)
Your own site
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/concurrency-patterns"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/concurrency-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for concurrency-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/concurrency-patterns"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/concurrency-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,413 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.01413
Opus 5.5 $0.00019 $0.00565
Sonnet 5.5 $0.00010 $0.00283
Haiku 4.5 $0.00005 $0.00141

Measured 2d ago against content hash fd71cbf5e909, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

concurrency-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/swift/concurrency-patterns/SKILL.md · 113 lines

How it starts

The opening of the file, as written. The whole thing — 113 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Swift Concurrency Patterns

Comprehensive guide for Swift concurrency covering async/await, structured concurrency, actors, and the Swift 6.2 "Approachable Concurrency" features. Focuses on patterns that prevent data races and common mistakes that cause crashes.

When This Skill Activates

  • User has data race errors or actor isolation compiler errors
  • User is migrating to Swift 6 strict concurrency
  • User asks about async/await, actors, Sendable, TaskGroup, or MainActor
  • User needs to bridge legacy completion-handler APIs to async/await
  • User is working with Swift 6.2 features (@concurrent, isolated conformances)
  • User has concurrency bugs (actor reentrancy, task cancellation, UI freezes)

Decision Tree

What concurrency problem are you solving?
│
├─ Swift 6 compiler errors / migration
│  └─ migration-guide.md
│
├─ Swift 6.2 new features (@concurrent, isolated conformances)
│  └─ swift62-concurrency.md
│
├─ Running work in parallel (async let, TaskGroup)
│  └─ structured-concurrency.md
│
├─ Thread safety for shared mutable state
│  └─ actors-and-isolation.md
│
├─ Bridging old APIs (delegates, callbacks) to async/await
│  └─ continuations-bridging.md
│
├─ Hangs, slow parallelism, thread-pool problems, profiling
│  └─ concurrency-internals.md
│
└─ General async/await patterns
   └─ See macos/coding-best-practices/modern-concurrency.md for basics

Quick Reference

Pattern When to Use Reference
async let Fixed number of parallel operations structured-concurrency.md
withTaskGroup Dynamic number of parallel operations structured-concurrency.md
withDiscardingTaskGroup Fire-and-forget parallel operations structured-concurrency.md
.task { } modifier Load data when view appears structured-concurrency.md
.task(id:) modifier Re-load when a value changes structured-concurrency.md
actor Shared mutable state protection actors-and-isolation.md
@MainActor UI-bound state and updates actors-and-isolation.md
@concurrent Explicitly offload to background (6.2) swift62-concurrency.md
Isolated conformances @MainActor type conforming to protocol (6.2) swift62-concurrency.md
withCheckedContinuation Bridge callback API to async continuations-bridging.md
AsyncStream Bridge delegate/notification API to async sequence continuations-bridging.md
@TaskLocal Context (IDs, tracing) down the task tree structured-concurrency.md
Atomic / Mutex Sendable wrappers for synchronous hot paths (Swift 6) actors-and-isolation.md
Custom actor executors Bridge existing DispatchSerialQueue synchronization concurrency-internals.md
Swift Concurrency Instrument Diagnose hangs, actor contention, continuation leaks concurrency-internals.md
Strict concurrency migration Incremental Swift 6 adoption migration-guide.md

Read the full file on GitHub · 113 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 113 lines · 48 tokens per session scan A fd71cbf5e909

Subscribe to this mod's changes

concurrency-patterns is a skill published in the GitHub repository rshankras/claude-code-apple-skills (864 stars, last pushed 2d ago), licensed MIT. It adds 48 tokens to every session and 1,413 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-05.

Related

concurrency-patterns compared with skills from other repositories

concurrency-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
concurrency-patternsrshankras/claude-code-apple-skillsSkill8642d agoMITA48Claude Code
swift-expertpersonamanagmentlayer/pclSkill4411d agoApache-2.0A76Claude Code
ios-expertpersonamanagmentlayer/pclSkill4411d agoApache-2.0A64Claude Code
swift6-concurrencymarkdavidgan/apple-dev-skillsSkill52mo agoMITA74Claude Code
ios-swiftui-productJasonColapietro/ios-app-dev-skillsSkill92mo agoMITA67Codex
swiftui-maxDev869/swift-tothemaxSkill74mo agoMITA271Claude Code
swift-languageDev869/swift-tothemaxSkill74mo agoMITA167Claude Code