debug

debug is a command for Claude Code from BFRKQSB7/balance-hud. It costs 27 tokens per session (987 once invoked), scanned A, original, MIT.

A diagnostic command for Balance HUD, a Claude Code status display that shows context use, activity, and API balance information.

In plain words
What is it for?
Use it to troubleshoot provider detection, statusline setup, plugin files, balance snapshots, the balance updater, the watchdog, and simulated statusline output.
Why use it?
It helps find why the display or balance data is missing, stale, or not being loaded. It checks the configuration, background processes, startup protection, and a sample display update.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code; mentions OpenCode.

Part of the balance-hud plugin — 4 commands, 1 hook shipped together

Good fit Use it to troubleshoot provider detection, statusline setup, plugin files, balance snapshots…

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/bfrkqsb7/balance-hud/debug
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/BFRKQSB7/balance-hud

Made for: Claude Code.

Or install balance-hud, the plugin that ships this one along with the rest of its 4 commands, 1 hook.

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 debug

README.md
[![agentmods](https://agentmods.dev/badge/commands/bfrkqsb7/balance-hud/debug.svg)](https://agentmods.dev/commands/bfrkqsb7/balance-hud/debug)
Your own site
<a href="https://agentmods.dev/commands/bfrkqsb7/balance-hud/debug"><img src="https://agentmods.dev/badge/commands/bfrkqsb7/balance-hud/debug.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 987 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.00027 $0.00987
Opus 5 $0.00014 $0.00494
Sonnet 5 $0.00005 $0.00197
Haiku 4.5 $0.00003 $0.00099

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

Security

Grade A, and why

debug 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 6d 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/debug.md · 89 lines

How it starts

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

Diagnose Balance HUD

Run the self-diagnostic that mirrors exactly what Claude Code invokes on every statusline refresh, then fix whatever it flags.

Step 1: Run diagnostics

node "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/plugins/balance-hud/scripts/hud_debug.mjs"

The report covers:

Section What it verifies
Provider 分类 official Anthropic / DeepSeek / local proxy (ccswitch) / relay
isDeepSeekEnv whether the DeepSeek balance row should appear at all
statusLine 接线 statusLine present in settings.json and its target file exists
插件 version + all required files present
HUD 配置 config.json parses (else defaults)
余额快照 balance_usage.json freshness + whether it should display
余额 daemon auto_refresh running? stale pid file?
statusLine 看门狗 fix_statusline --watch running + startup item present
模拟渲染 end-to-end render with a synthetic statusline stdin payload

Step 2: Interpret ✗ (problem) lines

Fix each reported problem in order of impact:

  1. statusLine.command missingsettings.json was rewritten (e.g. by ccswitch) and the statusline was dropped, so Claude Code never invokes the HUD. Run the guard once:

    node "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/plugins/balance-hud/scripts/fix_statusline.mjs"
    

    If the watchdog (fix_statusline --watch) is not running either, it will recur. Start it (Windows startup item is at %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\balance-hud-statusline.vbs).

  2. statusLine target ✗ 不存在 — the command points at a file that no longer exists (e.g. plugin was reinstalled to a different path). Re-run /balance-hud:setup or correct statusLine.command in settings.json.

  3. 模型显示角色名而非真实模型 — only relevant on third-party relays (OpenCode Go etc.). The HUD resolves the real model via ANTHROPIC_DEFAULT_<ROLE>_MODEL_NAME env vars; if the report shows the role (claude-sonnet-4-6) instead of the real model, confirm the env mapping is set for that role and that dist/stdin.js resolveEnvModelAlias is present.

Read the full file on GitHub · 89 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. 6d ago First seen · 89 lines · 27 tokens per session scan A d9113d257bc8

Subscribe to this mod's changes

debug is a command published in the GitHub repository BFRKQSB7/balance-hud (2 stars, last pushed 21d ago), licensed MIT. It adds 27 tokens to every session and 987 once invoked, about $0.0001 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 commands, from other repositories