bare-metal

bare-metal is a command for Claude Code from HermeticOrmus/LibreEmbed-Claude-Code. It costs 22 tokens per session (1,006 once invoked), scanned A, original, MIT.

A command for creating and examining firmware that runs directly on a microcontroller without a hardware abstraction layer. It can scaffold a project, inspect memory usage, and prepare flash commands.

In plain words
What is it for?
Use it to create startup files and linker settings, analyze map or executable files, reduce code size, and generate commands for programming flash memory.
Why use it?
It reduces setup work and helps find why a firmware image is too large for the chip's flash or RAM.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the bare-metal plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it to create startup files and linker settings, analyze map or executable files, reduce code size, and generate commands for programming flash memory.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/hermeticormus/libreembed-claude-code/bare-metal
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.

Clone the repo
git clone --depth 1 https://github.com/HermeticOrmus/LibreEmbed-Claude-Code

Made for: Claude Code.

Or install bare-metal, the plugin that ships this one along with the rest of its 1 skill, 1 command, 1 agent.

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 bare-metal

README.md
[![agentmods](https://agentmods.dev/badge/commands/hermeticormus/libreembed-claude-code/bare-metal/github.svg)](https://agentmods.dev/commands/hermeticormus/libreembed-claude-code/bare-metal)
Your own site
<a href="https://agentmods.dev/commands/hermeticormus/libreembed-claude-code/bare-metal"><img src="https://agentmods.dev/badge/commands/hermeticormus/libreembed-claude-code/bare-metal/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 bare-metal

Your own site · 80×15
<a href="https://agentmods.dev/commands/hermeticormus/libreembed-claude-code/bare-metal"><img src="https://agentmods.dev/badge/commands/hermeticormus/libreembed-claude-code/bare-metal.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,006 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.00022 $0.01006
Opus 5.5 $0.00009 $0.00402
Sonnet 5.5 $0.00004 $0.00201
Haiku 4.5 $0.00002 $0.00101

Measured 15d ago against content hash d44d857c1643, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

bare-metal 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 15d 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.

plugins/bare-metal/commands/bare-metal.md · 115 lines

How it starts

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

/bare-metal

Bare-metal firmware command: register-level drivers, linker scripts, startup code, and size analysis.

Trigger

/bare-metal <action> [options]

Actions

init

Generate a complete bare-metal project scaffold for a target MCU.

/bare-metal init --mcu stm32f407vg --flash 1024K --sram 128K --ccm 64K
/bare-metal init --mcu stm32f103c8 --flash 64K --sram 20K

Generates:

  • startup.c with Reset_Handler and weak default ISR aliases
  • <mcu>.ld linker script with MEMORY regions and SECTIONS
  • Makefile with arm-none-eabi-gcc flags (-Os -ffunction-sections --gc-sections)
  • main.c skeleton with SystemInit call and infinite loop

optimize

Analyze and reduce code/data size.

/bare-metal optimize --map firmware.map --target flash
/bare-metal optimize --elf firmware.elf --show-top 20

Actions:

  • Parse .map file for top consumers
  • Suggest __attribute__((optimize("Os"))) on hot paths that need size over speed
  • Identify padding bytes between sections
  • Check for -fno-exceptions and -fno-rtti if C++ is mixed in

analyze-map

Decode a linker map file.

/bare-metal analyze-map firmware.map
/bare-metal analyze-map firmware.map --section .text --min-size 512

Output: table of symbol, section, size, origin file, sorted descending.

flash

Generate flash commands for common programmers.

/bare-metal flash --tool openocd --interface stlink --target stm32f4x
/bare-metal flash --tool pyocd --target stm32f407
/bare-metal flash --tool jlink --device STM32F407VG

Process

  1. Confirm MCU part number (determines FLASH/SRAM sizes, peripheral base addresses).
  2. Check if CMSIS device headers are available (stm32f4xx.h or similar).
  3. Generate startup and linker script matching the target's memory map exactly.
  4. Verify with arm-none-eabi-size that sections fit within declared MEMORY regions.
  5. Add linker ASSERT statements to catch overflows at link time.

Output Examples

Flash + SRAM ASSERT in linker script

/* Fail at link time if firmware exceeds flash */
ASSERT(SIZEOF(.text) + SIZEOF(.data) < LENGTH(FLASH),
       "ERROR: Flash overflow")

ASSERT(SIZEOF(.data) + SIZEOF(.bss) < LENGTH(SRAM),
       "ERROR: SRAM overflow")

Read the full file on GitHub · 115 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. 15d ago First seen · 115 lines · 22 tokens per session scan A d44d857c1643

Subscribe to this mod's changes

bare-metal is a command published in the GitHub repository HermeticOrmus/LibreEmbed-Claude-Code (50 stars, last pushed 6d ago), licensed MIT. It adds 22 tokens to every session and 1,006 once invoked, about $0.0001 per session on Opus 5.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-10-01.