Home / Claude Code mods / Security / context-guard

context-guard

context-guard is a Claude Code mod by melodic-software that 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.

Updated 2026-10-18

What is context-guard?

context-guard is a Claude Code mod by melodic-software that 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. It is listed under Security and has 26 GitHub stars.

TypeClaude code mod
Authormelodic-software
Repositorymelodic-software/claude-code-plugins
Popularity26 GitHub stars
CategorySecurity
SecurityReview before installing (64/100)
Rank#269 of 5,272 Claude Code mods; #46 in Security
LicenseMIT
Last commit2026-10-18
Stars this week+3
Hooks10 events
Seescompaction, every prompt, every tool call
Draws onAbovePrompt

Is context-guard safe to install?

context-guard scores 64/100 on the MCPMods security check: Review before installing. Things to review: starts processes outside the sandbox; reads environment variables; watches every prompt or event. It passed 5 of 8 checks.

Mod footprints come from claude plugin validate, which lists every event a mod hooks and every API call it makes without running it.

CheckResult
No network accessPass
Starts processes outside the sandboxReview
Writes no files or configPass
Reads environment variablesReview
Watches every prompt or eventReview
Doesn't drive ClaudePass
Passes claude plugin validatePass
Has an open-source licensePass

API calls in its code

CallWhat it means
$.clock.every
$.clock.now
$.command.register
$.env.getreads env vars
$.fs.existsreads files
$.fs.readreads files
$.fs.statreads files
$.process.runruns processes
$.prompt.read
$.prompt.suggestwrites the prompt box
$.session.id
$.session.root
$.session.surfaces
$.session.turns
$.session.usage
$.session.version
$.tool.list
$.tool.registerdrives Claude
$.ui.invalidatedraws interface
$.ui.logdraws interface
$.ui.resolvedraws interface
$.ui.toastdraws interface

How do I install context-guard?

  1. Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
    claude --version
  2. Read its footprint. This lists every event it hooks and every API call it makes, without running it.
    git clone https://github.com/melodic-software/claude-code-plugins
    claude plugin validate ./claude-code-plugins/plugins/context-guard
  3. Install it. Run this in your terminal, then /reload-plugins in an open session.
    claude plugin marketplace add melodic-software/claude-code-plugins && claude plugin install context-guard@melodic-software

Or ask Claude to set it up

Paste this into Claude Code and it installs context-guard for you:

Install the "context-guard" Claude Code mod from https://github.com/melodic-software/claude-code-plugins/tree/main/plugins/context-guard. Run claude plugin validate on it first and show me what it can access before you enable it.

More from melodic-software/claude-code-plugins

This repository has 5 Claude Code mods on MCPMods.

  • context-budget: Measures a Claude Code session's fixed startup context payload per item at a pinned binary version, including per-tool a (Low risk)
  • display-redaction: A mod that masks email addresses and secret-shaped text in what Claude Code draws, for recordings and screen shares. It (Low risk)
  • harness-ops: Claude Code operations: audit-skill-visibility (skills the listing budget hides), inventory (every invocable surface), a (Review before installing)
  • rate-limit-guard: Shared rate-limit guard for loop lanes and Claude: a hooks module writes the subscription rate-limit windows to a fixed (Review before installing)