sched-ext

sched-ext is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 128 tokens per session (3,462 once invoked), scanned B, original, MIT.

A guide to sched_ext, a Linux feature that lets a user-space BPF program define how the kernel schedules tasks on CPUs. BPF is a way to run restricted programs inside the Linux kernel.

In plain words
What is it for?
Use it to enable sched_ext, run an existing scheduler, write a small BPF scheduler, inspect dispatch queues, and measure its behaviour.
Why use it?
It explains how to try custom scheduling safely and how to investigate when a scheduler is disabled or behaves incorrectly. It also helps decide whether existing CPU settings are enough before writing a new scheduler.

Skill for Claude CodeCodex

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

Good fit Use it to enable sched_ext, run an existing scheduler, write a small BPF scheduler, inspect dispatch queues, and measure its behaviour.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/sched-ext"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/sched-ext.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 128 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,462 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.00128 $0.03462
Opus 5.5 $0.00051 $0.01385
Sonnet 5.5 $0.00026 $0.00692
Haiku 4.5 $0.00013 $0.00346

Measured 14d ago against content hash 30b2663b49af, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

sched-ext 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 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.

Asks for rootmediumPrivilege escalation

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

sudo scx_lavd # runs until Ctrl-C, then the kernel falls back to the fair class
skills/observability/sched-ext/SKILL.md · 308 lines

How it starts

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

sched_ext — BPF CPU Schedulers

Purpose

Guide agents through sched_ext (examples checked on Linux 7.3.5): enabling it, running existing schedulers, writing a minimal BPF scheduler, and debugging or measuring one safely.

Triggers

  • "How do I try a sched_ext scheduler like scx_lavd?"
  • "How do I write my own CPU scheduler in BPF?"
  • "Why did my BPF scheduler get disabled?"
  • "What are dispatch queues (DSQs)?"
  • "Is sched_ext safe to run in production?"
  • "How do I check which scheduler is active?"

Workflow

1. What sched_ext is

sched_ext (upstream since Linux 6.12) adds a scheduling class whose policy is a BPF struct_ops program loaded from user space. When the program exits, errors or stalls, the kernel switches all tasks back to the default fair class. Linux 7.1 added per-cgroup sub-schedulers. Meta and Google run it in production; CachyOS and SteamOS use it on desktops.

Want different scheduling behaviour?
├── Tuning knobs (nice, cgroup cpu.weight, isolcpus) enough? → use them first
├── An existing scx scheduler fits (gaming latency, throughput, NUMA)? → section 3
└── Workload-specific policy needed → write one (sections 4-5), test in a VM first

2. Kernel configuration

CONFIG_SCHED_CLASS_EXT=y      # depends on the three below
CONFIG_BPF_SYSCALL=y
CONFIG_BPF_JIT=y
CONFIG_DEBUG_INFO_BTF=y       # needs pahole at build time

Schedulers built with the in-tree helpers (tools/sched_ext) or the scx repository also need:

CONFIG_FUNCTION_TRACER=y      # fentry programs in the scx common headers
CONFIG_DYNAMIC_FTRACE=y
CONFIG_BPF_EVENTS=y
CONFIG_CGROUP_SCHED=y         # struct_ops has cgroup callbacks the loader expects
CONFIG_EXT_GROUP_SCHED=y

tools/sched_ext/Kconfig in the kernel tree is the full recommended fragment.

# Is sched_ext available and is a scheduler loaded?
cat /sys/kernel/sched_ext/state          # disabled | enabled
cat /sys/kernel/sched_ext/root/ops       # name of the running scheduler (only when enabled)

Read the full file on GitHub · 308 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 First seen · 308 lines · 128 tokens per session scan B 30b2663b49af

Subscribe to this mod's changes

sched-ext is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (310 stars, last pushed 14d ago), licensed MIT. It adds 128 tokens to every session and 3,462 once invoked, about $0.0005 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-11-21.

Related

sched-ext compared with skills from other repositories

sched-ext next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
sched-extmohitmishra786/low-level-dev-skillsSkill31014d agoMITB128Claude Code, Codex
ecommerce-marketing-strategy-buildernexscope-ai/eCommerce-SkillsSkill1.6ktodayMITA112Claude Code, Codex
product-description-generatornexscope-ai/eCommerce-SkillsSkill1.6ktodayMITA126Claude Code, Codex
shopify-marketingnexscope-ai/eCommerce-SkillsSkill1.6ktodayMITA60Claude Code, Codex
tiktok-shop-cross-bordernexscope-ai/eCommerce-SkillsSkill1.6ktodayMITA55Claude Code, Codex
ecommerce-landing-pagenexscope-ai/eCommerce-SkillsSkill1.6ktodayMITA45Claude Code, Codex
market-gap-analysisnexscope-ai/eCommerce-SkillsSkill1.6ktodayMITA38Claude Code, Codex