Official agent skill

ONNX Runtime Source Build

by microsoft in microsoft/onnxruntime

Builds ONNX Runtime from source with its build scripts, explaining the update, build and test phases, key flags and where the build output lands.

OfficialMITAuto-check passedDevelopment

Install ONNX Runtime Source Build

skills CLI
$ npx skills add microsoft/onnxruntime --skill ort-build -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install microsoft/onnxruntime ort-build --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/microsoft/onnxruntime.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/ort-build .claude/skills/ort-build && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ort-build
GitHub stars
22k
Token cost
~1.4k tokens
SKILL.md length
518 words
Files
1
Skills in repo
14
Repo updated
First seen
Licence
MIT

At a glance

Builds ONNX Runtime from source with its build scripts, explaining the update, build and test phases, key flags and where the build output lands.

  • Compiling ONNX Runtime from a source checkout
  • SKILL.md covers Build phases, Examples, Key flags and Build output path, plus 1 more section
  • Calls python
  • Regenerating CMake files after adding source files

What it does

The `build.sh` script for Linux and macOS and `build.bat` for Windows both hand off to `tools/ci_build/build.py`. Work is split into three phases set by flags: `--update` generates the CMake build files, `--build` compiles with an optional `--parallel`, and `--test` runs the tests. Native builds run all three by default unless `--skip_tests` is passed, while cross-compiled builds default to update and build only.

Rerunning `--update` is needed for a first build in a new directory, new source files and CMake changes, but not for edits to existing `.cc` and `.h` files. A table of key flags covers the `--config` choices, `--build_wheel`, `--use_cuda` with its CUDA and cuDNN home settings, `--use_webgpu`, building a single CMake `--target`, a quick-build define for faster CUDA builds and `--build_dir`. By default the output goes to a folder under `build/` named for the platform and configuration.

When your agent uses it

  • Compiling ONNX Runtime from a source checkout
  • Regenerating CMake files after adding source files
  • Building a Python wheel or a CUDA-enabled ONNX Runtime
  • Rebuilding a single CMake target to speed up iteration

Example prompts

  • “Build ONNX Runtime in Release mode with parallel compilation and run the tests.”
  • “I only edited a .cc file. What is the quickest way to rebuild?”
  • “Build the Python wheel with CUDA enabled using my CUDA_HOME.”
  • “Rebuild just the onnxruntime_test_all target.”

Requirements

  • An ONNX Runtime source checkout
  • CUDA and cuDNN install paths for CUDA builds

What it can do on your machine

Read from SKILL.md and the folder at commit 8420709. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

ONNX Runtime Source Build loads about 1.4k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 518 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from microsoft/onnxruntime at commit 8420709, republished under its MIT licence (© microsoft). 518 words, ~1,382 tokens.

Download SKILL.mdSave it as .claude/skills/ort-build/SKILL.md (or your agent's skills folder).
name
ort-build
description
Build ONNX Runtime from source. Use this skill when asked to build, compile, or generate CMake files for ONNX Runtime.

Building ONNX Runtime

The build scripts build.sh (Linux/macOS) and build.bat (Windows) delegate to tools/ci_build/build.py.

Build phases

Three phases, controlled by flags:

  • --update — generate CMake build files
  • --build — compile (add --parallel to speed this up)
  • --test — run tests

For native builds, if none are specified (and --skip_tests is not passed), all three run by default. For cross-compiled builds, the default is --update + --build only.

When to use --update

You need --update when:

  • First build in a new build directory
  • New source files are added (some CMake targets use glob patterns, others use explicit file lists — re-run to pick up new files either way)
  • CMake configuration changes (new flags, updated CMakeLists.txt)

You do not need --update when only modifying existing .cc/.h files — just use --build. Skipping it saves time.

Examples

bash
# Full build (update + build + test)
./build.sh --config Release --parallel
.\build.bat --config Release --parallel     # Windows

# Just regenerate CMake files
./build.sh --config Release --update

# Just compile (skip CMake regeneration and tests)
./build.sh --config Release --build --parallel

# Just run tests (after a prior build)
./build.sh --config Release --test

# Build with CUDA execution provider
./build.sh --config Release --parallel --use_cuda --cuda_home /usr/local/cuda --cudnn_home /usr/local/cuda

# Configure and build the WebGPU execution provider as a shared library (Windows)
.\build.bat --config RelWithDebInfo --build_dir .\build\WGPU --use_webgpu --build_shared_lib --update --build --parallel

# Incrementally rebuild the same WebGPU configuration after changing existing source files
.\build.bat --config RelWithDebInfo --build_dir .\build\WGPU --use_webgpu --build_shared_lib --build --parallel

# Build Python wheel
./build.sh --config Release --parallel --build_wheel

# Build a specific CMake target (much faster than a full build)
./build.sh --config Release --build --parallel --target onnxruntime_common

# Load flags from an option file (one flag per line)
./build.sh "@./custom_options.opt" --build --parallel

Key flags

FlagDescription
--configDebug, MinSizeRel, Release, or RelWithDebInfo
--parallelEnable parallel compilation (recommended)
--skip_testsSkip running tests after build
--build_wheelBuild the Python wheel package
--use_cudaEnable CUDA EP. Requires --cuda_home/--cudnn_home or CUDA_HOME/CUDNN_HOME env vars. On Windows, only cuda_home/CUDA_HOME is validated.
--target TBuild a specific CMake target (requires --build; e.g., onnxruntime_common, onnxruntime_test_all)
--use_webgpuEnable WebGPU EP. To run its tests locally on Linux without a GPU, see the webgpu-local-testing skill.
--cmake_extra_defines onnxruntime_QUICK_BUILD=ONFaster CUDA build: instantiates a reduced kernel set. Side effect: Flash is compiled for head_dim 128 only, so most attention shapes fall back to MEA (changes which attention kernel is compiled/dispatched). Don't use it to characterize Flash-vs-arch behavior.
--build_dirBuild output directory

Build output path

Default: build/<Platform>/<Config>/ where Platform is Linux, MacOS, or Windows.

With Visual Studio multi-config generators, the config name appears twice (e.g., build/Windows/Release/Release/).

It may be customized with --build_dir. For example, --build_dir .\build\WGPU --config RelWithDebInfo creates the CMake build tree at build/WGPU/RelWithDebInfo/; Visual Studio places final binaries in its RelWithDebInfo/ subdirectory. The --build_shared_lib flag in the WebGPU example is optional and is only needed when building the ONNX Runtime DLL.

Show full SKILL.md (202 more words)Show less

Agent tips

  • Activate a Python virtual environment before building. See "Python > Virtual environment" in AGENTS.md.
  • Build flags can silently reroute which kernel/code path executes. A build option can change which kernel is compiled, and therefore which code path actually runs — so a CI failure can live in a different code path than your local build exercises. Before hypothesizing a hardware- or algorithm-specific cause (e.g. "this GPU arch miscomputes"), first identify which kernel actually ran for the failing configuration (see the ort-test skill → "Verify which path/kernel actually executed"). Concrete instance: onnxruntime_QUICK_BUILD=ON compiles FlashAttention for head_dim 128 only, so most attention shapes silently dispatch to Memory-Efficient Attention instead of Flash — details in the cuda-attention-kernel-patterns skill.
  • Prefer python tools/ci_build/build.py directly over build.bat/build.sh when redirecting output. The .bat wrapper runs in cmd.exe, which breaks PowerShell redirection.
  • Redirect output to a file (e.g., > build_log.txt 2>&1). Build output is large and will overflow terminal buffers.
  • Run builds in the background — a full build can take tens of minutes to over an hour. Poll the log for "Build complete" or errors.
  • Use --parallel by default unless the user says otherwise.
  • Ask the user what they want to build (config, execution providers, wheel, etc.) if not clear from their prompt.

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/ort-build of microsoft/onnxruntime.

Open the folder on GitHubat commit 8420709

Compare with similar skills

ONNX Runtime Source Build next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

ONNX Runtime Source Build compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
ONNX Runtime Source Build this skillmicrosoft/onnxruntime22k—~1.4kAutomated safety check: PassMIT
Embedded AI Deploymentmatlab/agent-skills-playground1811 repos~3.4kAutomated safety check: PassCustom licence
Holoscan Install CondaNVIDIA/skills3.5k—~2kAutomated safety check: PassApache-2.0
Matlab Deploy Embedded AImajiayu000/claude-skill-registry6661 repos~4.6kAutomated safety check: PassMIT
The Art of Debuggingstas00/the-art-of-debugging1.7k—~6.1kAutomated safety check: NotesCC-BY-SA-4.0
ExecuTorch Build Guidepytorch/executorch5.1k—~2.3kAutomated safety check: NotesCustom licence

Similar skills

  • Embedded AI Deployment

    matlab/agent-skills-playground

    Deploy AI models to embedded hardware using MathWorks tools (MATLAB, Simulink, Embedded Coder).

    181 GitHub starsUsed in 1 repo~3.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Official

    Install Holoscan SDK v4.3+ via Conda in a CUDA 13 environment.

    3.5k GitHub stars~2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Matlab Deploy Embedded AI

    majiayu000/claude-skill-registry

    Deploy AI models to embedded hardware using MathWorks tools (MATLAB, Simulink, Embedded Coder).

    666 GitHub starsUsed in 1 repo~4.6k tokens
    AI & LLM EngineeringAuto-check passed
  • The Art of Debugging

    stas00/the-art-of-debugging

    Condensed debugging method and tool recipes for Unix, Python and PyTorch programs: crashes, hangs, segfaults, wrong output, CUDA OOM, NaN values and slowness.

    1.7k GitHub stars~6.1k tokensUpdated today
    DevelopmentAuto-check: notes
  • ExecuTorch Build Guide

    pytorch/executorch

    Builds ExecuTorch from source: the Python package, C++ runtime, model runners, Android and iOS cross-compilation and backend-specific builds, with environment checks.

    5.1k GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check: notes
  • Cutlass Cpp Kernel

    vipshop/cache-dit

    A skill your agent uses when writing, debugging, porting, reviewing, or optimizing CUTLASS or CuTe C++ kernels and templates; navigating CUTLASS examples, collectives, epilogues, pipelines, GEMM…

    1.3k GitHub stars~2.2k tokensUpdated 8 days ago
    DevelopmentAuto-check passed

More from microsoft/onnxruntime

All 14 skills in this repo
  • Official

    Finds and fixes out-of-range output writes in ONNX Runtime operator shape-inference functions where a getNumOutputs guard admits too few outputs.

    22k GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Official

    Explains why editing CUTLASS fused-MHA headers in ONNX Runtime can leave stale CUDA kernels after an incremental build, and how to force and verify a real rebuild.

    22k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • ONNX Runtime CI Management

    microsoft/onnxruntime

    Official

    Triggers, re-runs and unblocks the CI checks on an ONNX Runtime pull request, after diagnosing whether a failure is transient or needs a code change.

    22k GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • ONNX Runtime Release Notes

    microsoft/onnxruntime

    Official

    Drafts ONNX Runtime release notes from commit history and contributor metadata using named presets for the full runtime or a scoped component.

    22k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • ONNX Runtime Test Runner

    microsoft/onnxruntime

    Official

    Runs and debugs ONNX Runtime tests: Google Test executables for C++ and unittest or pytest for Python, with filters and build-directory guidance.

    22k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Official

    Runs the ONNX Runtime transformers Python tests against a GPU wheel and proves the cuDNN flash attention path was used rather than a silent fallback.

    22k GitHub stars~2.9k tokensUpdated today
    Auto-check passed

Questions about ONNX Runtime Source Build

What does ONNX Runtime Source Build do?

Builds ONNX Runtime from source with its build scripts, explaining the update, build and test phases, key flags and where the build output lands. py`. Work is split into three phases set by flags: `--update` generates the CMake build files, `--build` compiles with an optional `--parallel`, and `--test` runs the tests.

When should I use ONNX Runtime Source Build?

ONNX Runtime Source Build fits situations like: compiling ONNX Runtime from a source checkout; regenerating CMake files after adding source files; building a Python wheel or a CUDA-enabled ONNX Runtime; rebuilding a single CMake target to speed up iteration.

How do I install ONNX Runtime Source Build in Claude Code?

Run `npx skills add microsoft/onnxruntime --skill ort-build -a claude-code`. Or copy the skill folder (.github/skills/ort-build in microsoft/onnxruntime) into .claude/skills/ort-build in your project. Claude Code loads it when a task matches its description.

How do I install ONNX Runtime Source Build in Codex?

Run `npx skills add microsoft/onnxruntime --skill ort-build -a codex`. Or copy the skill folder (.github/skills/ort-build in microsoft/onnxruntime) into .agents/skills/ort-build in your project. Codex loads it when a task matches its description.

Can I use ONNX Runtime Source Build in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/onnxruntime --skill ort-build -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ort-build, .gemini/skills/ort-build, .github/skills/ort-build and .opencode/skills/ort-build in your project.

What does ONNX Runtime Source Build need to run?

Going by SKILL.md and its folder, ONNX Runtime Source Build needs the command-line tools its instructions call (python). Our summary lists: An ONNX Runtime source checkout; CUDA and cuDNN install paths for CUDA builds.

Does ONNX Runtime Source Build access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is ONNX Runtime Source Build safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does ONNX Runtime Source Build use?

ONNX Runtime Source Build is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does ONNX Runtime Source Build use?

About 1.4k tokens (SKILL.md is roughly 5.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to ONNX Runtime Source Build?

Skills that share tags, products or a category with ONNX Runtime Source Build: Embedded AI Deployment (matlab/agent-skills-playground, 181 stars), Holoscan Install Conda (NVIDIA/skills, 3.5k stars), Matlab Deploy Embedded AI (majiayu000/claude-skill-registry, 666 stars) and The Art of Debugging (stas00/the-art-of-debugging, 1.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains ONNX Runtime Source Build?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/onnxruntime, which has 22,029 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 7, 2026.

Source: microsoft/onnxruntime on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.