Well Engineered Tech - Blog

Why I Keep an Eye on My Context Window

- Hamburg, Germany

Dieser Artikel ist auch auf Deutsch verfügbar.

I built a status line for Claude Code that shows how much of the context window remains. The reason is simple: past about 50% utilization, quality noticeably degrades.

This aligns with Chroma Research’s “Context Rot” study, which tested 18 current models.1 The NoLiMa benchmark showed that 11 out of 12 models dropped below 50% of their baseline performance at 32k tokens.2 In my own experience with Claude, things get noticeably worse around 100k to 150k tokens - subtle bugs get missed, instructions forgotten.

Claude Code allows custom status lines. The script reads token values from the JSON input and displays remaining context with color coding: green above 50%, yellow between 20-50%, red below 20%.

The complete script is available as a GitHub Gist . Simply save it as ~/.claude/statusline.sh, make it executable, and add to ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh"
  }
}

The result looks like this:

[Opus 4.5] my-project | Remaining: 82%

With plenty of context remaining, the number shows green. Between 20-50% it turns yellow, below that red. At a glance, I can tell when it’s time for a fresh session.