context-usage
by Melodic Software · ★ 32 · updated 4 days ago
Per-session context-window observability. A mod writes each session's context-window figures to a snapshot file and shows the person a toast and a transcript line when the context zone (light, moderate or heavy, from bands in zones.json) worsens; with model_notices on (off by default) it also tells Claude the zone at each crossing, approach and compaction. /context-usage prints status and...
Install
/plugin marketplace add melodic-software/claude-code-plugins/plugin install context-usage@melodic-softwareThen run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.
What it hooks into
From an automated scan with claude plugin validate, not a security review. Mods run with your permissions; read the code before installing.
- Events
session.startsession.endsession.compactprompt.submitsession.measureturn.startturn.completecommand.runui.rendertool.call- API calls
$.clock.every$.clock.now$.command.register$.env.get$.fs.exists$.fs.list$.fs.read$.fs.stat$.process.run$.prompt.read$.prompt.suggest$.session.id$.session.root$.session.surfaces$.session.turns$.session.usage$.session.version$.tool.list$.tool.register$.ui.invalidate$.ui.log$.ui.resolve$.ui.toast- Draws
AbovePrompt- Can see
compactionevery promptevery tool call- Reach
- level 2 of 3 runs processesdrives Claudewrites the prompt boxreads filesreads env varsreads the prompt boxdraws
Origin
- How it got here
- Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
- Repository
- github.com/melodic-software/claude-code-plugins
- Path in repo
plugins/context-usage- Source commit
de8213cthe exact code the scan read- Author
- Melodic Software @melodic-software
- License
- MIT
- First published
- Last pushed
- First listed here
Name and description come from the mod's own manifest. We link to the code; we don't host it, and it stays under its author's license.
More from melodic-software/claude-code-plugins
context-budget
melodic-software/claude-code-plugins
Measures a Claude Code session's fixed startup context payload per item at a pinned binary version, including per-tool attribution of the built-in tool pools that /context reports only as totals, derived by A/B deny differencing. Falls back from an SDK meter to a headless /context parser, then to an error rather than a wrong number. Keeps a before/after ledger per lever. Shows a live context...
desktop-notification
melodic-software/claude-code-plugins
Alert you when Claude Code needs input: an audible terminal bell, an OSC 9 terminal notification, and an OS-native toast (macOS/Linux) on permission and idle prompts.
display-redaction
melodic-software/claude-code-plugins
A mod that masks email addresses and secret-shaped text in what Claude Code draws, for recordings and screen shares. It changes the screen only; the transcript, the model's context and the files on disk are untouched, so it is not a privacy or data control.
harness-ops
melodic-software/claude-code-plugins
Claude Code operations: audit-skill-visibility (skills the listing budget hides), inventory (every invocable surface), audit-install-state, audit-performance (slowness), audit-mod-posture (mods and the guard), audit-native-overlap (skills duplicating built-ins), observability (telemetry), known-issues, changelog, behavior-probes, prerequisites, check, machine-profile, plugins (update the...
plugin-profiles
melodic-software/claude-code-plugins
Switch which installed plugins are on with named profiles: one YAML file per profile, shipped, per user and per repository. A command-line tool previews each change, checks required prerequisites, writes only plugin and hidden-skill entries to a folder, user settings or a one-session file, and clear restores the file. A /plugin-profile command switches inside a session, a session-start notice...
rate-limits
melodic-software/claude-code-plugins
Rate-limit windows for loop lanes and Claude: a hooks module writes the subscription rate-limit windows to a fixed machine-scope file and toasts window changes (telling Claude too only with model_notices on, off by default), a StopFailure hook records rate-limit stops reactively, and a reader contract fixes how consuming sessions pause and resume.
session-telemetry
melodic-software/claude-code-plugins
Collects telemetry about each Claude Code session (hook runs, session events and skill use) from this plugin's hooks and from any plugin's hook-telemetry producers, for later analysis.