← Back to writing

Health Score - Know When Claude Is About to Lose the Plot

There’s a pattern every Claude Code user eventually recognizes. The session starts sharp - tight code, correct imports, consistent patterns. Then, somewhere around the 90-minute mark, things drift. Claude references a function that doesn’t exist. It suggests a package you never installed. It sounds confident but it’s quietly wrong.

This is context degradation. And until Health Score, there was no way to see it coming.

Why Context Doesn’t Degrade Linearly

The intuition is that quality drops steadily as context fills. The reality is worse: Claude stays coherent until roughly 73% fill (~147K tokens on a 200K window), then quality drops fast.

▓▓▓▓▓▓▓░░░  77 🟢   ← healthy, keep going
▓▓▓▓░░░░░░  47 🟡   ← caution, plan to /compact
▓░░░░░░░░░  15 🔴   ← critical, stop now

The last 27% of context is where most session failures happen. Health Score makes that visible in real time.

The Score Formula

Two-segment curve matching actual LLM degradation:

0–73% fill  →  score 100 → 50   (gentle linear decay)
73–100% fill →  score 50 → 0    (accelerated collapse)

The 73% threshold came from GitHub issue #5547 - a community request that went unfilled. Health Score fills it.

What It Does

Status line score - a live ▓▓▓▓▓░░░░░ 54 🟡 bar updated after every assistant message. No daemon, no polling - pure bash reading context_window.used_percentage from Claude Code’s native stdin.

Stop hook - when score drops below 40, Claude is blocked from continuing. You see a prompt to run /compact. Sounds annoying. In practice it’s a relief: you stop second-guessing when to compact and just do it when the tool says so.

ScoreStatusAction
70–100🟢 HealthyKeep going
40–69🟡 CautionPlan to /compact
0–39🔴 CriticalStop hook blocks

Install

claude plugin marketplace add silvesterdivas/health-score
claude plugin install health-score@health-score-marketplace
~/.claude/plugins/cache/health-score-marketplace/health-score/1.0.1/install.sh

Restart Claude Code. The bar appears immediately.

Constraints that save you from yourself are worth 10x the tools that let you do whatever you want.