rust-concurrency

rust-concurrency is a skill for Claude Code, Codex from heyAyushh/stacc. It costs 40 tokens per session (987 once invoked), scanned A, original, MIT.

A guide to choosing between threads, asynchronous code, and shared-state tools in Rust based on the kind of work and data sharing involved.

In plain words
What is it for?
Use it when handling CPU-heavy or input/output-heavy work, fixing Send or Sync errors, sharing state, or investigating deadlocks.
Why use it?
It helps prevent unsuitable concurrency designs, thread-safety errors, and deadlocks—situations where tasks wait indefinitely for each other.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it when handling CPU-heavy or input/output-heavy work, fixing Send or Sync errors, sharing state, or investigating deadlocks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/heyayushh/stacc/concurrency
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 heyAyushh/stacc --skill concurrency
Clone the repo
git clone --depth 1 https://github.com/heyAyushh/stacc

Made for: Claude Code, Codex.

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 rust-concurrency

README.md
[![agentmods](https://agentmods.dev/badge/skills/heyayushh/stacc/concurrency/github.svg)](https://agentmods.dev/skills/heyayushh/stacc/concurrency)
Your own site
<a href="https://agentmods.dev/skills/heyayushh/stacc/concurrency"><img src="https://agentmods.dev/badge/skills/heyayushh/stacc/concurrency/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 rust-concurrency

Your own site · 80×15
<a href="https://agentmods.dev/skills/heyayushh/stacc/concurrency"><img src="https://agentmods.dev/badge/skills/heyayushh/stacc/concurrency.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 987 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.00040 $0.00987
Opus 5.5 $0.00016 $0.00395
Sonnet 5.5 $0.00008 $0.00197
Haiku 4.5 $0.00004 $0.00099

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

Security

Grade A, and why

rust-concurrency 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 3mo 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.

.agents/skills/rust/concurrency/SKILL.md · 145 lines

How it starts

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

Concurrency

Layer 1: Language Mechanics

Core Question

Is this CPU-bound or I/O-bound, and what's the sharing model?

Before choosing concurrency primitives:

  • What's the workload type?
  • What data needs to be shared?
  • What's the thread safety requirement?

Thinking Prompt

Before adding concurrency:

  1. What's the workload?

    • CPU-bound → threads (std::thread, rayon)
    • I/O-bound → async (tokio, async-std)
    • Mixed → hybrid approach
  2. What's the sharing model?

    • No sharing → message passing (channels)
    • Immutable sharing → Arc<T>
    • Mutable sharing → Arc<Mutex<T>> or Arc<RwLock<T>>
  3. What are the Send/Sync requirements?

    • Cross-thread ownership → Send
    • Cross-thread references → Sync
    • Single-thread async → spawn_local

Decision Flowchart

What type of work?
├─ CPU-bound → std::thread or rayon
├─ I/O-bound → async/await
└─ Mixed → hybrid (spawn_blocking)

Need to share data?
├─ No → message passing (channels)
├─ Immutable → Arc<T>
└─ Mutable →
   ├─ Read-heavy → Arc<RwLock<T>>
   └─ Write-heavy → Arc<Mutex<T>>
   └─ Simple counter → AtomicUsize

Async context?
├─ Type is Send → tokio::spawn
├─ Type is !Send → spawn_local
└─ Blocking code → spawn_blocking

Send/Sync Markers

Marker Meaning Example
Send Can transfer ownership between threads Most types
Sync Can share references between threads Arc<T>
!Send Must stay on one thread Rc<T>
!Sync No shared refs across threads RefCell<T>

Quick Reference

Pattern Thread-Safe Blocking Use When
std::thread Yes Yes CPU-bound parallelism
async/await Yes No I/O-bound concurrency
Mutex<T> Yes Yes Shared mutable state
RwLock<T> Yes Yes Read-heavy shared state
mpsc::channel Yes Optional Message passing
Arc<Mutex<T>> Yes Yes Shared mutable across threads

Read the full file on GitHub · 145 lines

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. 3mo ago First seen · 145 lines · 40 tokens per session scan A ec615ca8787c

Subscribe to this mod's changes

rust-concurrency is a skill published in the GitHub repository heyAyushh/stacc (3 stars, last pushed 2mo ago), licensed MIT. It adds 40 tokens to every session and 987 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-09-03.

Related

rust-concurrency compared with skills from other repositories

rust-concurrency next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rust-concurrencyheyAyushh/staccSkill32mo agoMITA40Claude Code, Codex
rust-checkHmbown/CodeWhaleSkill41ktodayMITA15Claude Code, Codex
stack-trace-rust-probeopensquilla/opensquillaSkill7.2kyesterdayApache-2.0A42Claude Code
hotpath_initpawurb/hotpath-rsSkill1.9k14d agoMITA88Claude Code
memory-safety-patternsrmyndharis/antigravity-skillsSkill2.2k4d agoMITA45Claude Code, Codex
rust-tracingBerriAI/litellmSkill65ktodaynoneA28Claude Code, Codex
rust-errorBerriAI/litellmSkill65ktodaynoneA72Claude Code, Codex