ebpf-rust

ebpf-rust is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 94 tokens per session (1,878 once invoked), scanned B, original, MIT.

A guide to writing eBPF programs in Rust with Aya, a framework for connecting Linux kernel-side code with a normal user-space Rust program. It covers BPF maps, logging, compilation, loading, and Tokio integration.

In plain words
What is it for?
Use it to create Rust eBPF projects, share data through BPF maps, add kernel-side logs, connect eBPF programs to Tokio applications, and build or run Aya projects.
Why use it?
It brings the eBPF workflow into Rust while explaining the separate kernel and user-space parts of the program. It also helps investigate compilation and loading failures.

Skill for Claude CodeCodex

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

Good fit Use it to create Rust eBPF projects, share data through BPF maps, add kernel-side logs, connect eBPF programs to Tokio applications, and build or run Aya projects.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/ebpf-rust
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 ebpf-rust
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 ebpf-rust

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/ebpf-rust"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/ebpf-rust.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,878 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00094 $0.01878
Opus 5.5 $0.00038 $0.00751
Sonnet 5.5 $0.00019 $0.00376
Haiku 4.5 $0.00009 $0.00188

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

Security

Grade B, and why

ebpf-rust scanned grade B with 1 finding 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

cargo xtask run # builds + runs with sudo ```
skills/observability/ebpf-rust/SKILL.md · 229 lines

How it starts

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

eBPF with Rust (Aya)

Purpose

Guide agents through building production eBPF programs in Rust using the Aya framework: writing kernel-side BPF code with aya-bpf, structured logging with aya-log, sharing maps between BPF and userspace, and integrating with async tokio.

Triggers

  • "How do I write an eBPF program in Rust?"
  • "How do I use the Aya framework?"
  • "How do I share a BPF map between kernel and userspace in Rust?"
  • "How do I log from a BPF program in Rust?"
  • "My Aya program fails to load — how do I debug it?"
  • "How do I integrate an eBPF program with tokio?"

Workflow

1. Project setup

# Install aya-tool (generates bindings from vmlinux BTF)
cargo install aya-tool

# Create new Aya project from template
cargo install cargo-generate
cargo generate https://github.com/aya-rs/aya-template

# Workspace layout (generated)
# my-ebpf/
# ├── my-ebpf-ebpf/    <- kernel-side crate (target: bpf)
# ├── my-ebpf/         <- userspace crate (runs on host)
# └── xtask/           <- build helper (cargo xtask build/run)
# Build both sides
cargo xtask build-ebpf          # builds BPF object
cargo xtask run                 # builds + runs with sudo

2. Kernel-side BPF program

// my-ebpf-ebpf/src/main.rs
#![no_std]
#![no_main]

use aya_bpf::{
    macros::{map, tracepoint},
    maps::HashMap,
    programs::TracePointContext,
    helpers::bpf_get_current_pid_tgid,
};
use aya_log_ebpf::info;

#[map]
static CALL_COUNT: HashMap<u32, u64> = HashMap::with_max_entries(1024, 0);

#[tracepoint]
pub fn trace_read(ctx: TracePointContext) -> u32 {
    let pid = (bpf_get_current_pid_tgid() >> 32) as u32;

    // Lookup or insert
    match unsafe { CALL_COUNT.get(&pid) } {
        Some(count) => {
            let _ = CALL_COUNT.insert(&pid, &(count + 1), 0);
        }
        None => {
            let _ = CALL_COUNT.insert(&pid, &1u64, 0);
        }
    }

    info!(&ctx, "read() called by pid {}", pid);
    0
}

#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
    unsafe { core::hint::unreachable_unchecked() }
}

Read the full file on GitHub · 229 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 · 229 lines · 94 tokens per session scan B e6825e32407b

Subscribe to this mod's changes

ebpf-rust is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (310 stars, last pushed 14d ago), licensed MIT. It adds 94 tokens to every session and 1,878 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

ebpf-rust compared with skills from other repositories

ebpf-rust next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ebpf-rustmohitmishra786/low-level-dev-skillsSkill31014d agoMITB94Claude Code, Codex
rust-projectmajiayu000/spellbookSkill3034d agoMITA43Claude Code, Codex
gcs-rust-download-object-apidivinevideo/divine-mobileSkill263yesterdayMPL-2.0A91Claude Code, Codex
laravel-rust-testingAsyrafHussin/agent-skillsSkill116yesterdayMITA227Claude Code, Codex
windows-compatsdsrss/code-graph-mcpSkill10210d agoMITA165Claude Code, Codex
bevy-migration-0-18-to-0-19shinyobjectz/raea-skillsSkill41todayApache-2.0A166Claude Code
rustnimadorostkar/Claude-Skills-collectionSkill415d agoMITA74Claude Code