@hu9osaez/commandcode-hud
v0.1.0
Published
One-shot npx installer + native Command Code mod showing model, reasoning effort, context usage and Git branch in the mods status line.
Maintainers
Readme
commandcode-hud
Native Command Code mod that shows workspace and session state in the mods status line, right below the native footer.
gpt-5.6-luna 🧠 xhigh · ctx 4% · 46.8k/1M · mainWhat it shows
- Model selected and reasoning effort (
🧠 effort). - Context used / limit (
ctx % · used/limit), computed fromusage.inputTokensof themodel_request_endevent and the model's context window (all 52 official models). - Current Git branch (or
no-branchwhen not in a repository). - State is persisted and restored when reopening a session or switching sessions.
The mod publishes a single line via cmd.ui.setStatus; the native permission/shortcuts/taste rows are never replaced.
Usage
Run it once with npx — no global install needed:
npx @hu9osaez/commandcode-hudThis installs (or overwrites) the mod at ~/.commandcode/mods/commandcode-hud.ts and verifies the install.
Other commands:
npx @hu9osaez/commandcode-hud --verify # Check the installed mod matches this package
npx @hu9osaez/commandcode-hud --uninstall # Remove the installed mod
npx @hu9osaez/commandcode-hud --help # Show usageManual install
mkdir -p ~/.commandcode/mods
cp commandcode-hud.mod.ts ~/.commandcode/mods/commandcode-hud.tsVerification
cmd mods listYou should see:
commandcode-hud · user · ~/.commandcode/mods/commandcode-hud.tsThen start a new session:
cmdThe HUD appears as the mod status line, below the Command Code input.
Sessions
/reloadreloads the mod in the current session./resumerestores an existing session./newstarts a new session.
The mod persists its latest model, effort, context usage and branch via cmd.session.appendCustomEntry.
Context segment
- Used:
usage.inputTokensfrom themodel_request_endevent (the same source the TUI uses for current context). - Limit: per-model
contextWindowmap (mirror of Command Code's official registry). IDs matchcmd --list-models/config.json. - If the model is not in the map, the
ctxsegment is omitted instead of showing a made-up value.
Command Code 1.14.1 limitations
- There is no public event for the
/modelcommand: a model change is reflected right before the next model request, not necessarily the instant/modelruns. The mod compensates by watching~/.commandcode/config.jsonand updating when it detects the change. cmd.ui.widgetexists in the API but does not render in 1.14.1.cmd.ui.setStatusis the supported surface.
Development
# Exercise mod helpers (branch, model, context limits)
node --input-type=module -e "const m = await import('./commandcode-hud.mod.ts'); console.log(m.__test)"License
MIT.
