ClaudeCodeMod

All shelves / Mods / Usage

context-guard

By melodic-software

context-guard is a Claude Code usage mod by melodic-software.

Shows a toast when the session's context crosses into a worse zone, smart, acceptable, or dumb, and can draw the zone and percent in a row above the prompt.

Draws

Install

The marketplace name is melodic-software.

In Claude Code
/plugin marketplace add melodic-software/claude-code-plugins
/plugin install context-guard@melodic-software
Open the repo

It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.

Version
1.1.4
License
MIT
Repo stars
28
Last change
2026-10-29

What it can reach

  • Draws in the session
  • Reads usage or context figures
  • Calls another program on this machine

Needs a Claude Code build that can run mods, and Node.js on PATH, installed on its own, for the snapshot writes and the PostCompact marker. The marker and the zone resolver run on Bash, Git Bash on native Windows, and the resolver needs jq. The shipped zones are smart up to 50% used, acceptable up to 75%, and dumb above, combined with token bands for the window, and ~/.claude/context-guard/zones.json can change them. A compacted session counts as dumb. At a crossing, a 4-second toast offers continue, /compact, /clear, or a handoff. Lines to Claude are off by default and need model_notices. The band row is off by default. /context-guard band on turns it on for the session, and /context-guard prints the verdict and figures. Claude can call mcp__context-guard__status for the exact figures. The module writes ~/.claude/context-guard/context/<session_id>.json by running node, and prunes files older than 14 days. No part of the plugin denies a tool call. No run was made in the Desktop app, VS Code, or a cloud session. Install at user scope. The plugin README's own install line names context-guard@<marketplace>.

The marketplace name is melodic-software, the same marketplace as context-budget and display-redaction. This one installs on its own. The repository README gives one install line for every plugin, /plugin install <plugin-name>@melodic-software; this page puts this plugin's name in that line. How full the context is is why this page files it under usage. context-budget draws what the context is made of, by category. token-weather draws a one-line forecast of the context window above the prompt. This one names three zones and tells you once when the session crosses into a worse one, and writes the zone to a file that status lines and other sessions can read.

Demo

The command, band row and status tool section of the context-guard README: /context-guard prints the zone verdict and its figures, /context-guard band on shows context-guard: <zone> <n>% above the prompt, and Claude can call the status tool for the exact figures.
Screenshot of the author's GitHub page.

What it hooks into

  • session.startWhen a session starts
  • session.endWhen a session ends
  • session.compactWhen the context is compacted
  • prompt.submitWhen you send a prompt
  • session.measureWhen usage is measured
  • turn.startWhen Claude starts a turn
  • turn.completeWhen a turn ends
  • command.runWhen you run its slash command/context-guard
  • ui.renderDraws into the sessionAbovePrompt
  • tool.callAround a tool call, where it can hold one

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Slash commands 1

  • /context-guardContext zone status and details; band on or off sets the band row for this session, bare band toggles it

Hooks 2

  • SessionStart · startup|resume|clear|forksh "${CLAUDE_PLUGIN_ROOT}/lib/prerequisites.sh" node-notice /context-guard:check CONTEXT_GUARD_HOOKS_ENABLED; ${PPID:+exit}; powershell -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_PLUGIN_ROOT}/lib/prerequisites.ps1" node-notice /context-guard:check CONTEXT_GUARD_HOOKS_ENABLED
  • PostCompactnode

Files

The author's README and source, 5 files. They load when you open them.

Facts

Author
melodic-software
Category
Usage
Marketplace
melodic-software
Repo
melodic-software/claude-code-plugins
Folder
plugins/context-guard
Version
1.1.4
License
MIT
Repo stars
28
Last change
2026-10-29
Language
Shell
Files
31

Same repo on other shelves

Skills

  1. 20728design-thinkingmelodic-software/claude-code-plugins264
  2. 22318plantuml-syntaxmelodic-software/claude-code-plugins212
  3. 23438architecture-documentationmelodic-software/claude-code-plugins181

Marketplaces

  1. 658melodic-software/claude-code-pluginsmelodic-software/claude-code-pluginsClaude Code plugin marketplace: repo-agnostic skills, hooks, agents, and MCP servers.32

Other mods in Usage

rate-limit-guardmelodic-softwareShows a toast when the account's 5-hour or 7-day rate-limit window reaches 90% or 95% and when it resets, and can draw both windows in a row above the prompt.orca-quotamutlumehmetDraws the 5-hour and 7-day usage of every Claude account on this machine in one band above the prompt, and warns once before the current account hits its limit.context-keepermishgoldenbergOpens a pane of what fills the context window with tips to trim it, and saves a handoff note of the goal, decisions, files, and TODOs to .claude/checkpoints/.usage-metermishgoldenbergOpens a pane of the 5-hour and 7-day plan limits with reset countdowns, burn rate and when a limit fills, session cost, cache hit ratio, and tokens per turn.usage-quotaanantraghunathDraws the 5-hour and weekly limits with a forecast at reset and the context window above the prompt, with a Compact button and Auto compact at a set percent.usage-graphdonvitoDraws cards above the prompt for the 5-hour limit, the weekly limit, and the context window, each with its percentage, a bar, and when it resets.wavy-usageBatuhanCakmakkDraws liquid-filled rings above the prompt for the 5-hour and 7-day limits, the context, and the prompt cache, a jet for the effort, and a pane of recent turns.usage-band-modjonathanlocksDraws one line above the prompt with the model, session cost, context, the 5-hour and weekly limits, and a per-model weekly limit, led by a pixel crab mascot.usage-statsconnorchuang32Opens /usage-stats in the desktop app: a heat map of tokens per day, trends and models tabs, and a Wrapped-style card you can save as an SVG.session-infodougcunhaHolds a commandOpens a pane of the session: context, cost, prompt cache, plan usage, agents, checks, CI runs, and Git, and holds a prompt that would rewrite an expired cache.ccbaremaballarinDraws a quiet band above the prompt: model and effort, the GitHub repo and branch with lines changed, a context bar split as /context, tokens, and plan limits.token-monitor-hudfractal-manifoldDraws the 5-hour and 7-day windows above the prompt with reset times and where each lands at this pace, plus Codex and Antigravity quotas if they're signed in.
All 183 in Usage