setup-context-monitor

setup-context-monitor is a command for Claude Code from ArieGoldkin/claude-forge. It costs 21 tokens per session (2,256 once invoked), scanned B, original, MIT.

A setup command for a monitor that warns how much of the agent's conversation context has been used. It creates a launcher, updates global settings, checks the monitoring hook, and tests the warning pipeline.

In plain words
What is it for?
Use it to enable context-usage warnings, repair missing warnings, verify the monitoring setup, or configure it after reinstalling the related plugin.
Why use it?
It helps prevent long tasks from losing important earlier context without warning. The setup also makes the monitor continue working across projects and plugin updates.

Command for Claude Code

Written for Claude Code: UserPromptSubmit hook event. Also seen: reads .claude/ paths; positional $N argument; mentions Claude Code.

Part of the ctk plugin — 12 commands, 1 agent shipped together

Good fit Use it to enable context-usage warnings, repair missing warnings, verify the monitoring setup, or configure it after reinstalling the related plugin.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/ariegoldkin/claude-forge/setup-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.

Clone the repo
git clone --depth 1 https://github.com/ArieGoldkin/claude-forge

Made for: Claude Code.

Or install ctk, the plugin that ships this one along with the rest of its 12 commands, 1 agent.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/ariegoldkin/claude-forge/setup-context-monitor/github.svg)](https://agentmods.dev/commands/ariegoldkin/claude-forge/setup-context-monitor)
Your own site
<a href="https://agentmods.dev/commands/ariegoldkin/claude-forge/setup-context-monitor"><img src="https://agentmods.dev/badge/commands/ariegoldkin/claude-forge/setup-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 setup-context-monitor

Your own site · 80×15
<a href="https://agentmods.dev/commands/ariegoldkin/claude-forge/setup-context-monitor"><img src="https://agentmods.dev/badge/commands/ariegoldkin/claude-forge/setup-context-monitor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,256 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00021 $0.02256
Opus 5.5 $0.00008 $0.00902
Sonnet 5.5 $0.00004 $0.00451
Haiku 4.5 $0.00002 $0.00226

Measured 1mo ago against content hash 6d0af75eed56, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

setup-context-monitor scanned grade B with 1 finding 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 1mo ago.

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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

script=$(find "$HOME/.claude/plugins/cache" \
plugins/continuity-toolkit/commands/setup-context-monitor.md · 205 lines

How it starts

The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/setup-context-monitor - Configure Context Window Monitoring

One-time setup to enable proactive context window usage warnings. Creates a stable launcher script and configures global settings so context monitoring works across all projects and survives plugin updates.

When to Use

  • First time enabling context monitoring
  • After reinstalling the plugin (launcher script should still work)
  • When context warnings aren't appearing
  • To verify the monitoring pipeline is working

Prerequisites

  • Continuity toolkit plugin installed and hooks compiled (cd hooks && npm run build)
  • Claude Code v2.1.97+ (StatusLine refreshInterval and workspace.git_worktree)

What This Command Does

  1. Create stable launcher - Write ~/.config/claude/continuity-statusline.sh that finds the plugin script via glob
  2. Configure global StatusLine - Add statusLine.command to ~/.claude/settings.json (applies to ALL projects)
  3. Verify hook - Confirm context-monitor hook is registered in hooks.json
  4. Test pipeline - Verify temp file appears after a message exchange

Execution Steps

Step 1: Create the Stable Launcher Script

Create the directory and launcher script at ~/.config/claude/continuity-statusline.sh:

mkdir -p ~/.config/claude

Step 0: Check for an Existing StatusLine

Run this before writing anything:

python3 -c "import json,os;d=json.load(open(os.path.expanduser('~/.claude/settings.json')));print(json.dumps(d.get('statusLine','(unset)')))"
Existing value Action
Unset, or already continuity-statusline.sh Proceed
Any other program Stop and ask. Name what is configured and offer Step 1a (compose) or replacement

Always overwrite the launcher file once the user has chosen ctk (do not skip if it already exists). A pre-existing launcher from an older install may hardcode the legacy continuity-toolkit cache path only and silently fail to [?] unknown once the plugin is renamed or its old cache is cleaned. Re-running this command must self-heal those installs. This is about the launcher script's contents — it is not licence to repoint a statusLine the user deliberately set, which is what Step 0 guards.

Read the full file on GitHub · 205 lines

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. 1mo ago First seen · 205 lines · 21 tokens per session scan B 6d0af75eed56

Subscribe to this mod's changes

setup-context-monitor is a command published in the GitHub repository ArieGoldkin/claude-forge (7 stars, last pushed 2mo ago), licensed MIT. It adds 21 tokens to every session and 2,256 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.