rust-async-internals

rust-async-internals is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 103 tokens per session (1,960 once invoked), scanned A, original, MIT.

A guide to how Rust asynchronous code works internally, including futures, polling, pinning, task scheduling, and wakers. Asynchronous programs let tasks pause while waiting for work and resume later.

In plain words
What is it for?
Use it to understand Future and poll, reason about Pin and Unpin, debug Tokio tasks with tokio-console, and avoid blocking inside async code.
Why use it?
It helps explain behavior that is difficult to see from async/await syntax, such as blocking tasks, scheduling problems, and waker leaks.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

not rated 203repo +8 2mo ago A scan Socket: passSnyk: passSkillSpector: pass 103 tokens original MIT

Good fit Use it to understand Future and poll, reason about Pin and Unpin, debug Tokio tasks with tokio-console, and avoid blocking inside async code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/rust-async-internals
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 mohitmishra786/low-level-dev-skills --skill rust-async-internals
Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills

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-async-internals

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/rust-async-internals"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/rust-async-internals.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 103 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,960 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
  • Socket pass 18 Mar 2026
  • Snyk pass 4 Mar 2026
  • 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.00103 $0.01960
Opus 5 $0.00051 $0.00980
Sonnet 5 $0.00021 $0.00392
Haiku 4.5 $0.00010 $0.00196

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

Security

Grade A, and why

rust-async-internals 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 9d 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/rust/rust-async-internals/SKILL.md · 254 lines

How it starts

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

Rust Async Internals

Purpose

Guide agents through Rust async/await internals: the Future trait and poll loop, Pin/Unpin for self-referential types, tokio's task model, diagnosing async stack traces with tokio-console, finding waker leaks, and common select!/join! pitfalls.

Triggers

  • "How does async/await actually work in Rust?"
  • "What is Pin and Unpin in async Rust?"
  • "My async code is slow — how do I profile it?"
  • "How do I use tokio-console to debug async tasks?"
  • "I have a blocking call in async — what do I do?"
  • "How does select! work and what are the pitfalls?"

Workflow

1. The Future trait — poll model

// std::future::Future (simplified)
pub trait Future {
    type Output;
    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>;
}

pub enum Poll<T> {
    Ready(T),    // computation done, T is the result
    Pending,     // not ready yet, waker registered, will be polled again
}

Execution model:

  1. Calling .await calls poll() on the future
  2. If Pending: current task registers its waker and yields to the runtime
  3. When the waker is triggered (I/O ready, timer fired), the runtime re-polls
  4. If Ready(val): the .await expression evaluates to val

2. Implementing a simple Future

use std::{
    future::Future,
    pin::Pin,
    task::{Context, Poll},
    time::{Duration, Instant},
};

struct Delay { deadline: Instant }

impl Delay {
    fn new(dur: Duration) -> Self {
        Delay { deadline: Instant::now() + dur }
    }
}

impl Future for Delay {
    type Output = ();

    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> {
        if Instant::now() >= self.deadline {
            Poll::Ready(())
        } else {
            // Register the waker — runtime calls waker.wake() to re-poll
            // In production: register with I/O reactor or timer wheel
            let waker = cx.waker().clone();
            let deadline = self.deadline;
            std::thread::spawn(move || {
                let now = Instant::now();
                if deadline > now {
                    std::thread::sleep(deadline - now);
                }
                waker.wake();  // notify runtime to re-poll
            });
            Poll::Pending
        }
    }
}

// Usage
async fn main() {
    Delay::new(Duration::from_secs(1)).await;
    println!("Done");
}

Read the full file on GitHub · 254 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. 9d ago First seen · 254 lines · 103 tokens per session scan A 12d89d13acf7

Subscribe to this mod's changes

rust-async-internals is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (203 stars, last pushed 2mo ago), licensed MIT. It adds 103 tokens to every session and 1,960 once invoked, about $0.0005 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-09-03.

Related

Other skills, from other repositories

rust-check

Run cargo check on the current Rust project to find compile errors.

Hmbown/CodeWhale · 15 tokens

stack-trace-rust-probe

Internal helper for meta-stack-trace-investigator. Use when a Rust panic or backtrace needs Rust-specific Result/Option checks, cargo test guidance, and patch targets.

opensquilla/opensquilla · 42 tokens

hotpath_init

Configure hotpath profiling in a Rust project. Adds the hotpath dependency with feature-gated setup, instruments main with hotpath::main, functions with measure/measureall, and wraps channels, mutexes, rwlocks, streams, futures, reqwest clients, axum routers and byte-level I/O with hotpath macros. Use when the user…

pawurb/hotpath-rs · 88 tokens

clickhouse-rust-type-mismatches

Fix ClickHouse query errors in Rust when using clickhouse-rs crate. Use when: (1) "string is not valid utf8" errors - typically FixedString columns need CAST to String, (2) "tag for enum is not valid" errors - typically Option fields receiving non-NULL values, (3) Sum/count aggregations returning Float64 but Rust…

divinevideo/divine-mobile · 280 tokens

fastly-compute-rust-edition2024-fix

Fix Fastly Compute Rust build failures caused by edition2024 dependencies. Use when: (1) cargo build fails with "feature edition2024 is required", (2) wit-bindgen or wasip2 crates fail to download/parse, (3) Fastly SDK pulls in incompatible transitive dependencies, (4) Build worked before but fails after dependency…

divinevideo/divine-mobile · 116 tokens

memory-safety-patterns

Implement memory-safe programming with RAII, ownership, smart pointers, and resource management across Rust, C++, and C. Use when writing safe systems code, managing resources, or preventing memory bugs.

rmyndharis/antigravity-skills · 45 tokens