power

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

A command for estimating power use, generating sleep and wake code, planning current measurements, and finding power-wasting patterns in firmware. It supports examples involving STM32 and nRF52840 devices and tools such as PPK2 and J-Link Energy Profiler.

In plain words
What is it for?
Use it to analyze power budgets, configure low-power modes, prepare measurements, and find issues such as polling loops or unused peripherals.
Why use it?
It helps identify excessive power use and compare firmware behavior with a battery-life target.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the power-management plugin — 1 skill, 1 command, 1 agent shipped together

Good fit Use it to analyze power budgets, configure low-power modes, prepare measurements, and find issues such as polling loops or unused peripherals.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/hermeticormus/libreembed-claude-code/power"><img src="https://agentmods.dev/badge/commands/hermeticormus/libreembed-claude-code/power.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 811 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.00811
Opus 5.5 $0.00010 $0.00324
Sonnet 5.5 $0.00005 $0.00162
Haiku 4.5 $0.00003 $0.00081

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

Security

Grade A, and why

power 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/power-management/commands/power.md · 101 lines

How it starts

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

/power

Power management command: sleep mode configuration, power budget, measurement, optimization.

Trigger

/power <action> [options]

Actions

analyze

Analyze power consumption from a power profile or estimate from code.

/power analyze --mcu stm32l476 --active-current 8mA --active-ms 100 --interval-s 60
/power analyze --battery cr2032 --target-days 365

configure

Generate sleep mode entry/exit code.

/power configure --mcu stm32l476 --mode stop2 --wakeup exti --pin PA0
/power configure --mcu stm32l476 --mode stop2 --wakeup rtc --interval 60s
/power configure --mcu nrf52840 --mode system-on-lp --wakeup gpio

measure

Generate measurement setup and current calculation guide.

/power measure --tool ppk2 --target nrf52840-dk
/power measure --tool jlink-energy --target stm32-nucleo
/power measure --tool shunt --resistance 100ohm

optimize

Analyze firmware for power anti-patterns.

/power optimize --source src/ --find "polling loops,floating gpio,unused peripherals"

Process

  1. Define active profile: duration, current, frequency.
  2. Define sleep current: measure with PPK2 or estimate from datasheet.
  3. Calculate average current.
  4. Divide battery capacity by average current for lifetime.
  5. Identify and eliminate the largest current consumers.

Output Examples

Stop2 entry/exit with RTC alarm

/* Complete entry sequence */
void go_to_sleep_for_ms(uint32_t ms)
{
    /* Disable unnecessary clocks */
    __HAL_RCC_SPI2_CLK_DISABLE();
    __HAL_RCC_USART1_CLK_DISABLE();

    /* Set RTC wakeup */
    HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, ms * 2 / 1000,
                                 RTC_WAKEUPCLOCK_RTCCLK_DIV2);

    /* Enter Stop 2 */
    HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);

    /* Wake: restore clock, re-init peripherals */
    HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
    SystemClock_Config();
    __HAL_RCC_SPI2_CLK_ENABLE();
    __HAL_RCC_USART1_CLK_ENABLE();
}

Battery lifetime calculation

CR2032: 220 mAh, 3.0V
Active: 12 mA for 80ms every 30s (sensor + BLE advertising)
Sleep:  1.8 µA in Stop 2

Duty cycle: 80ms / 30000ms = 0.00267
Avg current: 12 * 0.00267 + 0.0018 * 0.99733 = 0.0320 + 0.0018 = 0.0338 mA

Lifetime: 220 / 0.0338 = 6509 hours = 271 days

Read the full file on GitHub · 101 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 · 101 lines · 25 tokens per session scan A 4421368748e4

Subscribe to this mod's changes

power 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 811 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.