context-monitor

context-monitor is a skill for Claude Code from Katagiri-Hoshino-Lab/VibeCodeHPC. It costs 31 tokens per session (449 once invoked), scanned A, original, MIT.

A skill for monitoring how much of an agent's context window is in use and recovering after automatic compaction. Context compaction shortens earlier conversation material so the agent can continue working.

In plain words
What is it for?
Use it to check context usage, save progress and references during long tasks, find the latest session status, and restore working context after compaction.
Why use it?
It provides thresholds and recovery steps for saving important state before context becomes too full. It helps the agent resume with the relevant task files and references after compaction.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_SKILL_DIR} variable. Also seen: mentions subagents; mentions Codex; mentions OpenCode.

Good fit Use it to check context usage, save progress and references during long tasks, find the latest session status, and restore working context after compaction.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/katagiri-hoshino-lab/vibecodehpc/context-monitor
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.

Any agent
npx skills add Katagiri-Hoshino-Lab/VibeCodeHPC --skill context-monitor
Clone the repo
git clone --depth 1 https://github.com/Katagiri-Hoshino-Lab/VibeCodeHPC

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-monitor

README.md
[![agentmods](https://agentmods.dev/badge/skills/katagiri-hoshino-lab/vibecodehpc/context-monitor/github.svg)](https://agentmods.dev/skills/katagiri-hoshino-lab/vibecodehpc/context-monitor)
Your own site
<a href="https://agentmods.dev/skills/katagiri-hoshino-lab/vibecodehpc/context-monitor"><img src="https://agentmods.dev/badge/skills/katagiri-hoshino-lab/vibecodehpc/context-monitor/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-monitor

Your own site · 80×15
<a href="https://agentmods.dev/skills/katagiri-hoshino-lab/vibecodehpc/context-monitor"><img src="https://agentmods.dev/badge/skills/katagiri-hoshino-lab/vibecodehpc/context-monitor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 449 The whole file, excluding the scripts and references it only reads on demand.
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.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00031 $0.00449
Opus 5 $0.00015 $0.00225
Sonnet 5 $0.00006 $0.00090
Haiku 4.5 $0.00003 $0.00045

Measured 12d ago against content hash 3e5498cc0949, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

context-monitor 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 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/context_monitor.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Agent-shared/skills/context-monitor/SKILL.md · 48 lines

What it actually says

Context Monitor

Thresholds

Level Action
< 70% Normal operation
70-85% Persist current state to files, update task list
85-95% Save intermediate results, minimize new file reads
~95% Auto-compact triggers — context will be compressed

Note: The thresholds above are behavioral guidelines for agents. The context_monitor.py script uses warning_threshold (70%) and auto_compact_threshold (95%) for visualization and alerting. The 85% intermediate action is the agent's own responsibility.

Pre-Compact Checklist

  • Write work state summary to file (SOTA values, current version, next action)
  • Update ChangeLog.md with latest results
  • List reference file paths for post-compact recovery

Post-Compact Recovery

  1. Read task file / ChangeLog.md
  2. Restore minimal working context
  3. Resume from interruption point

CLI Script

python3 ${CLAUDE_SKILL_DIR}/scripts/context_monitor.py --help
python3 ${CLAUDE_SKILL_DIR}/scripts/context_monitor.py claude --find-latest --status
python3 ${CLAUDE_SKILL_DIR}/scripts/context_monitor.py codex --find-latest --status --json
python3 ${CLAUDE_SKILL_DIR}/scripts/context_monitor.py gemini /path/to/telemetry.jsonl --visualize -o ./viz
python3 ${CLAUDE_SKILL_DIR}/scripts/context_monitor.py claude /path/to/session.jsonl --visualize --context-limit 200000

Supported parsers: claude, codex, gemini, opencode

Multi-Agent Considerations

  • Delegate large tasks to sub-agents to distribute context load
  • SE/PM should monitor agent context consumption trends
  • Use PG_visible_dir.md to limit unnecessary file reads
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 48 lines · 31 tokens per session scan A 3e5498cc0949

Subscribe to this mod's changes

context-monitor is a skill published in the GitHub repository Katagiri-Hoshino-Lab/VibeCodeHPC (39 stars, last pushed 5mo ago), licensed MIT. It adds 31 tokens to every session and 449 once invoked, about $0.0002 per session on Opus 5. 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.