context-health

context-health is a command for Claude Code from doncheli/don-cheli-sdd. It costs 77 tokens per session (2,177 once invoked), scanned A, original, Apache-2.0.

A context-health dashboard measures how much of the agent's working context is being used, including tokens, files, instructions, and conversation.

In plain words
What is it for?
Use it to check context usage, estimate when degradation may begin, and decide what to compact, remove, or delegate.
Why use it?
It helps identify when a session is becoming too full and the agent's responses may lose quality.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

Part of the don-cheli-sdd plugin — 28 skills, 115 commands, 1 agent shipped together

Good fit Use it to check context usage, estimate when degradation may begin, and decide what to compact, remove, or delegate.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/doncheli/don-cheli-sdd/context-health
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/doncheli/don-cheli-sdd

Made for: Claude Code.

Or install don-cheli-sdd, the plugin that ships this one along with the rest of its 28 skills, 115 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 context-health

README.md
[![agentmods](https://agentmods.dev/badge/commands/doncheli/don-cheli-sdd/context-health/github.svg)](https://agentmods.dev/commands/doncheli/don-cheli-sdd/context-health)
Your own site
<a href="https://agentmods.dev/commands/doncheli/don-cheli-sdd/context-health"><img src="https://agentmods.dev/badge/commands/doncheli/don-cheli-sdd/context-health/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-health

Your own site · 80×15
<a href="https://agentmods.dev/commands/doncheli/don-cheli-sdd/context-health"><img src="https://agentmods.dev/badge/commands/doncheli/don-cheli-sdd/context-health.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 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,177 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.00077 $0.02177
Opus 5 $0.00039 $0.01089
Sonnet 5 $0.00015 $0.00435
Haiku 4.5 $0.00008 $0.00218

Measured 7d ago against content hash 08d528911134, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

context-health 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 7d 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.

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.

scripts/.claude/commands/dc/context-health.md · 227 lines

How it starts

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

/dc:context-health

Objetivo

Mostrar el estado de salud de la ventana de contexto en la sesión actual: porcentaje usado, conteo de tokens, archivos cargados y predicción de cuándo comenzará a degradarse la calidad. Sugiere cuándo compactar, qué delegar a subagentes y qué eliminar. Sistema de semáforo: verde (<50%), amarillo (50-75%), rojo (>75%). Rastrea patrones de uso de contexto entre sesiones.

Uso

/dc:context-health                           # Dashboard completo
/dc:context-health --rapido                  # Solo semáforo + número
/dc:context-health --sugerir                 # Recomendaciones accionables
/dc:context-health --historial               # Patrones entre sesiones
/dc:context-health --simular 20000           # Simular con N tokens adicionales
/dc:context-health --exportar                # Guardar estado para análisis

Comportamiento

  1. Medir estado actual del contexto:

    • Tokens usados vs límite del modelo activo
    • Tokens por categoría: instrucciones del sistema / archivos cargados / conversación / outputs
    • Archivos activos en contexto con su peso en tokens
  2. Calcular métricas derivadas:

    • % de contexto utilizado
    • Proyección de agotamiento: si continúa a la tasa actual, ¿en cuántos turnos se llena?
    • Zona de degradación: calidad de respuesta empieza a bajar al superar el 75% en la mayoría de modelos
    • Densidad de información útil: ratio de tokens de contexto relevante vs tokens acumulados innecesarios
  3. Clasificar semáforo:

    • 🟢 Verde: < 50% — sin acción requerida
    • 🟡 Amarillo: 50-75% — monitorear, preparar compactación
    • 🔴 Rojo: > 75% — compactar o delegar antes del próximo turno complejo
  4. Generar recomendaciones según estado:

    • Qué archivos eliminar del contexto
    • Qué subtareas delegar a subagentes
    • Cuándo ejecutar /compact
    • Qué información preservar en memoria persistente antes de compactar
  5. Para --historial:

    • Leer .dc/context-sessions.jsonl
    • Identificar patrones: ¿en qué tipo de tareas se llena más rápido?
    • ¿Cuál es el volumen promedio de tokens por tipo de sesión?

Read the full file on GitHub · 227 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. 7d ago First seen · 227 lines · 77 tokens per session scan A 08d528911134

Subscribe to this mod's changes

context-health is a command published in the GitHub repository doncheli/don-cheli-sdd (57 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 77 tokens to every session and 2,177 once invoked, about $0.0004 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-09-03.