memory-budgeting

memory-budgeting is a skill for Claude Code from wedsamuel1230/arduino-skills. It costs 50 tokens per session (624 once invoked), scanned A, original, MIT.

A method for measuring and managing the memory used by Arduino and other embedded projects. It separates memory for program code, data, heap, task stacks, files, and wireless update space.

In plain words
What is it for?
Use it to investigate SRAM, flash, heap, stack, JSON-buffer, OTA, or performance limits, and to review buffer sizes, string usage, compiler reports, and runtime memory checks.
Why use it?
Small devices can fail when one memory area runs out even if another still has room. This helps replace guesses with measured budgets and enough safety margin.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the arduino-skills plugin — 33 skills shipped together

Good fit Use it to investigate SRAM, flash, heap, stack, JSON-buffer, OTA, or performance limits, and to review buffer sizes, string usage, compiler reports, and runtime memory checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wedsamuel1230/arduino-skills/memory-budgeting
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add wedsamuel1230/arduino-skills --skill memory-budgeting
Clone the repo
git clone --depth 1 https://github.com/wedsamuel1230/arduino-skills

Made for: Claude Code.

Or install arduino-skills, the plugin that ships this one along with the rest of its 33 skills.

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 memory-budgeting

README.md
[![agentmods](https://agentmods.dev/badge/skills/wedsamuel1230/arduino-skills/memory-budgeting/github.svg)](https://agentmods.dev/skills/wedsamuel1230/arduino-skills/memory-budgeting)
Your own site
<a href="https://agentmods.dev/skills/wedsamuel1230/arduino-skills/memory-budgeting"><img src="https://agentmods.dev/badge/skills/wedsamuel1230/arduino-skills/memory-budgeting/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 memory-budgeting

Your own site · 80×15
<a href="https://agentmods.dev/skills/wedsamuel1230/arduino-skills/memory-budgeting"><img src="https://agentmods.dev/badge/skills/wedsamuel1230/arduino-skills/memory-budgeting.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 624 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00050 $0.00624
Opus 5 $0.00025 $0.00312
Sonnet 5 $0.00010 $0.00125
Haiku 4.5 $0.00005 $0.00062

Measured 12d ago against content hash 1b579b94ebdb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

memory-budgeting scanned grade A with 0 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 12d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/memory-budgeting/SKILL.md · 59 lines

How it starts

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

Memory Budgeting

Make memory a measured budget, not a nominal board label. The implementation is embedded C/C++; scripts may parse build or runtime logs when that is the useful deterministic tool.

Intake

Record exact board/module, flash/RAM/EEPROM/PSRAM, bootloader and partition layout, framework, compiler flags, libraries, static buffers, task stacks, filesystem/OTA needs, peak protocol sizes, and available measurement output.

Process

  1. Separate static data, code/flash, heap, task stacks, interrupt state, filesystem, bootloader, and OTA/update slots.
  2. Establish a numeric budget and minimum margin for every category. Use board references rather than copying a family-level number into a project claim.
  3. Capture compiler size output and map changes to a feature or dependency.
  4. Measure runtime free heap, largest block, stack high-water marks, and reset/ allocation failures under representative load where the framework exposes them.
  5. On AVR, keep literals in flash with F() where appropriate, prefer bounded buffers and fixed-size storage, and avoid unbounded dynamic String use. On ESP32/RP2040, still bound buffers and distinguish heap, stack, flash, and filesystem.
  6. Re-run the stress case after each memory-affecting change and record the tradeoff.

Anti-rationalization

Shortcut Response
"The datasheet says 520 KB, so memory is fine." Separate usable heap, stacks, reserved regions, and radio/RTOS use.
"It compiled." Inspect size output and exercise runtime allocation paths.
"Make the buffer bigger." Bound the protocol and prove the required maximum.
"Use String everywhere." Check fragmentation and lifetime; use bounded alternatives where needed.
"OTA only needs the application image." Budget both update slots, bootloader, metadata, and rollback image.

Verification

  • Build-size output and runtime memory evidence name the exact target/version.
  • Each budget has a margin and a failure response.
  • Stress tests cover peak message, sensor, logging, radio, and task load as applicable.
  • Optimization does not remove bounds, safety checks, or recovery behavior.

Read the full file on GitHub · 59 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. 12d ago First seen · 59 lines · 50 tokens per session scan A 1b579b94ebdb

Subscribe to this mod's changes

memory-budgeting is a skill published in the GitHub repository wedsamuel1230/arduino-skills (21 stars, last pushed 23d ago), licensed MIT. It adds 50 tokens to every session and 624 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

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

analyze-kernel-bottleneck

Systematically identify whether a GPU kernel is compute-bound, memory-bound, or latency-bound using roofline analysis, occupancy calculations, compute/load ratio per tile, and SASS instruction inspection. Produces a decision matrix for optimization strategy selection (cp.async, warp interleaving, tiling…

pjt222/agent-almanac · 77 tokens

mcubuddy

Use when debugging MCU firmware or boards with McuBuddy, including probe, boot, HardFault, peripheral, register, memory, ELF/SVD, RTOS, RTT/UART, Keil, GDB, pyOCD, J-Link, ST-Link, or CMSIS-DAP work.

cunjun/McuBuddy · 64 tokens

cleverence-mslx

A guide for editing Cleverence Mobile SMARTS configuration files used by handheld warehouse and shop terminals. Each .mslx file describes a workflow as a sequence of actions connected like a directed graph.

Desko77/cursor-1c-skills · 7 tokens

fpga-hardware-design-and-review-guide

Comprehensive FPGA hardware design guide based on real-world project experience. Covers pipeline architecture, timing optimization, SystemVerilog coding patterns, CDC handling, and practical debugging techniques. Use this skill when: (1) designing FPGA modules with timing constraints, (2) implementing video processing…

cobbpeng/fpga-hardware-design-and-review-guide · 99 tokens