Home / Claude Code mods / Security / context-guard

context-guard

context-guard is a Claude Code mod by axtonliu that warns before the context fills up; one click writes a work log, compacts, then resumes from the log. 上下文快满时提醒,一键写日志、压缩、从日志接着干。.

Updated 2026-10-30

What is context-guard?

context-guard is a Claude Code mod by axtonliu that warns before the context fills up; one click writes a work log, compacts, then resumes from the log. 上下文快满时提醒,一键写日志、压缩、从日志接着干。. It is listed under Security and has 19 GitHub stars.

TypeClaude code mod
Authoraxtonliu
Repositoryaxtonliu/context-guard
Popularity19 GitHub stars
CategorySecurity
SecurityLow risk (88/100)
Rank#546 of 9,397 Claude Code mods; #70 in Security
Last commit2026-10-30
Hooks6 events
Seescompaction
Draws onAbovePrompt

Is context-guard safe to install?

context-guard scores 88/100 on the MCPMods security check: Low risk. No checks raised a concern. 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 no processesPass
Writes no files or configPass
Doesn't read environment variablesPass
Only sees the events it hooksPass
Drives Claude (model calls, prompts)Note
Validator reported problemsNote
No license detectedNote

API calls in its code

CallWhat it means
$.clock.every
$.clock.now
$.command.register
$.command.rundrives Claude
$.fs.readreads files
$.fs.statreads files
$.prompt.submitdrives Claude
$.session.compactdrives Claude
$.session.usage
$.state.get
$.state.set
$.store.getkeeps its own state
$.store.setkeeps its own state
$.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/axtonliu/context-guard
    claude plugin validate ./context-guard/.
  3. Install it. Run this in your terminal, then /reload-plugins in an open session.
    claude plugin marketplace add axtonliu/context-guard && claude plugin install context-guard@axtonliu-mods

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/axtonliu/context-guard. Run claude plugin validate on it first and show me what it can access before you enable it.