r3bl-open-core: Skill for Claude Code

.agents/skills/concurrency-safety/SKILL.md

concurrency-safety is a skill for Claude Code, Codex from r3bl-org/r3bl-open-core. It costs 40 tokens per session (798 once invoked), scanned A, original, Apache-2.0.

A Rust guide for making multi-threaded code safe when several threads share data. It covers locks, read-write locks, atomic values, and condition variables.

In plain words
What is it for?
Use it when designing or refactoring thread-safe modules, or when investigating deadlocks and race conditions.
Why use it?
It helps prevent deadlocks, race conditions, and unclear lock lifetimes that can make programs hang or behave unpredictably.

Skill for Claude CodeCodex

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

This is r3bl-org/r3bl-open-core's own configuration. It tells Claude Code and Codex how to work on r3bl-open-core itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything r3bl-open-core configures →

Reuse

Borrowing it

Nothing to install: this file belongs to r3bl-org/r3bl-open-core. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/r3bl-org/r3bl-open-core/main/.agents/skills/concurrency-safety/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/r3bl-org/r3bl-open-core

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/r3bl-org/r3bl-open-core/concurrency-safety"><img src="https://agentmods.dev/badge/skills/r3bl-org/r3bl-open-core/concurrency-safety.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 798 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00798
Opus 5 $0.00020 $0.00399
Sonnet 5 $0.00008 $0.00160
Haiku 4.5 $0.00004 $0.00080

Measured 12d ago against content hash 0b798975e5c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

concurrency-safety 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 12d 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/concurrency-safety/SKILL.md · 76 lines

How it starts

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

Concurrency Safety Skill

Apply these principles to ensure thread safety, prevent deadlocks, and maintain high-performance, predictable execution in multi-threaded code.

When to Use

  • Proactively when working with Mutex, RwLock, Atomic, or Condvar.
  • When designing thread-safe modules like Reactor, Monitor, or Engine.
  • When refactoring state management to use AtomicU8Ext.
  • When troubleshooting deadlocks or race conditions.

Core Principles

1. Scoped Access (Deadlock Prevention)

For simple shared state, use closure-based access to structurally prevent deadlocks by making it impossible to hold a lock guard longer than necessary.

Guidelines:

  • Closure-Based Access: Restrict state access to closures. The closure's scope is the lock's scope.
  • Recursion Detection: Use recursion detection (Safety-First) to prevent terminal-hanging deadlocks. Panic with a clear message if a recursive lock is detected.
  • Performance Opt-out: For hot paths, opt-out of recursion detection at compile-time for zero overhead.
  • Fail-Fast vs. Poison-Safe: Use Fail-Fast (panic) for normal logic, but Poison-Safe (recover) for cleanup paths to avoid Double Panic Aborts.

2. Chain of Custody (Guard Passing)

For complex state machines requiring Condvar, ensure linear ownership of locks by passing and returning MutexGuard by value.

Guidelines:

  • Pass MutexGuard as a parameter to internal helper functions to guarantee they operate within an existing critical section.
  • Return MutexGuard from state-reading closures (e.g., read_state) to force the caller to be intentional about the lock's lifetime.
  • Avoid "Stale Guards" by ensuring the guard is either consumed or explicitly dropped.

3. Loud Lock Releases

Make critical section boundaries explicit and easy to audit by using drop(guard).

Guidelines:

  • Explicit Release: Always call drop(guard) immediately when a critical section ends, especially before function returns, macro calls, or long-running operations.
  • Auditability: Explicit drops make it clear to reviewers (and the compiler) exactly where a lock is held, preventing accidental deadlocks during refactoring.
  • No Implicit Drops: Do not rely on scope-based implicit drops for complex logic or when calling into external code/macros.

Read the full file on GitHub · 76 lines

Files

What ships with it

1 file 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. 12d ago First seen · 76 lines · 40 tokens per session scan A 0b798975e5c2

Subscribe to this mod's changes

concurrency-safety is a skill published in the GitHub repository r3bl-org/r3bl-open-core (483 stars, last pushed today), licensed Apache-2.0. It adds 40 tokens to every session and 798 once invoked, about $0.0002 per session on Opus 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-08-30.

Related

Other skills, from other repositories