Agent skill

ExecuTorch Binary Size Reduction

by pytorch in pytorch/executorch

Measures and shrinks the ExecuTorch runtime binary by building a size test, analyzing it with bloaty and landing each reduction as its own pull request.

Custom licenceAuto-check passedDevelopment

Install ExecuTorch Binary Size Reduction

skills CLI
$ npx skills add pytorch/executorch --skill binary-size -a claude-code

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

GitHub CLI
$ gh skill install pytorch/executorch binary-size --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/pytorch/executorch.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/binary-size .claude/skills/binary-size && 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
binary-size
GitHub stars
5.1k
Token cost
~793 tokens
SKILL.md length
280 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
Custom licence

At a glance

Measures and shrinks the ExecuTorch runtime binary by building a size test, analyzing it with bloaty and landing each reduction as its own pull request.

  • Works in 4 steps: Create a branch: git checkout -b… → Implement, rebuild, measure stripped sizes → Create a separate PR — one logical… → …
  • Investigating why the ExecuTorch runtime binary grew between two builds
  • SKILL.md covers Start from the main branch of…, Build and measure baseline, Analyze with bloaty and Key build flags, plus 3 more sections
  • Calls git, conda and bash

What it does

The agent asks where the executorch repo lives, updates main, activates the executorch conda environment and runs the build size test script, then strips the resulting binary to get a baseline. Two binaries come out: size_test, the runtime without operator implementations, and size_test_all_ops, which includes portable ops. bloaty breaks them down by symbol or section and can diff two builds.

The skill lists where savings usually hide: large functions and template bloat in .text, verbose messages and file paths in .rodata, static initializers, and logging strings that disappear when ET_LOG_ENABLED is set to 0 in Release. Constraints are firm: build with CMake, require C++17, stay compatible with GCC 9 and Clang 12, keep latency unchanged, leave the size script's flags alone and run tests for touched files. Each change goes on its own branch and pull request, with results recorded in a markdown file.

When your agent uses it

  • Investigating why the ExecuTorch runtime binary grew between two builds
  • Looking for size savings for a size-constrained on-device deployment
  • Running the size test and comparing stripped sizes before and after a change

Example prompts

  • “Build the ExecuTorch size test and show me the 30 biggest symbols.”
  • “Compare the stripped size_test binary before and after my branch.”
  • “Find places where logging strings or static initializers add to the binary size.”

Requirements

  • A local executorch checkout
  • A conda environment named executorch
  • CMake and the bloaty tool

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Create a branch: git checkout -b binary-size-
  2. Implement, rebuild, measure stripped sizes
  3. Create a separate PR — one logical change per PR
  4. Record results in binary-size-.md

What it can do on your machine

Read from SKILL.md and the folder at commit 27d124f. 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:

    • git
    • conda
    • bash

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

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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

ExecuTorch Binary Size Reduction loads about 793 tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 280 words of instructions outside code blocks.

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

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

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 280 words (~793 tokens).

“Ask the user where the executorch repo is.”

— opening of SKILL.md by pytorch, Custom licence
name
binary-size

Read the full SKILL.md on GitHub

Files

Just SKILL.md in .claude/skills/binary-size of pytorch/executorch.

Open the folder on GitHubat commit 27d124f

Compare with similar skills

ExecuTorch Binary Size Reduction 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.

ExecuTorch Binary Size Reduction compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
ExecuTorch Binary Size Reduction this skillpytorch/executorch5.1k—~793Automated safety check: PassCustom licence
The Art of Debuggingstas00/the-art-of-debugging1.7k—~6.1kAutomated safety check: NotesCC-BY-SA-4.0
Worktree Env Setupmeta-pytorch/attention-gym1.3k—~858Automated safety check: PassBSD-3-Clause
ONNX Opset Bump Checklistmicrosoft/onnxruntime22k—~12kAutomated safety check: PassMIT
Ascendcascend-ai-coding/awesome-ascend-skills174—~3.5kAutomated safety check: PassNone
External Mindstudio Ascend Profiler DB Explorerascend-ai-coding/awesome-ascend-skills174—~1.4kAutomated safety check: PassNone

Similar skills

  • 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 yesterday
    DevelopmentAuto-check: notes
  • Worktree Env Setup

    meta-pytorch/attention-gym

    Sets up an isolated per-worktree Python environment for attention-gym development using nightly PyTorch and the CI-mirroring uv flow.

    1.3k GitHub stars~858 tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • ONNX Opset Bump Checklist

    microsoft/onnxruntime

    Official

    A checklist for upgrading the pinned ONNX version and opset in ONNX Runtime, covering the files to change, archive hashes, patch rebasing and release-candidate handling.

    22k GitHub stars~12k tokensUpdated today
    DevelopmentAuto-check passed
  • Ascendc

    ascend-ai-coding/awesome-ascend-skills

    End-to-end AscendC custom operator development for Ascend NPU in an ascend-kernel (csrc/ops + build.sh + torchnpu PyTorch custom op) project.

    174 GitHub stars~3.5k tokensUpdated today
    DevelopmentAuto-check passed
  • External Mindstudio Ascend Profiler DB Explorer

    ascend-ai-coding/awesome-ascend-skills

    面向 Ascend PyTorch Profiler / msprof DB(如 ascendpytorchprofiler.db、msprof.db)的 SQL 分析技能。将自然语言问题(算子耗时、通信、下发、调度、schema/table 查询)转为安全可执行 SQL,并按需从官方文档提取表结构详情。

    174 GitHub stars~1.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed

More from pytorch/executorch

All 10 skills in this repo
  • 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
    Auto-check: notes
  • ExecuTorch Cortex-M Backend

    pytorch/executorch

    Developer guide for the Cortex-M (CMSIS-NN) backend in ExecuTorch: quantization pipeline, pass manager, tests and adding new ops.

    5.1k GitHub stars~872 tokensUpdated today
    Auto-check passed
  • ExecuTorch Knowledge Base

    pytorch/executorch

    Answers ExecuTorch questions from a local wiki on backends, export pitfalls, quantization recipes, runtime errors and SoC compatibility.

    5.1k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • ExecuTorch PR Review

    pytorch/executorch

    Reviews ExecuTorch pull requests or local branches for what CI cannot check, using a checklist, with an optional detailed line-by-line mode.

    5.1k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Helps build, test and extend the Qualcomm AI Engine Direct (QNN) backend in ExecuTorch, with routes for new ops, model export, Buck-vs-CMake parity fixes and per-layer accuracy debugging.

    5.1k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • ExecuTorch on Zephyr

    pytorch/executorch

    Sets up ExecuTorch as a Zephyr RTOS module, adds board support and debugs west build failures such as linker memory overflow on embedded boards.

    5.1k GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Works with

Questions about ExecuTorch Binary Size Reduction

What does ExecuTorch Binary Size Reduction do?

Measures and shrinks the ExecuTorch runtime binary by building a size test, analyzing it with bloaty and landing each reduction as its own pull request. The agent asks where the executorch repo lives, updates main, activates the executorch conda environment and runs the build size test script, then strips the resulting binary to get a baseline. Two binaries come out: size_test, the runtime without operator implementations, and size_test_all_ops, which includes portable ops.

When should I use ExecuTorch Binary Size Reduction?

ExecuTorch Binary Size Reduction fits situations like: investigating why the ExecuTorch runtime binary grew between two builds; looking for size savings for a size-constrained on-device deployment; running the size test and comparing stripped sizes before and after a change.

How do I install ExecuTorch Binary Size Reduction in Claude Code?

Run `npx skills add pytorch/executorch --skill binary-size -a claude-code`. Or copy the skill folder (.claude/skills/binary-size in pytorch/executorch) into .claude/skills/binary-size in your project. Claude Code loads it when a task matches its description.

How do I install ExecuTorch Binary Size Reduction in Codex?

Run `npx skills add pytorch/executorch --skill binary-size -a codex`. Or copy the skill folder (.claude/skills/binary-size in pytorch/executorch) into .agents/skills/binary-size in your project. Codex loads it when a task matches its description.

Can I use ExecuTorch Binary Size Reduction 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 pytorch/executorch --skill binary-size -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/binary-size, .gemini/skills/binary-size, .github/skills/binary-size and .opencode/skills/binary-size in your project.

What does ExecuTorch Binary Size Reduction need to run?

Going by SKILL.md and its folder, ExecuTorch Binary Size Reduction needs the command-line tools its instructions call (git, conda and bash). Our summary lists: A local executorch checkout; A conda environment named executorch; CMake and the bloaty tool.

Does ExecuTorch Binary Size Reduction access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is ExecuTorch Binary Size Reduction 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 ExecuTorch Binary Size Reduction use?

ExecuTorch Binary Size Reduction has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does ExecuTorch Binary Size Reduction use?

About 793 tokens (SKILL.md is roughly 3.2k 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 ExecuTorch Binary Size Reduction?

Skills that share tags, products or a category with ExecuTorch Binary Size Reduction: The Art of Debugging (stas00/the-art-of-debugging, 1.7k stars), Worktree Env Setup (meta-pytorch/attention-gym, 1.3k stars), ONNX Opset Bump Checklist (microsoft/onnxruntime, 22k stars) and Ascendc (ascend-ai-coding/awesome-ascend-skills, 174 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains ExecuTorch Binary Size Reduction?

pytorch (a GitHub organization) maintains it in pytorch/executorch, which has 5,081 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 7, 2026.

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