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.

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 15 Sept 2026
  • Snyk pass 15 Sept 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.5 $0.00041 $0.00784
Sonnet 5.5 $0.00021 $0.00392
Haiku 4.5 $0.00010 $0.00196

Measured 14d ago against content hash a216da1ac0e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 14d 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 · 255 lines

How it starts

The opening of the file, as written. The whole thing — 255 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 · 255 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. 14d ago Changed · +1 lines a216da1ac0e5
  2. 3mo 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 (310 stars, last pushed 14d ago), licensed MIT. It adds 103 tokens to every session and 1,960 once invoked, about $0.0004 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-async-internals compared with skills from other repositories

rust-async-internals next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rust-async-internalsmohitmishra786/low-level-dev-skillsSkill31014d agoMITA103Claude Code, Codex
rust-checkHmbown/CodeWhaleSkill41k5d agoMITA15Claude Code, Codex
stack-trace-rust-probeopensquilla/opensquillaSkill7.2k8d agoApache-2.0A42Claude Code
hotpath_initpawurb/hotpath-rsSkill1.9k13d agoMITA88Claude Code
memory-safety-patternsrmyndharis/antigravity-skillsSkill2.2k2d agoMITA45Claude Code, Codex
rust-tracingBerriAI/litellmSkill65ktodaynoneA28Claude Code, Codex
rust-errorBerriAI/litellmSkill65ktodaynoneA72Claude Code, Codex