sglang: Skill for Claude Code

.claude/skills/llm-torch-profiler-analysis/SKILL.md

llm-torch-profiler-analysis is a skill for Claude Code from sgl-project/sglang. It costs 84 tokens per session (6,480 once invoked), scanned A, original, Apache-2.0.

A guide to reading torch.profiler traces, which record where an application spends time on CPUs and GPUs, for several language-model serving systems including SGLang, vLLM, TensorRT-LLM, and TokenSpeed.

In plain words
What is it for?
Use it to analyze a profile and produce kernel, overlap-opportunity, and fuse-pattern tables, with low-share rows hidden unless a lower cutoff is requested.
Why use it?
It gives one consistent way to inspect an existing trace or profile directory and identify time-consuming kernels, work that could overlap, and possible groups of operations to combine.

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,749 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/llm-torch-profiler-analysis/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 llm-torch-profiler-analysis

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sgl-project/sglang/llm-torch-profiler-analysis"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/llm-torch-profiler-analysis.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,480 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Snyk fail 7 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Memory Poisoning · line 128
    Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
    Fix: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
  • medium Data Exfiltration · line 380
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
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.00084 $0.06480
Opus 5 $0.00042 $0.03240
Sonnet 5 $0.00017 $0.01296
Haiku 4.5 $0.00008 $0.00648

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

Security

Grade A, and why

llm-torch-profiler-analysis scanned grade A 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 10d ago.

The scan reads SKILL.md. This mod also ships 12 executable files (scripts/analyze_llm_torch_profile.py, scripts/analyze_sglang_torch_profile.py, scripts/make_trtllm_py_executor_override.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -X POST http://127.0.0.1:8000/start_profile \
.claude/skills/llm-torch-profiler-analysis/SKILL.md · 563 lines

How it starts

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

Unified LLM Torch Profiler Analysis

Overview

Use this skill for torch.profiler analysis across:

  • sglang
  • vllm
  • TensorRT-LLM
  • TokenSpeed

There is only one public workflow:

  • triage

Preferred unified entrypoint:

Backwards-compatibility shim (kept so older docker exec ... analyze_sglang_torch_profile.py ... calls keep working; it just forwards to the unified entrypoint):

Markdown bundling helper:

triage always prints the same three tables:

  • kernel table
  • overlap-opportunity table
  • fuse-pattern table

By default, all three tables only render rows at or above 1.0% cumulative GPU-time share. Rows below that are hidden by default unless the user asks for a lower cutoff.

Keep the fuse-pattern table source-backed and deterministic. Do not turn it into a fuzzy matcher.

If exact source-backed matching is weak but a kernel cluster is still close to a known family, add one short note after the tables with exactly one of:

  • high
  • medium
  • low

Capability Matrix

Capability SGLang vLLM TensorRT-LLM TokenSpeed
Existing trace triage yes yes yes yes
Single-trace live capture yes yes, if torch profiler is enabled on server requires profiler control endpoints yes, if /start_profile and /stop_profile are exposed
Two-trace mapping+formal triage yes yes yes yes
Stage-separated live workload yes yes yes, with a writable shared trace dir or per-stage host runner yes, via workload-separated HTTP capture
--profile-by-stage capture yes no no no
--profile-prefix control yes usually ignored on HTTP profiler route usually ignored on HTTP profiler route yes, mapped to profile_id

Read the full file on GitHub · 563 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. 10d ago First seen · 563 lines · 84 tokens per session scan A 90c70c1616e9

Subscribe to this mod's changes

llm-torch-profiler-analysis is a skill published in the GitHub repository sgl-project/sglang (35,749 stars, last pushed today), licensed Apache-2.0. It adds 84 tokens to every session and 6,480 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.