power-budget

power-budget is a command for Claude Code from captainluzik/oh-my-embedded. It costs 8 tokens per session (1,291 once invoked), scanned A, original, MIT.

A command workflow that estimates an embedded project's electricity use from its source code and hardware files. It produces current estimates for parts of the system, a total, and a battery or power-supply recommendation.

In plain words
What is it for?
Use it to estimate subsystem current, calculate battery runtime from a capacity, override the supply voltage, and include deep-sleep estimates.
Why use it?
It gathers power-related details from common project files so you can estimate consumption without manually inspecting every peripheral and component.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Good fit Use it to estimate subsystem current, calculate battery runtime from a capacity, override the supply voltage, and include deep-sleep estimates.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/captainluzik/oh-my-embedded/power-budget
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/captainluzik/oh-my-embedded

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 power-budget

README.md
[![agentmods](https://agentmods.dev/badge/commands/captainluzik/oh-my-embedded/power-budget.svg)](https://agentmods.dev/commands/captainluzik/oh-my-embedded/power-budget)
Your own site
<a href="https://agentmods.dev/commands/captainluzik/oh-my-embedded/power-budget"><img src="https://agentmods.dev/badge/commands/captainluzik/oh-my-embedded/power-budget.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 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,291 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.00008 $0.01291
Opus 5 $0.00004 $0.00646
Sonnet 5 $0.00002 $0.00258
Haiku 4.5 $0.00001 $0.00129

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

Security

Grade A, and why

power-budget 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 8d 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.

commands/power-budget.md · 114 lines

How it starts

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

Analyze the project source files and hardware configuration to produce a power budget: estimated current draw per subsystem, total consumption, and a battery or supply recommendation.

Arguments

$ARGUMENTS may contain:

  • A battery capacity in mAh (e.g. 2000mAh, 3000) to calculate runtime.
  • A supply voltage (e.g. 3.3V, 5V) to override the detected value.
  • The keyword sleep to include deep-sleep / low-power mode estimates.

Step 1: Detect supply voltage

Check in order:

  1. sdkconfig for CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ and power-related keys.
  2. platformio.ini for board_build.f_cpu or board name.
  3. Schematic files (*.kicad_sch) for a VCC or 3V3 power symbol.
  4. Source files for voltage regulator part numbers (e.g. AMS1117-3.3, AP2112K).

If $ARGUMENTS specifies a voltage, use that. Otherwise state the detected voltage or default to 3.3V.

Step 2: Identify active peripherals

Scan source files (.c, .cpp, .h, main/, src/, components/) for:

Pattern to look for Peripheral
wifi_init, esp_wifi_start, WiFi.begin Wi-Fi radio
bluetooth, esp_bt_, BLEDevice Bluetooth/BLE
i2c_master, Wire.begin I2C bus
spi_bus_initialize, SPI.begin SPI bus
uart_driver_install, Serial.begin UART
adc_oneshot, analogRead ADC
ledc_, analogWrite, PWM PWM / LED driver
gpio_set_level, digitalWrite GPIO outputs
esp_sleep_enable, LowPower. Sleep modes
Display driver names (SSD1306, ILI9341, ST7789) Display
Sensor names (BME280, MPU6050, DS18B20) Sensors
Motor driver names (DRV8833, L298N, TMC2209) Motor drivers

List every peripheral found.

Step 3: Estimate current draw

Use these reference values (typical, at 3.3V unless noted):

Peripheral Active current Sleep/idle current
ESP32 (CPU active, 240MHz) 80 mA -
ESP32 deep sleep - 0.01 mA
ESP32 Wi-Fi TX +170 mA peak, ~80 mA avg -
ESP32 Bluetooth active +30 mA -
STM32F1 (72MHz) 36 mA -
STM32 stop mode - 0.5 mA
SSD1306 OLED (128x64) 15 mA 0.5 mA
ILI9341 TFT (backlight on) 40 mA 1 mA
BME280 sensor 0.7 mA (forced mode) 0.001 mA
MPU6050 IMU 3.9 mA 0.005 mA
DS18B20 temperature 1.5 mA (conversion) 0.001 mA
Generic I2C device 1 mA -
GPIO output (LED, 3.3V, 330R) 10 mA per LED -
DRV8833 motor driver 1.2 A peak (motor dependent) 1 mA

Read the full file on GitHub · 114 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. 8d ago First seen · 114 lines · 8 tokens per session scan A 40e85d92da28

Subscribe to this mod's changes

power-budget is a command published in the GitHub repository captainluzik/oh-my-embedded (24 stars, last pushed 6mo ago), licensed MIT. It adds 8 tokens to every session and 1,291 once invoked, about $0.0000 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-30.