stm32-code-reviewer

stm32-code-reviewer is an agent for Claude Code from bahaabdelwahed/embedded-claude-plugin. It costs 351 tokens per session (1,658 once invoked), scanned A, original, MIT.

An automated reviewer for STM32 firmware, the software that runs on STM32 microcontrollers used in embedded devices.

In plain words
What is it for?
Use it to review STM32 application code, peripheral setup, interrupt priorities, DMA configuration, linker settings, and FreeRTOS settings, then regenerate the code with fixes applied.
Why use it?
It looks for configuration mistakes, timing and race problems, interrupt and DMA conflicts, memory risks, and security issues that can be difficult to spot by inspection.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to review STM32 application code, peripheral setup, interrupt priorities, DMA configuration, linker settings, and FreeRTOS settings, then regenerate the code with fixes applied.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/bahaabdelwahed/embedded-claude-plugin/stm32-code-reviewer
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/bahaabdelwahed/embedded-claude-plugin

Made for: Claude Code.

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 stm32-code-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/bahaabdelwahed/embedded-claude-plugin/stm32-code-reviewer.svg)](https://agentmods.dev/agents/bahaabdelwahed/embedded-claude-plugin/stm32-code-reviewer)
Your own site
<a href="https://agentmods.dev/agents/bahaabdelwahed/embedded-claude-plugin/stm32-code-reviewer"><img src="https://agentmods.dev/badge/agents/bahaabdelwahed/embedded-claude-plugin/stm32-code-reviewer.svg" alt="Measured on agentmods" height="20"></a>
Per session 351 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,658 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.00351 $0.01658
Opus 5 $0.00176 $0.00829
Sonnet 5 $0.00070 $0.00332
Haiku 4.5 $0.00035 $0.00166

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

Security

Grade A, and why

stm32-code-reviewer 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 7d 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.

agents/stm32-code-reviewer.md · 200 lines

How it starts

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

You are an expert embedded systems code reviewer and security auditor specializing in STM32 firmware. Your role is to find bugs, misconfigurations, and security issues in STM32 code, then regenerate the code with all fixes applied.

Core Responsibilities

  1. Detect register misconfigurations - Wrong clock settings, incorrect AF mapping, bad baud rate calculation
  2. Find timing and race conditions - ISR/main conflicts, missing volatile, read-modify-write races
  3. Identify interrupt priority problems - FreeRTOS boundary violations, priority inversion, missing handlers
  4. Detect DMA conflicts - Stream sharing, buffer placement in non-DMA memory, alignment issues
  5. Assess stack/heap overflow risks - Insufficient stack sizing, deep call chains, large local variables
  6. Scan for security issues - Unprotected flash, debug enabled in production, sensitive data exposure
  7. Regenerate code with all fixes applied

Review Process

Step 1: Read all relevant code files

Glob and read the source files to be reviewed. Identify:

  • Main application code
  • Peripheral initialization code
  • Interrupt handlers
  • Linker script
  • FreeRTOSConfig.h (if RTOS used)
  • HAL MSP initialization files

Step 2: Systematic review by category

Clock Configuration
  • Verify PLL settings produce intended frequency
  • Check flash wait states match HCLK (too few wait states = crashes)
  • Verify APB1/APB2 prescalers don't exceed max frequency
  • Check voltage regulator scale mode matches frequency (F4/F7)
  • Verify over-drive enabled if at max frequency (F4/F7)
Peripheral Initialization Order
  • Clock enable BEFORE register access (missing = bus fault)
  • GPIO config BEFORE peripheral enable
  • AF number matches datasheet (wrong AF = peripheral doesn't work)
  • NVIC configured AFTER peripheral setup
  • DMA configured BEFORE peripheral DMA enable bit
Interrupt Configuration
  • Priority group set once at startup (HAL_NVIC_SetPriorityGrouping)
  • All priorities within valid range for __NVIC_PRIO_BITS
  • FreeRTOS boundary: ISR priority >= configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY for any ISR calling FreeRTOS APIs
  • Every enabled interrupt has a handler
  • Shared IRQ handlers check ALL possible sources
  • Pending flags cleared before enabling

Read the full file on GitHub · 200 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. 7d ago First seen · 200 lines · 351 tokens per session scan A bd62517ebc21

Subscribe to this mod's changes

stm32-code-reviewer is an agent published in the GitHub repository bahaabdelwahed/embedded-claude-plugin (5 stars, last pushed 5mo ago), licensed MIT. It adds 351 tokens to every session and 1,658 once invoked, about $0.0018 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-31.

Related

Other agents, from other repositories

rtl-critic

Design review critic for RTL code quality, synthesizability, and coding style. Saves review reports to reviews/.md. (Opus). STA deferred to timing-advisor, power to power-analyzer, security to security-reviewer.

babyworm/rtl-agent-team · 51 tokens

rtl-architect

Architecture review oracle for RTL designs. Analyzes area/performance/power tradeoffs, saves review reports to reviews/.md with Mermaid diagrams. Every finding cites file:line. (Opus).

babyworm/rtl-agent-team · 44 tokens

design-quality-reviewer

Cross-phase design consistency auditor with objective traceability metrics and threshold-based PASS/FAIL. Produces reviews/phase-6-review/design-review.md. Verifies Spec→Arch→μArch→RTL hierarchical coherence. (Opus).

babyworm/rtl-agent-team · 51 tokens

protocol-reviewer

Bus protocol interface design reviewer. Reviews AXI/AHB/APB architecture choices, burst strategies, error handling, QoS, and interconnect topology. Produces review reports in reviews/.

babyworm/rtl-agent-team · 41 tokens

kicad-design-review-agent

Performs a thorough hardware design review of a KiCAD project. Triggers: full design review, audit everything, is my board ready for fab, comprehensive check, pre-fab review.

mixelpixx/Konnect · 45 tokens

driver-workflow

An end-to-end assistant workflow for developing NuttX device drivers, reviewing them, creating tests, or adapting AUTOSAR MCAL modules. NuttX is an operating system for embedded devices, and a device driver lets that system communicate with hardware.

open-vela/.claude · 93 tokens