No description
- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
statusline.sh: model + coloured context-window bar for Claude Code. claude-usage-days: weekly plan usage as days, pace, and API spend. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
| claude-usage-days | ||
| README.md | ||
| statusline.sh | ||
claude-code-scripts
Two small helpers for Claude Code.
statusline.sh
A status line showing the current model and how full the context window is:
[Opus] ▓▓▓░░░░░░░ 34% · 68k tok
The bar is green below 50%, yellow from 50%, red from 80%. Requires jq.
Install:
mkdir -p ~/.claude
cp statusline.sh ~/.claude/statusline.sh
then add to ~/.claude/settings.json:
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh"
}
claude-usage-days
Turns your weekly Claude plan usage into days of the 7-day week, and tells you whether you're on pace to run out before the reset.
$ claude-usage-days
Used: 43.0% 3.01 days (3d 0h)
Elapsed: 50.0% 3.50 days (3d 12h)
Pace: 0.9x - OK - projected left at reset: 0.98 days (1d 0h)
- No arguments: fetches live usage using your Claude Code login
(
~/.claude/.credentials.json, via Anthropic's undocumented OAuth usage endpoint, so it may break without notice). Runclaudeonce if the token has expired. claude-usage-days 43orclaude-usage-days 43% 2.5: offline, from a percentage and optionally days until reset.claude-usage-days --api: this month's API spend by model plus a month-end projection. Needs an Admin API key (sk-ant-admin...) in$ANTHROPIC_ADMIN_KEYor~/.config/claude-usage-days/admin-key(chmod 600). When a key is set, the no-argument view shows this too.
Requires bash, python3, awk and GNU date. Install:
install -m 755 claude-usage-days ~/.local/bin/