Agent skill

Context Monitor

by coyvalyss1 in coyvalyss1/model-matchmaker

Monitor conversation context and prevent MAX mode by warning at token thresholds and generating handoff summaries.

MITAuto-check passed

Install Context Monitor

skills CLI
$ npx skills add coyvalyss1/model-matchmaker --skill context-monitor -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install coyvalyss1/model-matchmaker context-monitor --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/coyvalyss1/model-matchmaker.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/context-monitor .claude/skills/context-monitor && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
context-monitor
GitHub stars
168
Token cost
~1.9k tokens
SKILL.md length
656 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Monitor conversation context and prevent MAX mode by warning at token thresholds and generating handoff summaries.

  • Works in 5 steps: Large file opened (>3,000 lines) → Multiple large files in context (>5… → Long conversation (>50 tool calls in… → …
  • Context approaches 100K/150K/180K tokens
  • SKILL.md covers The Problem, The Solution, Token Thresholds and Automatic Triggers, plus 8 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Context Monitor is an agent skill from coyvalyss1/model-matchmaker. Monitor conversation context and prevent MAX mode by warning at token thresholds and generating handoff summaries. Use when context approaches 100K/150K/180K tokens or when working with high-cost files.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Local hook for Cursor and Claude Code that routes prompts to the right model tier. Stop paying Opus prices to rename files. The licence is MIT.

When your agent uses it

  • Context approaches 100K/150K/180K tokens
  • Working with high-cost files

Example prompts

  • “/context-monitor”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Large file opened (>3,000 lines)
  2. Multiple large files in context (>5 files over 1,000 lines each)
  3. Long conversation (>50 tool calls in current chat)
  4. Transcript search (reading agent-transcripts/*.txt files)
  5. Plan file creation (plans are meta-work that inflate context)

What it can do on your machine

Read from SKILL.md and the folder at commit 4b99e64. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Context Monitor loads about 1.9k tokens when it runs. Until then it costs about 55 tokens; SKILL.md has 656 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~55
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from coyvalyss1/model-matchmaker at commit 4b99e64, republished under its MIT licence (© coyvalyss1). 656 words, ~1,883 tokens.

Download SKILL.mdSave it as .claude/skills/context-monitor/SKILL.md (or your agent's skills folder).
name
context-monitor
description
Monitor conversation context and prevent MAX mode by warning at token thresholds and generating handoff summaries. Use when context approaches 100K/150K/180K tokens or when working with high-cost files.

MAX Mode Prevention & Context Monitoring

The Problem

Cursor's MAX mode (Claude Opus 3.5, 200K token context) is expensive and should be reserved for truly complex tasks. Context can balloon quickly when:

  • Opening large files (e.g., a 9,378-line React component)
  • Loading chat transcripts or logs (1-10MB)
  • Accumulating tool calls and responses across long sessions
  • Reading multiple files speculatively

Once context exceeds 200K tokens, the conversation is forced into a new chat with a handoff summary. This wastes user time and disrupts flow.

The Solution

Monitor context throughout the conversation (not just at start). Warn at thresholds and proactively recommend starting a new chat with a clean handoff.

Token Thresholds

🟡 Yellow Alert (100K tokens)

Action: Note the context size internally. No user warning yet.

🟠 Orange Alert (150K tokens)

Action: Warn the user and suggest wrapping up current work or starting a new chat if the task is open-ended.

Warning format:

⚠️ Context approaching 150K tokens. Consider starting a new chat after this task to avoid MAX mode. I can generate a handoff summary.
🔴 Red Alert (180K tokens)

Action: Strongly recommend starting a new chat. Offer to generate a handoff summary immediately.

Warning format:

🚨 Context at 180K tokens (MAX mode limit: 200K). Recommend starting a new chat now. I can generate a handoff summary with:
- Task description
- Progress so far
- Next steps
- @file references

Automatic Triggers

Issue a warning automatically when:

  1. Large file opened (>3,000 lines):

    • Example: DashboardPage.jsx (9,378 lines) = ~70K tokens
    • Example: useChatManager.jsx (4,178 lines) = ~30K tokens
    • Any file >5,000 lines = likely >40K tokens
  2. Multiple large files in context (>5 files over 1,000 lines each)

  3. Long conversation (>50 tool calls in current chat)

  4. Transcript search (reading agent-transcripts/*.txt files)

  5. Plan file creation (plans are meta-work that inflate context)

High-Cost Files (Known)

Track your project's largest files and add them to your monitoring list. Common examples:

  • Main dashboard/app components (5,000-10,000 lines)
  • Complex state management hooks (3,000-5,000 lines)
  • Generated files (API clients, schema definitions)
  • Any .log file
  • Any agent transcript (.txt files in agent-transcripts/)

When opening these files, immediately note context cost and warn if already over 100K.

To find your largest files:

bash
find . -name "*.jsx" -o -name "*.tsx" -o -name "*.js" -o -name "*.ts" | \
  xargs wc -l | sort -rn | head -20

Handoff Summary Format

When recommending a new chat, generate a concise handoff summary using this template:

markdown
## Handoff Summary for New Chat

**Task**: [One-line description]

**Progress**:
- [Bullet point 1]
- [Bullet point 2]
- [Bullet point 3]

**Next Steps**:
1. [Action item 1]
2. [Action item 2]
3. [Action item 3]

**Key Files**:
- @path/to/file1.jsx — [what was changed/what needs work]
- @path/to/file2.js — [what was changed/what needs work]

**Context**: [1-2 sentences of critical context that must be preserved]

Handoff example:

markdown
## Handoff Summary for New Chat

**Task**: Fix chat component falling back to short responses when user profile is empty

**Progress**:
- Identified root cause: validation guard blocking all saves when user data incomplete
- Removed guard from useChatManager.jsx (lines 2847-2863)
- Added fallback examples to API helper function

**Next Steps**:
1. Test save flow with empty profile
2. Verify data structure generation on first save
3. Deploy to production if test passes

**Key Files**:
- @src/hooks/useChatManager.jsx — Removed validation guard
- @server/helpers/apiHelper.js — Added fallback examples

**Context**: The short-response fallback was a symptom, not the root cause. Real issue was validation logic preventing data generation.

Implementation Guide

For Cursor AI

At the start of each response:

  1. Check conversation length (tool call count, file read count)
  2. Check if large files are in context (match against known high-cost files list)
  3. Estimate current token count (rough heuristic: 50 tool calls = ~100K tokens; one 9K line file = ~70K tokens)
  4. Issue warning if threshold crossed
Mid-Conversation Monitoring

After opening a large file:

📊 Context note: DashboardPage.jsx added (~70K tokens). Current context estimate: ~120K tokens.

After 30+ tool calls:

⚠️ Context approaching 150K tokens (30+ tool calls). Consider wrapping up or starting fresh chat.
Show full SKILL.md (268 more words)Show less
Handoff Trigger Phrases

When the user says:

  • "This is taking forever"
  • "Start a new chat"
  • "Can we move to a new conversation?"
  • "Feels like we're dragging"
  • "MAX mode is too expensive"

Immediately generate a handoff summary without asking.

Cost Comparison

Typical scenario without monitoring:

  • Start chat: 20K tokens
  • Open DashboardPage.jsx: +70K = 90K
  • Open useChatManager.jsx: +30K = 120K
  • 20 tool calls: +40K = 160K
  • Read logs/transcripts: +30K = 190K
  • Triggers MAX mode (expensive, could have been avoided)

With monitoring:

  • Warning at 150K → user starts new chat
  • New chat: 20K tokens
  • Continue work efficiently
  • Savings: 170K tokens (stays under 200K limit)

When NOT to Warn

Don't warn if:

  • The task is nearly complete (1-2 steps remaining)
  • The user explicitly said "use MAX mode" or "I don't care about cost"
  • The conversation is already at the final deployment/verification stage

Testing the Skill

To verify this skill is working:

  1. Open a large file (>5,000 lines) → Should see context note
  2. Make 30+ tool calls → Should see 150K warning
  3. Request a new chat → Should get formatted handoff summary
  4. Open multiple large files → Should see cumulative context estimate

Integration with .cursorrules

This skill should be referenced in .cursorrules after the "Prior Session Context" section (around line 106):

markdown
## MAX Mode Prevention & Context Monitoring

Monitor conversation context to avoid triggering MAX mode (200K token limit). See `.cursor/skills/context-monitor/SKILL.md` for full logic.

**Quick reference:**
- 🟡 100K tokens: Note internally
- 🟠 150K tokens: Warn user, suggest wrapping up
- 🔴 180K tokens: Recommend new chat with handoff summary

**High-cost files (auto-warn when opened):**
- Any file >5,000 lines (typically ~40-70K tokens)
- Any file >3,000 lines if other large files already in context
- Any agent transcript or log file

**When recommending new chat**, generate handoff summary with: task description, progress, next steps, @file references, critical context.

Why This Matters

  • Cost control: MAX mode is expensive. Staying under 200K tokens saves money.
  • Conversation efficiency: Handoff summaries preserve context without bloating the next chat.
  • User experience: Proactive warnings let users decide when to break vs. AI forcing it.
  • Strategic file loading: Knowing the cost of opening a file helps with decision-making.

This skill should be applied automatically throughout every conversation, not just when explicitly invoked.

© coyvalyss1, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/context-monitor of coyvalyss1/model-matchmaker.

Open the folder on GitHubat commit 4b99e64

Compare with similar skills

Context Monitor next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Context Monitor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Context Monitor this skillcoyvalyss1/model-matchmaker168—~1.9kAutomated safety check: PassMIT
Maxsickn33/agentic-awesome-skills47k1 repos~1.4kAutomated safety check: PassMIT
Qdrant Monitoringgithub/awesome-copilot40k1 repos~276Automated safety check: PassMIT
Modeling Conversion MetricsPostHog/posthog40k—~1.4kAutomated safety check: PassCustom licence
Monitoring Capture ServicePostHog/posthog40k—~5kAutomated safety check: PassCustom licence
Monitoring Ingestion PipelinePostHog/posthog40k—~9.1kAutomated safety check: PassCustom licence

Similar skills

  • Max

    sickn33/agentic-awesome-skills

    Cleans up and improves existing code without changing behavior.

    47k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Qdrant Monitoring

    github/awesome-copilot

    Official

    Guides Qdrant monitoring and observability setup. An agent skill from github/awesome-copilot.

    40k GitHub starsUsed in 1 repo~276 tokens
    DevOps & CloudAuto-check passed
  • Official

    Build reusable conversion models — funnel/step conversion rates, drop-off, and time-to-convert — on either PostHog data-warehouse views (HogQL) or an external dbt project.

    40k GitHub stars~1.4k tokensUpdated yesterday
    Data & AnalyticsAuto-check passed
  • Official

    Guide for using the Grafana MCP to monitor and diagnose the capture service (rust/capture) in production.

    40k GitHub stars~5k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Official

    Guide for using the Grafana MCP to monitor and diagnose the Node.js ingestion pipeline workers in production.

    40k GitHub stars~9.1k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Agent skill for performance-monitor - invoke with $agent-performance-monitor

    74k GitHub starsUsed in 2 repos~4.9k tokens
    Auto-check passed

More from coyvalyss1/model-matchmaker

  • Optimize Classifier

    coyvalyss1/model-matchmaker

    Analyze your Model Matchmaker override patterns and tune the local classifier to match your preferences.

    168 GitHub stars~1.8k tokensUpdated 18 days ago
    Auto-check passed
  • Share Analytics

    coyvalyss1/model-matchmaker

    Build a sanitized analytics report from your Model Matchmaker usage for community contribution.

    168 GitHub stars~1.8k tokensUpdated 18 days ago
    Auto-check passed

Questions about Context Monitor

What does Context Monitor do?

Monitor conversation context and prevent MAX mode by warning at token thresholds and generating handoff summaries. Context Monitor is an agent skill from coyvalyss1/model-matchmaker. Monitor conversation context and prevent MAX mode by warning at token thresholds and generating handoff summaries.

When should I use Context Monitor?

Context Monitor fits situations like: context approaches 100K/150K/180K tokens; working with high-cost files.

How do I install Context Monitor in Claude Code?

Run `npx skills add coyvalyss1/model-matchmaker --skill context-monitor -a claude-code`. Or copy the skill folder (skills/context-monitor in coyvalyss1/model-matchmaker) into .claude/skills/context-monitor in your project. Claude Code loads it when a task matches its description.

How do I install Context Monitor in Codex?

Run `npx skills add coyvalyss1/model-matchmaker --skill context-monitor -a codex`. Or copy the skill folder (skills/context-monitor in coyvalyss1/model-matchmaker) into .agents/skills/context-monitor in your project. Codex loads it when a task matches its description.

Can I use Context Monitor in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add coyvalyss1/model-matchmaker --skill context-monitor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/context-monitor, .gemini/skills/context-monitor, .github/skills/context-monitor and .opencode/skills/context-monitor in your project.

What does Context Monitor need to run?

SKILL.md names no scripts, command-line tools or credentials: Context Monitor is instructions for the agent only.

Does Context Monitor access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Context Monitor safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Context Monitor use?

Context Monitor is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Context Monitor use?

About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Context Monitor?

Skills that share tags, products or a category with Context Monitor: Max (sickn33/agentic-awesome-skills, 47k stars), Qdrant Monitoring (github/awesome-copilot, 40k stars), Modeling Conversion Metrics (PostHog/posthog, 40k stars) and Monitoring Capture Service (PostHog/posthog, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Context Monitor?

coyvalyss1 (a GitHub user) maintains it in coyvalyss1/model-matchmaker, which has 168 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on September 22, 2026.

Source: coyvalyss1/model-matchmaker on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.