cortex-m

cortex-m is a command for Claude Code from HermeticOrmus/LibreEmbed-Claude-Code. It costs 25 tokens per session (1,195 once invoked), scanned A, original, MIT.

A command for developing ARM Cortex-M microcontrollers, a common family of chips used in embedded devices. It generates startup and memory files, configures core features, and explains processor faults.

In plain words
What is it for?
Use it to start an MCU project, configure interrupts or memory protection, set up timing, and decode fault registers and saved CPU state.
Why use it?
It removes much of the manual work involved in bringing up a new chip and interpreting crashes such as a HardFault.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the arm-cortex-m plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it to start an MCU project, configure interrupts or memory protection, set up timing, and decode fault registers and saved CPU state.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/hermeticormus/libreembed-claude-code/cortex-m
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 arm-cortex-m, 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 cortex-m

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/hermeticormus/libreembed-claude-code/cortex-m"><img src="https://agentmods.dev/badge/commands/hermeticormus/libreembed-claude-code/cortex-m.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 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,195 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.00025 $0.01195
Opus 5.5 $0.00010 $0.00478
Sonnet 5.5 $0.00005 $0.00239
Haiku 4.5 $0.00003 $0.00120

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

Security

Grade A, and why

cortex-m 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/arm-cortex-m/commands/cortex-m.md · 164 lines

How it starts

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

/cortex-m

ARM Cortex-M development command: startup code, linker scripts, peripheral configuration, and debug.

Trigger

/cortex-m <action> [options]

Actions

init

Generate startup code and linker script for a target MCU.

/cortex-m init --mcu stm32f407 --flash 1024K --sram 192K --ccm 64K
/cortex-m init --mcu nrf52840 --flash 1024K --sram 256K

Generates:

  • startup_stm32f407xx.s or .c (Reset_Handler, vector table, .data copy, .bss zeroing)
  • stm32f407.ld (MEMORY regions, SECTIONS with LMA/VMA separation)
  • system_init.c (clock tree, FPU enable, SysTick)

configure

Configure a specific Cortex-M subsystem.

/cortex-m configure --subsystem nvic --groups 4
/cortex-m configure --subsystem fpu --core m4
/cortex-m configure --subsystem mpu --guard-stack 0x20000000 --size 32
/cortex-m configure --subsystem systick --freq-hz 168000000 --tick-ms 1

debug

Analyze fault conditions and decode exception frames.

/cortex-m debug --fault hardfault
/cortex-m debug --fault memmanage
/cortex-m debug --decode-cfsr 0x00000082
/cortex-m debug --stack-frame 0x20001F00

Outputs: decoded CFSR/HFSR/BFAR/MMFAR, stacked register dump, fault cause in plain English.

benchmark

Generate DWT-based timing instrumentation.

/cortex-m benchmark --function my_dsp_filter --core m4
/cortex-m benchmark --isr uart_rx_handler --cycles

Process

  1. Confirm target core variant (determines available features: FPU, DSP, MPU regions, DWT).
  2. Read existing linker script and startup if present.
  3. Generate or modify requested artifact.
  4. Include barrier instructions (__DSB, __ISB) wherever system register writes occur.
  5. Verify generated ISR names against device header IRQn_Type enum.

Output Examples

Minimal linker script fragment (STM32F407, Cortex-M4)

MEMORY
{
  FLASH  (rx)  : ORIGIN = 0x08000000, LENGTH = 1024K
  SRAM   (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
  SRAM2  (rwx) : ORIGIN = 0x2001C000, LENGTH = 16K
  CCM    (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
}

_estack = ORIGIN(SRAM) + LENGTH(SRAM);

SECTIONS
{
  .isr_vector :
  {
    . = ALIGN(4);
    KEEP(*(.isr_vector))
    . = ALIGN(4);
  } > FLASH

  .text :
  {
    . = ALIGN(4);
    *(.text)
    *(.text*)
    *(.rodata)
    *(.rodata*)
    . = ALIGN(4);
    _etext = .;
  } > FLASH

  .data :
  {
    . = ALIGN(4);
    _sdata = .;
    *(.data)
    *(.data*)
    . = ALIGN(4);
    _edata = .;
  } > SRAM AT > FLASH

  _sidata = LOADADDR(.data);

  .bss :
  {
    . = ALIGN(4);
    _sbss = .;
    *(.bss)
    *(.bss*)
    *(COMMON)
    . = ALIGN(4);
    _ebss = .;
  } > SRAM
}

Read the full file on GitHub · 164 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 · 164 lines · 25 tokens per session scan A 289b2d7b82b5

Subscribe to this mod's changes

cortex-m is a command published in the GitHub repository HermeticOrmus/LibreEmbed-Claude-Code (50 stars, last pushed 6d ago), licensed MIT. It adds 25 tokens to every session and 1,195 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.