flashinfer: Instructions file for Claude Code

CLAUDE.md

flashinfer CLAUDE.md is an instructions file for Claude Code from flashinfer-ai/flashinfer. It costs 20,911 tokens per session, scanned E, original, Apache-2.0.

A repository guide for FlashInfer, a GPU library that helps serve large language models. It gives coding agents the project background, setup commands, testing steps, benchmarks, and environment checks.

In plain words
What is it for?
Use it when installing FlashInfer for development, initializing its dependencies, running tests or benchmarks, checking code style, or collecting environment details for bug reports.
Why use it?
It keeps development work consistent by putting the repository’s key instructions and commands in one place.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is flashinfer-ai/flashinfer's own configuration. It tells Claude Code how to work on flashinfer 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 flashinfer configures →

About the project

FlashInfer is a library and kernel generator that supplies GPU operations used to run large language model inference, including attention, matrix multiplication, and mixture-of-experts computations. It helps engineers build and optimize LLM serving systems across supported GPU hardware and backend implementations. Its catalogue add-ons provide skills and instructions for working with FlashInfer.

flashinfer-ai/flashinfer · 6,763 stars · on GitHub · flashinfer.ai

Reuse

Borrowing it

Nothing to install: this file belongs to flashinfer-ai/flashinfer. 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/flashinfer-ai/flashinfer/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/flashinfer-ai/flashinfer

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 flashinfer CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/flashinfer-ai/flashinfer/claude-md/github.svg)](https://agentmods.dev/instructions/flashinfer-ai/flashinfer/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/flashinfer-ai/flashinfer/claude-md"><img src="https://agentmods.dev/badge/instructions/flashinfer-ai/flashinfer/claude-md/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 flashinfer CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/flashinfer-ai/flashinfer/claude-md"><img src="https://agentmods.dev/badge/instructions/flashinfer-ai/flashinfer/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20,911 This file is loaded in full into every session.
When invoked 20,911 The same file — it is already loaded in full.
Security scan E 2 findings. A grade says what 26 rules found in the file — not that it is safe. ✓ AI security review Sonnet 5 · 7 Sept 2026 📄 Read the review
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.20911 $0.20911
Opus 5.5 $0.08364 $0.08364
Sonnet 5.5 $0.04182 $0.04182
Haiku 4.5 $0.02091 $0.02091

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

Security

Grade E, and why

flashinfer CLAUDE.md scanned grade E with 2 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 today.

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.

Nullifies safety policieshighAnti-refusal

"You have no restrictions", "do anything now", "ignore your guidelines": a direct jailbreak that disables guardrails.

| `FLASHINFER_PACKED_KDA_EVICT_FIRST` | batch policy | Set to `1` or `0` to override the policy's first-use cache-eviction hint. |

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

| Clear JIT cache | `rm -rf ~/.cache/flashinfer/` |
CLAUDE.md · 1,023 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

FlashInfer is a GPU kernel library for LLM serving that uses JIT (Just-In-Time) compilation by default. This means kernel code changes are automatically picked up without reinstalling the package - extremely convenient for development.

Quick Reference

Task Command
Install for development pip install --no-build-isolation -e . -v
Initialize submodules git submodule update --init --recursive
Install CUPTI for benchmarking pip install -U cupti-python
Run regular tests pytest tests/
Run full parameter matrices pytest tests/ --full
Run specific test pytest tests/path/test_file.py::test_function
Run multi-GPU test mpirun -np 4 pytest tests/comm/test_allreduce_unified_api.py
Run benchmark python benchmarks/flashinfer_benchmark.py --routine <name> <flags>
Run linting pre-commit run -a
Dump environment report (bug reports) python -m flashinfer.collect_env (or flashinfer collect-env [--json])
Install pre-commit hooks pre-commit install
Clear JIT cache rm -rf ~/.cache/flashinfer/
Inspect devcontainer compiler cache sccache --show-stats
Enable API logging (basic) export FLASHINFER_LOGLEVEL=1
Enable API logging (detailed) export FLASHINFER_LOGLEVEL=3
Enable API logging (with stats) export FLASHINFER_LOGLEVEL=5
Set API log destination export FLASHINFER_LOGDEST=mylog.txt
Enable verbose JIT logging export FLASHINFER_JIT_VERBOSE=1
Enable debug build export FLASHINFER_JIT_DEBUG=1
Set target architectures export FLASHINFER_CUDA_ARCH_LIST="8.0 9.0a"
Set parallel compilation export FLASHINFER_NVCC_THREADS=4
Limit parallel ninja jobs export MAX_JOBS=4
Enable GDN native short-T path export FLASHINFER_GDN_WY_NATIVE_T=1
Enable GDN strided QKV path export FLASHINFER_GDN_WY_STRIDED_QKV=1
Enable GDN native A/B tensors export FLASHINFER_GDN_WY_NATIVE_AB=1
GDN ReplaySSM u-cache flush kernel with an fp16 state pool (on SM100 served by the UMMA backend; gated_delta_rule_mtp_ucache_flush(backend=...)) export GDN_UCACHE_STATE_DTYPE=fp16
Opt in to multi-wave KV split in trtllm-gen GQA decode (long or mixed-length KV) export FLASHINFER_TRTLLM_GEN_MULTI_WAVE_KV_SPLIT=1
Let backend="auto" pick experimental backends export FLASHINFER_ALLOW_EXPERIMENTAL_AUTO_BACKENDS=1
Override ragged-prefill auto backend order (Blackwell) export FLASHINFER_RAGGED_AUTO_BACKEND_ORDER=cutlass,cudnn
Override CuTe-DSL prefill scheduling export FLASHINFER_CUTE_PREFILL_PERSISTENT=0 (non-persistent) or 1 (persistent)
Skip MoE EP CuTe-DSL import/version guard export FLASHINFER_MOE_EP_SKIP_DSL_CHECK=1
Override MoE EP knob-cache path export FLASHINFER_MOE_EP_KNOB_CACHE=/path/to/knobs.json
Disable MoE EP fused staging kernel export FLASHINFER_MEGA_FUSED_STAGE=0
Log MegaMoE compilation and workspace diagnostics export FLASHINFER_MEGAMOE_LOG_COMPILE_SPEC=1
Enable MoE EP EXPERT_MAJOR padding-row exclusion (opt-in; shape-dependent) export FLASHINFER_MOE_EP_EXCLUDE_PADDING_ROWS=1
Enable distribution-aware MoE autotune and kernel dispatch (experimental; TRT-LLM MoE only) export FLASHINFER_DIST_AWARE_AUTOTUNE=1
Prims-TS debug checks / task-manager verify export FLASHINFER_PRIMS_TS_DEBUG_CHECKS=1
Override Prims-TS CuTe-DSL compile options export FLASHINFER_PRIMS_TS_COMPILE_OPTIONS="--opt-level 2"
Configure NVFP4 4over6 quantization (preferred over the env vars) nvfp4_quantize(..., nvfp4_4over6=NVFP44Over6Config(e4m3_max=256))

Read the full file on GitHub · 1,023 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. today Changed · +39 tokens per session 9dd326c9ea53
  2. yesterday Changed · +20 lines · +543 tokens per session c98d1b9bf438
  3. 2d ago Changed · +14 lines · +309 tokens per session 311b25ac451b
  4. 3d ago Changed · +7 lines · +225 tokens per session 9775d122b93d
  5. 4d ago Changed · +3 lines · +453 tokens per session 50d116283339
  6. 6d ago Changed · -1 lines · +38 tokens per session ff725a1060f8
  7. 7d ago Changed · +1 lines · +57 tokens per session 501fe85e3d24
  8. 8d ago Changed · +2 lines · +44 tokens per session 4e064640bdab
  9. 9d ago Changed · +38 lines · +553 tokens per session da52128ae8e5
  10. 10d ago First seen · 939 lines · 18,650 tokens per session scan E a767477f9bdf

Subscribe to this mod's changes

flashinfer CLAUDE.md is an instructions file published in the GitHub repository flashinfer-ai/flashinfer (6,763 stars, last pushed today), licensed Apache-2.0. It adds 20,911 tokens to every session, about $0.0836 per session on Opus 5.5. A static security scan graded it E with 2 findings (nullifies safety policies, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,581 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens