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.
| Type | Claude code mod |
|---|---|
| Author | axtonliu |
| Repository | axtonliu/context-guard |
| Popularity | 19 GitHub stars |
| Category | Security |
| Security | Low risk (88/100) |
| Rank | #546 of 9,397 Claude Code mods; #70 in Security |
| Last commit | 2026-10-30 |
| Hooks | 6 events |
| Sees | compaction |
| Draws on | AbovePrompt |
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.
| Check | Result |
|---|---|
| No network access | Pass |
| Starts no processes | Pass |
| Writes no files or config | Pass |
| Doesn't read environment variables | Pass |
| Only sees the events it hooks | Pass |
| Drives Claude (model calls, prompts) | Note |
| Validator reported problems | Note |
| No license detected | Note |
API calls in its code
| Call | What it means |
|---|---|
$.clock.every | |
$.clock.now | |
$.command.register | |
$.command.run | drives Claude |
$.fs.read | reads files |
$.fs.stat | reads files |
$.prompt.submit | drives Claude |
$.session.compact | drives Claude |
$.session.usage | |
$.state.get | |
$.state.set | |
$.store.get | keeps its own state |
$.store.set | keeps its own state |
$.ui.resolve | draws interface |
$.ui.toast | draws interface |
How do I install context-guard?
- Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
claude --version
- 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/.
- 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.