codesize

codesize is a skill for Claude Code, Codex from open-vela/.claude. It costs 54 tokens per session (5,749 once invoked), scanned A, original, Apache-2.0.

A tool for measuring the size of embedded-system firmware from build files such as ELF, map, and static-library files. It supports ARM, Xtensa, and RISC-V systems, including multi-core projects.

In plain words
What is it for?
Use it to investigate oversized firmware, compare builds, find accidentally included code, and add size checks to continuous integration.
Why use it?
It shows which modules, functions, or data use the most space and helps explain why a firmware build grew.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is python3 ../../skills/codesize/scripts/analyze_size_output.py /tmp/size_output.txt.

Good fit Use it to investigate oversized firmware, compare builds, find accidentally included code, and add size checks to continuous integration.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/open-vela/.claude
agentmods
npx agentmods add skills/open-vela/.claude/codesize

Made for: Claude Code, Codex.

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 codesize

README.md
[![agentmods](https://agentmods.dev/badge/skills/open-vela/.claude/codesize.svg)](https://agentmods.dev/skills/open-vela/.claude/codesize)
Your own site
<a href="https://agentmods.dev/skills/open-vela/.claude/codesize"><img src="https://agentmods.dev/badge/skills/open-vela/.claude/codesize.svg" alt="Measured on agentmods" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,749 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.
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.00054 $0.05749
Opus 5 $0.00027 $0.02874
Sonnet 5 $0.00011 $0.01150
Haiku 4.5 $0.00005 $0.00575

Measured 7d ago against content hash 5ebebc77a77f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

codesize 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 7d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/analyze_map_file.py, scripts/analyze_size_output.py, scripts/codesize_utils.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.

wget ${CI_ARTIFACTS_URL}/previous/codesize.txt -O /tmp/before.txt
skills/codesize/SKILL.md · 658 lines

How it starts

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

Codesize 分析 Skill

⚡ TL;DR 快速入门

# 方案1: 快速分析(推荐日常使用)
size -t path/to/*.a > /tmp/size.txt
python3 scripts/analyze_size_output.py /tmp/size.txt

# 方案2: 深度分析(符号级)
python3 scripts/analyze_map_file.py project.map --show-symbols

# 方案3: 版本对比
python3 scripts/compare_codesize.py before.txt after.txt

📋 目录


目标与适用场景

目标

分析嵌入式系统编译产物的代码大小,识别占用空间最大的模块,并提供优化建议。

核心能力

能力 说明
✅ 多架构支持 ARM Cortex-M、Xtensa (Audio/DSP)、RISC-V
✅ 自动过滤 排除 Discarded sections,只统计真正链接的代码
✅ 符号级分析 提取函数名/变量名,精确定位
✅ 版本对比 对比不同版本,高亮显著变化
✅ 多格式输出 Markdown/JSON/CSV,便于 CI/CD 集成

适用场景

  • 固件大小超标需要优化
  • 分析不同模块的代码占用情况
  • 对比不同版本的大小变化
  • 识别意外链接的代码和数据
  • 多核心系统分析 (AP + Audio 核心)
  • CI/CD 自动化检查

前置条件

必备文件

  • *.map - 链接器生成的 map 文件(最关键)
  • *.elf - 可执行文件
  • *.a - 静态库文件(用于 size 分析)

架构支持

  • ARM Cortex-M:识别 .ARM.* sections
  • Xtensa:识别 .xt.* sections
  • RISC-V:识别 .riscv.* sections

Vela/NuttX 项目路径配置

典型目录结构

Vela/NuttX 项目通常采用以下目录结构:

<project_root>/              # 项目根目录 (如 ~/ssd/vela_xxx/)
├── out/                     # 编译输出目录
│   ├── <platform>/          # 平台构建目录 (单核或主核心)
│   ├── <platform>_audio/    # Audio 核心 (多核系统)
│   ├── <platform>_cp/       # CP 核心 (多核系统)
│   └── <platform>_sensor/   # Sensor 核心 (多核系统)
└── prebuilts/               # 预编译工具链
    ├── clang-arm/           # LLVM ARM 工具链
    ├── clang-xtensa/        # LLVM Xtensa 工具链
    └── gcc/                 # GCC 工具链 (ARM/RISC-V)
编译产物位置 (out/)

每个平台/核心的输出目录包含以下文件:

文件类型 文件名模式 用途 典型大小
ELF 可执行文件 vela_*.elfnuttx 符号级调试、size 分析 10-50M
链接器 Map 文件 vela_*.mapnuttx.mapSystem.map 深度分析(推荐) 10-50M
二进制镜像 vela_*.binnuttx.bin 烧录镜像 2-10M
静态库 apps/**/*.alibs/**/*.a size 快速分析 各异

Read the full file on GitHub · 658 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 7d ago First seen · 658 lines · 54 tokens per session scan A 5ebebc77a77f

Subscribe to this mod's changes

codesize is a skill published in the GitHub repository open-vela/.claude (5 stars, last pushed 6d ago), licensed Apache-2.0. It adds 54 tokens to every session and 5,749 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

gke-ai-troubleshooting-tpu-dynamic-slices-monitoring

Monitors, troubleshoots, and manages GKE TPU Dynamic Slices custom resources. Use when checking TPU slice lifecycle states, troubleshooting slice provisioning failures, validating single-slice or multi-slice (JobSet) workload manifests, or safely patching stuck finalizers and disabling the slice controller. Don't use…

google/skills · 107 tokens

gke-ai-troubleshooting-tpu-vbar-oom

Diagnoses and prevents vbarcontrolagent segfaults, out-of-memory (OOM) errors, and TPU device initialization failures on TPU v6e nodes in GKE caused by race conditions during TPU device resets or high-frequency metrics polling. Use when troubleshooting vbarcontrolagent crashes, memory cgroup OOMs in serial console…

google/skills · 125 tokens

competition-firmware-layout

Internal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for firmware images, partition tables, boot chains, update packages, extracted filesystems, embedded configs, and device-facing trust boundaries. Use when the user asks to unpack firmware, map partition layout, inspect bootloader or init…

zhaoxuya520/reverse-skill · 110 tokens

doca-flow

Build and debug DOCA Flow applications on supported NVIDIA NICs/DPUs: define match/action pipes, initialize ports and representors, choose forwarding targets, validate pipes before hardware programming, read counters, match the Flow version to the installed DOCA release, and diagnose Flow API errors. Trigger on DOCA…

NVIDIA/skills · 140 tokens

diagnose-driver-install

Diagnose NVIDIA driver installation failures on DeepOps-managed nodes — nvidia-smi errors, "No devices were found", DKMS build failures, or GPU pods crash-looping. Use before reinstalling anything.

NVIDIA/deepops · 47 tokens

catc-troubleshoot

Catalyst Center troubleshooting workflows - device unreachable investigation, client connectivity issues, interface down analysis, site-wide outage triage, wireless roaming problems, integration with pyATS for CLI-level diagnostics. Use when a device is unreachable, a user reports connectivity problems, an interface…

automateyournetwork/netclaw · 74 tokens