sglang: Skill for Claude Code

.agents/skills/scripted-runtime-notes/SKILL.md

scripted-runtime-notes is a skill for Claude Code, Codex from sgl-project/sglang. It costs 37 tokens per session (435 once invoked), scanned A, original, Apache-2.0.

A guide to the SGLang scripted runtime, a test-oriented runtime that lets tests drive requests and inspect scheduling state directly.

In plain words
What is it for?
Use it when adding scripted-runtime tests or APIs, especially for real control actions, hook-backed measurements, or values derived from several scheduler structures.
Why use it?
It explains when a new test harness API is justified and prevents adding wrappers that only duplicate direct state access or weaken assertions.

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 sgl-project/sglang's own configuration. It tells Claude Code and Codex how to work on sglang 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 sglang configures →

About the project

SGLang is a framework for running inference for large language models and multimodal models, meaning it processes inputs to produce model outputs such as text or other media. It is used to serve and accelerate open AI models and related workloads.

sgl-project/sglang · 38,324 stars · on GitHub · sglang.io

Reuse

Borrowing it

Nothing to install: this file belongs to sgl-project/sglang. 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/sgl-project/sglang/main/.agents/skills/scripted-runtime-notes/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/sgl-project/sglang

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 scripted-runtime-notes

README.md
[![agentmods](https://agentmods.dev/badge/skills/sgl-project/sglang/scripted-runtime-notes/github.svg)](https://agentmods.dev/skills/sgl-project/sglang/scripted-runtime-notes)
Your own site
<a href="https://agentmods.dev/skills/sgl-project/sglang/scripted-runtime-notes"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/scripted-runtime-notes/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 scripted-runtime-notes

Your own site · 80×15
<a href="https://agentmods.dev/skills/sgl-project/sglang/scripted-runtime-notes"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/scripted-runtime-notes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 435 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.00037 $0.00435
Opus 5.5 $0.00015 $0.00174
Sonnet 5.5 $0.00007 $0.00087
Haiku 4.5 $0.00004 $0.00044

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

Security

Grade A, and why

scripted-runtime-notes 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 2mo 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/scripted-runtime-notes/SKILL.md · 30 lines

What it actually says

Scripted Runtime — Notes

Notes for anything related to the SGLang scripted runtime.

When to Add an API

Tests read r.req.* and t._scheduler.* directly — there is no encapsulation boundary. A thin wrapper buys zero isolation; it only grows the surface.

Add an API only if it does real work:

  1. Control primitive — drives the engine through a real path (start_req, pause_generation, abort, evict_radix, exhaust_kv). Reuse the real path; never hand-mutate state.
  2. Hook-backed — value cannot be read from a snapshot; accumulate via scheduler_hook.on_run_batch or the recv proxy (chunks_done). Read-only; never monkey-patch; never add *_count to srt/.
  3. Multi-structure derivation, widely reused — scans chunked_req + waiting_queue + running_batch + last_batch (is_idle, status, batch_composition).

Else: don't. Read r.req.X / t._scheduler.X in the test; inline single-use accessors.

Never:

  • Weaken an assertion to fit a missing probe.
  • Probe implementation details ("field non-None", "which branch ran") — assert the consequence.

Other Tips

  • Engine-self-driven behavior: drive the real loop, don't call the private. Never synchronously call a scheduler private (e.g. scheduler._abort_on_waiting_timeout()) from the harness/test — it runs at the wrong loop phase, bypasses the ordered recv_requests → process_input_requests injection, and can fire in states the real loop never reaches (e.g. while paused). For sweeps the engine runs itself (timeout/idle), enable the config/env and advance the loop with yield.
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. 2mo ago First seen · 30 lines · 37 tokens per session scan A 9d35487900f6

Subscribe to this mod's changes

scripted-runtime-notes is a skill published in the GitHub repository sgl-project/sglang (38,324 stars, last pushed today), licensed Apache-2.0. It adds 37 tokens to every session and 435 once invoked, about $0.0001 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-08-30.