---
title: "context-guard"
url: "https://claudemods.dev/zh-tw/builds/context-guard-7c3c6f"
source: "https://github.com/anthonyhungnguyen/claude-code-mods/tree/main/context-guard"
source_type: "github"
repo: "https://github.com/anthonyhungnguyen/claude-code-mods/tree/main/context-guard"
author: "anthonyhungnguyen"
author_handle: "anthonyhungnguyen"
stars: 0
category: "儀表板與 HUD"
categories: ["hud"]
tags: ["claude-code", "context-window", "hooks", "notifications", "plugin", "status-line"]
permission_level: 0
scan_complete: true
install: "claude plugin marketplace add anthonyhungnguyen/claude-code-mods\nclaude plugin install context-guard"
added: "2026-10-05T17:17:01.759Z"
updated: "2026-10-02T06:26:05Z"
locale: "zh-tw"
content_locale: "zh-tw"
---

# context-guard

一個 Claude Code plugin，在狀態列顯示上下文視窗填充量，使用量超過 80% 時發出通知。

## Description

在狀態列顯示上下文視窗填充量，並在快要用完前提示。它屬於 claude-code-mods 集合；複製儲存庫、將每個 mod 資料夾列入 CLAUDE_CODE_PLUGIN_DIRS，再重新啟動工作階段即可安裝。

## Install

```
claude plugin marketplace add anthonyhungnguyen/claude-code-mods
claude plugin install context-guard
```

## Original README

# claude-code-mods

Mods for Claude Code, one folder each. A mod is a plugin of function hooks: panes, status lines, slash commands, tool guards.

| Mod | What it does |
| --- | --- |
| [cost-pane](cost-pane/) | Token and USD spend per session and per day, in the status line and a `/cost-pane` pane |
| [context-guard](context-guard/) | Context window fill in the status line; a toast once it passes 80% |
| [cache-watch](cache-watch/) | A toast when a turn rebuilt the prompt cache: tokens written, turn cost, likely cause (idle, model change) |
| [turn-timer](turn-timer/) | Speaks (`say` on macOS) and toasts when a turn longer than 2 minutes finishes |

## Install

```sh
git clone git@github.com:anthonyhungnguyen/claude-code-mods.git ~/.claude/mods
```

List each mod folder you want in `~/.claude/settings.json`, separated by `:`:

```json
{ "env": { "CLAUDE_CODE_PLUGIN_DIRS": "~/.claude/mods/cost-pane:~/.claude/mods/context-guard:~/.claude/mods/cache-watch:~/.claude/mods/turn-timer" } }
```

New sessions load them. Check a mod with `claude plugin validate ~/.claude/mods/<mod>`.
