resource-optimization-lowend

resource-optimization-lowend is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 67 tokens per session (897 once invoked), scanned A, original, MIT.

A guide to reducing firmware size and memory use on small embedded devices. It explains how to measure flash, RAM, and stack usage and adjust compiler and linker settings.

In plain words
What is it for?
Use it to inspect linker map files, find code and data that take the most space, and balance program size against execution speed.
Why use it?
It helps when firmware is too large for the device, runs out of RAM, or overflows its stack.

Skill for Claude CodeCodex

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

Good fit Use it to inspect linker map files, find code and data that take the most space, and balance program size against execution speed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/resource-optimization-lowend
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 mohitmishra786/low-level-dev-skills --skill resource-optimization-lowend
Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills

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 resource-optimization-lowend

README.md
[![agentmods](https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/resource-optimization-lowend/github.svg)](https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/resource-optimization-lowend)
Your own site
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/resource-optimization-lowend"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/resource-optimization-lowend/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 resource-optimization-lowend

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/resource-optimization-lowend"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/resource-optimization-lowend.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 897 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00067 $0.00897
Opus 5 $0.00034 $0.00449
Sonnet 5 $0.00013 $0.00179
Haiku 4.5 $0.00007 $0.00090

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

Security

Grade A, and why

resource-optimization-lowend 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 9d 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/qemu/resource-optimization-lowend/SKILL.md · 117 lines

How it starts

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

Resource Optimization (Low-End Systems)

Purpose

Guide agents through flash and RAM optimization on constrained devices: compiler size flags, linker map analysis, stack usage measurement, dead code elimination, and size-vs-speed tradeoffs — for bare-metal and small RTOS images.

When to Use

  • Firmware exceeds flash budget
  • Stack overflow in production only
  • Choosing -Os vs -O2 on MCU
  • Finding unexpected .rodata or .bss growth

Workflow

1. Size measurement toolchain

arm-none-eabi-size -A firmware.elf
arm-none-eabi-objdump -h firmware.elf
nm --size-sort -S firmware.elf | tail -20

2. Linker map file

/* linker.ld */
OUTPUT_FORMAT("elf32-littlearm")
ENTRY(Reset_Handler)

SECTIONS
{
  /* ... */
}

/* Generate map */
/* gcc ... -Wl,-Map=firmware.map */
grep -E '\.text|\.rodata|\.data|\.bss' firmware.map | head

Identify largest symbols and unexpected library pull-in.

3. Compiler flags

Flag Effect
-Os Size-first optimization
-ffunction-sections -fdata-sections Per-symbol sections
-Wl,--gc-sections Drop unused sections
-flto Cross-TU dead code elimination
-specs=nano.specs Smaller newlib (GCC ARM)
CFLAGS += -Os -ffunction-sections -fdata-sections
LDFLAGS += -Wl,--gc-sections -Wl,--print-memory-usage

4. Stack analysis

# Static (if built with -fstack-usage)
find . -name '*.su' -exec cat {} \;

# Linker stack symbol
grep _estack firmware.map

Runtime: fill stack with pattern (0xDEADBEEF), run tests, scan high-water mark. FreeRTOS: uxTaskGetStackHighWaterMark.

5. RAM categories

Section Tactic
.bss Shrink buffers; pool allocators
.data Move const to flash (const.rodata)
Heap Avoid malloc; fixed pools
Stack Reduce nesting; smaller ISR stacks

6. Size vs speed decision

Hot path in ISR or 1 kHz loop?
├── Yes → -O2 for that file (#pragma GCC optimize)
└── No  → -Os globally

Read the full file on GitHub · 117 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. 9d ago First seen · 117 lines · 67 tokens per session scan A db44ea86ac1b

Subscribe to this mod's changes

resource-optimization-lowend is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (203 stars, last pushed 2mo ago), licensed MIT. It adds 67 tokens to every session and 897 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-09-03.