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.
git clone --depth 1 https://github.com/open-vela/.claudenpx agentmods add skills/open-vela/.claude/codesizeWrote 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.
[](https://agentmods.dev/skills/open-vela/.claude/codesize)<a href="https://agentmods.dev/skills/open-vela/.claude/codesize"><img src="https://agentmods.dev/badge/skills/open-vela/.claude/codesize/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.
<a href="https://agentmods.dev/skills/open-vela/.claude/codesize"><img src="https://agentmods.dev/badge/skills/open-vela/.claude/codesize.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00054 | $0.05749 |
| Opus 5.5 | $0.00022 | $0.02300 |
| Sonnet 5.5 | $0.00011 | $0.01150 |
| Haiku 4.5 | $0.00005 | $0.00575 |
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 3mo ago.
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 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 快速分析 | 各异 |
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.
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.
- 3mo ago First seen · 658 lines · 54 tokens per session scan A 5ebebc77a77f
codesize is a skill published in the GitHub repository open-vela/.claude (6 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 54 tokens to every session and 5,749 once invoked, about $0.0002 per session on Opus 5.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.
codesize compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| codesizeopen-vela/.claude | Skill | 6 | 2mo ago | Apache-2.0 | A | 54 | Claude Code, Codex |
| gke-ai-troubleshooting-tpu-dynamic-slices-monitoringgoogle/skills | Skill | 25k | today | Apache-2.0 | A | 107 | Claude Code, Codex |
| gke-ai-troubleshooting-tpu-vbar-oomgoogle/skills | Skill | 25k | today | Apache-2.0 | A | 125 | Claude Code, Codex |
| doca-flowNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 224 | Claude Code |
| competition-firmware-layoutzhaoxuya520/reverse-skill | Skill | 46k | 17d ago | MIT | A | 110 | Codex |
| diagnose-driver-installNVIDIA/deepops | Skill | 1.5k | today | BSD-3-Clause | A | 47 | Claude Code, Codex |
| catc-troubleshootautomateyournetwork/netclaw | Skill | 740 | today | Apache-2.0 | A | 114 | Claude Code |