sglang: Skill for Claude Code

.claude/skills/speculative-naming/SKILL.md

speculative-naming is a skill for Claude Code from sgl-project/sglang. It costs 63 tokens per session (1,667 once invoked), scanned A, original, Apache-2.0.

A naming guide for speculative decoding code in SGLang. Speculative decoding is a text-generation method where a smaller model proposes tokens that a larger model checks.

In plain words
What is it for?
Use it when adding, renaming, or reviewing identifiers related to speculative decoding, attention backends, scheduling, inter-process communication, metrics, or command-line flags.
Why use it?
It prevents different parts of the codebase from using inconsistent names for the same concepts. Consistent names make code, metrics, and command-line options easier to understand and review.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is sgl-project/sglang's own configuration. It tells Claude Code 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 · 35,615 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/.claude/skills/speculative-naming/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/sgl-project/sglang

Made for: Claude Code.

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 speculative-naming

README.md
[![agentmods](https://agentmods.dev/badge/skills/sgl-project/sglang/speculative-naming.svg)](https://agentmods.dev/skills/sgl-project/sglang/speculative-naming)
Your own site
<a href="https://agentmods.dev/skills/sgl-project/sglang/speculative-naming"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/speculative-naming.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,667 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
  • Snyk pass 7 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.00063 $0.01667
Opus 5 $0.00032 $0.00834
Sonnet 5 $0.00013 $0.00333
Haiku 4.5 $0.00006 $0.00167

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

Security

Grade A, and why

speculative-naming 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 8d 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.

.claude/skills/speculative-naming/SKILL.md · 114 lines

How it starts

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

Speculative Decoding — Naming Conventions

Apply this skill when adding, renaming, or reviewing identifiers in speculative decoding code (anything under python/sglang/srt/speculative/, related attention backends, scheduler accumulators, IPC fields, observability metrics, or CLI flags).

Rule 1 — Verb form, drop -ed

Use the verb form accept everywhere. Don't use the past-participle form accepted.

Don't Do
num_accepted_tokens num_accept_tokens
accepted_indices accept_indices
accepted_token_ids accept_tokens (also see Rule 3)

Rule 2 — The extra/bonus token is bonus_token / bonus_tokens

The "+1" token that the target model always emits in addition to verifying drafts is the bonus token. Use bonus_token / bonus_tokens per Rule 7.

Don't Do
verified_id / verified_ids bonus_token / bonus_tokens
output_id / output_ids (when referring to the bonus) bonus_token / bonus_tokens

req.output_ids (the full output history of a request) is unrelated and stays as is.

Rule 3 — accept includes bonus; correct excludes bonus

The semantic distinction lives in the verb, not the noun. Don't enumerate noun pairs.

Verb Meaning
accept_* Includes the bonus token
correct_* Drafts only, no bonus

Pair with whatever noun fits the data (tokens, drafts, indices, …). No required pairing, but preferred default nouns: accept_tokens and correct_draftscorrect semantically describes drafts (what got verified), accept describes the resulting token sequence (incl. bonus).

Form Meaning
accept_tokens / accept_indices Include bonus
correct_drafts Drafts only, no bonus
num_accept_tokens Count incl. bonus
num_correct_drafts Count excl. bonus

Exception: accept_rate / accept_length follow paper convention

These two metric names are entrenched in the spec-decoding literature and in external-facing fields (meta_info, Prometheus). Their semantics are paper-defined, not Rule-3-defined:

Read the full file on GitHub · 114 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. 8d ago First seen · 114 lines · 63 tokens per session scan A f419c34469d1

Subscribe to this mod's changes

speculative-naming is a skill published in the GitHub repository sgl-project/sglang (35,615 stars, last pushed today), licensed Apache-2.0. It adds 63 tokens to every session and 1,667 once invoked, about $0.0003 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-08-30.

Related

Other skills, from other repositories

ort

ONNX Runtime in Rust via the ort crate (2.x): loading sessions, configuring CPU/CoreML/CUDA execution providers, tensor I/O with ndarray, async-safe spawnblocking wrapping, global thread-pool init, and debugging provider/opset issues.

bobmatnyc/claude-mpm-skills · 54 tokens

promptfoo-provider-setup

Configure promptfoo providers or redteam targets for hosted models, live HTTP APIs, Python/JavaScript local scripts, agent SDKs, or multi-input systems. Use when connecting promptfoo to the system under test, mapping vars, auth env vars, request bodies, response transforms, or static-code-derived provider wrappers. Do…

promptfoo/promptfoo · 91 tokens

llama-factory

Expert guidance for fine-tuning LLMs with LLaMA-Factory - WebUI no-code, 100+ models, 2/3/4/5/6/8-bit QLoRA, multimodal support.

davila7/claude-code-templates · 51 tokens

ax-java-gen

Use when writing Java code with dev.axllm:ax for AxGen programs, forward calls, indexed multi-sampling, result pickers, streaming, tools, assertions, traces, usage, and output parsing.

ax-llm/ax · 49 tokens

website-md-language-docs

Use when changing Ax website language docs, language-specific snippets, examples, API symbol mappings, generated package capabilities, or adding a new website language route. Keeps the markdown-only Hugo site source-audited and generated from repo truth.

ax-llm/ax · 52 tokens

ax-go-llm

Use when writing Go code with github.com/ax-llm/ax/packages/go for using the generated Ax package, factory functions, package docs, examples, and API reference.

ax-llm/ax · 44 tokens