context-guard

context-guard is a plugin for Claude Code from melodic-software/claude-code-plugins. Its token cost is not measured, scanned A, original, MIT.

A plugin that observes how much of each agent session's context window is being used and classifies that usage into smart, acceptable, or dumb zones. A context window is the amount of conversation and information the agent can consider at once.

In plain words
What is it for?
It is for recording per-session context usage, reporting worse zone changes, preserving evidence after compaction, and optionally blocking new changes when context is critically low.
Why use it?
It makes declining context capacity visible and can warn the operator when a session needs attention or a handoff.

Plugin for Claude Code

Written for Claude Code: a Claude Code plugin manifest.

Good fit It is for recording per-session context usage, reporting worse zone changes, preserving evidence after compaction, and optionally blocking new changes when context is critically low.

Compare 6 plugins from other repositories ↓
Install in Claude Code
/plugin marketplace add melodic-software/claude-code-plugins
/plugin install context-guard
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/melodic-software/claude-code-plugins

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 context-guard

README.md
[![agentmods](https://agentmods.dev/badge/plugins/melodic-software/claude-code-plugins/context-guard/github.svg)](https://agentmods.dev/plugins/melodic-software/claude-code-plugins/context-guard)
Your own site
<a href="https://agentmods.dev/plugins/melodic-software/claude-code-plugins/context-guard"><img src="https://agentmods.dev/badge/plugins/melodic-software/claude-code-plugins/context-guard/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context-guard

Your own site · 80×15
<a href="https://agentmods.dev/plugins/melodic-software/claude-code-plugins/context-guard"><img src="https://agentmods.dev/badge/plugins/melodic-software/claude-code-plugins/context-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session not measured What this adds to a session before it is invoked.
When invoked not measured Not applicable: nothing here is loaded into a session.
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.
Security

Grade A, and why

context-guard 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 17d 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.

plugins/context-guard/.claude-plugin/plugin.json · 65 lines

How it starts

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

{
  "name": "context-guard",
  "description": "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-guard prints status and toggles an optional band row. It answers a status tool. A PostCompact hook leaves a marker.",
  "author": {
    "name": "Melodic Software",
    "email": "[email protected]"
  },
  "version": "5.0.8",
  "license": "MIT",
  "keywords": [
    "context-window",
    "mod",
    "zones",
    "context-degradation",
    "session",
    "hooks",
    "skill"
  ],
  "metadata": {
    "category": "claude-code"
  },
  "userConfig": {
    "context_guard_hooks_enabled": {
      "type": "boolean",
      "title": "Zone notices and compaction marker",
      "description": "Runs the module's zone lines and toasts and the PostCompact marker hook. On by default; off, none of them acts. Snapshot writes continue either way.",
      "default": true
    },
    "model_notices": {
      "type": "boolean",
      "title": "Model notices",
      "description": "Sends Claude one line when the session enters a worse context zone, nears a boundary or passes a zones.json threshold, and restates the zone after a resume, reload or compaction (with no figures yet, says the reading is unavailable). Off by default; the rest of the plugin works either way.",
      "default": false
    },
    "zone_report_mode": {
      "type": "string",
      "title": "Zone report mode",
      "description": "Acts only with model_notices on. automatic (default) sends the lines to Claude; operator holds them in a turn a person typed and offers the person a ready-made prompt and a notice row when the turn ends. Headless, loop and schedule turns get automatic lines either way.",
      "def

Read the full file on GitHub · 65 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. 17d ago Changed e630f4172cf3
  2. 18d ago Changed ea12e2b6c20a
  3. 19d ago Changed 312796572165
  4. 20d ago Changed 950d2b915f10
  5. 23d ago Changed 02db8bde7251
  6. 24d ago Changed 83d1f2aa42ff
  7. 25d ago Changed 339c0edd1ce3
  8. 26d ago Changed adf85ec010ab
  9. 27d ago Changed · +4 lines 0c645295d90b
  10. 29d ago First seen · 61 lines scan A 58d9521161c6

Subscribe to this mod's changes

context-guard is a plugin published in the GitHub repository melodic-software/claude-code-plugins (33 stars, last pushed today), licensed MIT. Its token cost is not measured: this kind of file is read by the harness, not the model. 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.

Related

context-guard compared with plugins from other repositories

context-guard next to 6 plugins from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
context-guardmelodic-software/claude-code-pluginsPlugin33todayMITA—Claude Code
commonssystempromptio/systemprompt-marketplacePlugin21mo agononeA—Claude Code
humanizerblader/humanizerPlugin75k10d agoMITA—Claude Code
claude-plugins-official marketplaceanthropics/claude-plugins-officialPlugin49kyesterdayApache-2.0A—Claude Code
nextjsvercel/next.jsPlugin144ktodayMITA—Claude Code
themes-examplegoogle-gemini/gemini-cliPlugin109ktodayApache-2.0A—Gemini CLI
android-skillsandroid/skillsPlugin11k7d agoApache-2.0A—Claude Code