Skip to content

Esk3nder/context-statusline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Context Statusline for Claude Code

A minimal statusline for Claude Code that shows real-time context window usage with a gradient progress bar.

Context statusline screenshot
── Claude Opus 4.6 (1M context) │ 12m3s │ $0.847
◉ CONTEXT: ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁  37%

The bar gradient shifts from green → yellow → orange → red as context fills up.

Install

Requires jq — install with brew install jq (macOS) or sudo apt install jq (Debian/Ubuntu).

curl -o ~/.claude/context-bar.sh \
  https://raw.githubusercontent.com/Esk3nder/context-statusline/main/context-bar.sh
chmod +x ~/.claude/context-bar.sh

Add to ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/context-bar.sh"
  }
}

Restart Claude Code.

Features

  • Context bar — gradient progress bar showing context window usage
  • Model name — active model displayed in the header
  • Session duration — how long the current session has been running
  • Session cost — estimated cost based on token counts and Anthropic pricing
  • Responsive — adapts to terminal width (nano / micro / mini / normal)

Compaction threshold (optional)

If you want the bar to reach 100% at a specific context percentage (e.g., if compaction kicks in at 69%):

{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/context-bar.sh"
  },
  "contextDisplay": {
    "compactionThreshold": 62
  }
}

Omit or set to 100 for raw 0–100% display.

License

MIT

About

Minimal context window statusline for Claude Code — gradient bar, model, cost, responsive

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages