Claude Code の使用状況を確認する
Claude Code のステータスラインが見ている JSON を貼り付けるか、数値を手入力してください ── 以下の計算はすべてブラウザ内で行われ、どこにもアップロードされません。
1. ステータスライン JSON を貼り付ける
ステータスラインオブジェクト全体でも、その中の rate_limits 部分だけでもかまいません。
2. または数値を手入力する
上で貼り付けなかった方のウィンドウを補完します。また、直近の消費ペースの推定値も追加で入力できます。
あなたのウィンドウ
5時間ウィンドウ
上に JSON を貼り付けるか、数値を手入力してください。
7日間(週次)ウィンドウ
上に JSON を貼り付けるか、数値を手入力してください。
グローバルリセットではなく7日間ウィンドウを待っている場合は、リセットを待つ価値はあるかやBanked Resetについての情報もご覧ください。
使えるステータスラインスクリプト
Claude Code のステータスラインに直接 5h: X% · 7d: Y% · reset odds 24h: Z% を表示します。
Claude Code 自身の rate_limits JSON から2つの使用量を読み取り、3つ目はこのサイトの予測 APIから取得します ── ローカルに10分間キャッシュ、ネットワークタイムアウト2秒なので、回線が遅くてもプロンプトがブロックされることはありません。
#!/bin/bash
# claudereset.org example Claude Code status line script.
# Install: save this as ~/.claude/statusline.sh (chmod +x), then set it as your status line
# command per https://code.claude.com/docs/en/statusline — Claude Code pipes the status line's
# JSON into this script's stdin on every prompt render.
#
# Shows your own Claude Code usage (5-hour and 7-day windows, straight from the status line's own
# `rate_limits` object) plus this site's live 24h global-reset-odds forecast. The forecast fetch
# is cached locally for 10 minutes (by file mtime) and capped at a 2-second timeout, so a slow or
# unreachable network never blocks your prompt — it just falls back to showing only the usage
# figures.
set -u
input=$(cat)
# rate_limits is only present for Pro/Max subscribers (or a spend-limited gateway), and only
# after the session's first API response — `// empty` makes jq print nothing rather than "null"
# when it's absent, per code.claude.com/docs/en/statusline's own example.
FIVE_H=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty')
WEEK=$(echo "$input" | jq -r '.rate_limits.seven_day.used_percentage // empty')
LINE=""
[ -n "$FIVE_H" ] && LINE="5h: $(printf '%.0f' "$FIVE_H")%"
[ -n "$WEEK" ] && LINE="${LINE}${LINE:+ · }7d: $(printf '%.0f' "$WEEK")%"
CACHE="$HOME/.cache/claudereset-forecast.json"
mkdir -p "$(dirname "$CACHE")" 2>/dev/null
# 10-minute local cache, judged by the cache file's own mtime (works with either BSD or GNU stat).
CACHE_AGE=999999
if [ -f "$CACHE" ]; then
MTIME=$(stat -f %m "$CACHE" 2>/dev/null || stat -c %Y "$CACHE" 2>/dev/null || echo "")
if [ -n "$MTIME" ]; then
CACHE_AGE=$(( $(date +%s) - MTIME ))
fi
fi
if [ "$CACHE_AGE" -ge 600 ]; then
if curl -s -m 2 https://claudereset.org/api/v1/forecast.json -o "$CACHE.tmp" 2>/dev/null; then
mv "$CACHE.tmp" "$CACHE" 2>/dev/null
else
rm -f "$CACHE.tmp" 2>/dev/null
fi
fi
P24=$(jq -r '.p24 // empty' "$CACHE" 2>/dev/null)
if [ -n "$P24" ]; then
LINE="${LINE}${LINE:+ · }reset odds 24h: ${P24}%"
fi
echo "$LINE"
~/.claude/statusline.sh として保存し、chmod +x を実行してから、ステータスラインコマンドとして設定してください ── 詳しくは公式ステータスラインドキュメントをご覧ください。/developers/にも掲載しています。
ウィンドウが表示されないことがある理由
rate_limitsは Claude.ai の Pro/Max サブスクライバー(または支出上限付きゲートウェイの利用者)にのみ表示され、セッションの最初の API レスポンスの後にしか現れません。five_hour、seven_dayの各ウィンドウは、それぞれ独立して JSON に存在しない場合があります。- 自身のリセット時刻が過ぎると、Claude Code はそのウィンドウをステータスラインから外します。
- このデータを読み取るには Claude Code v2.1.251 以降が必要です。
出典
- code.claude.com/docs/en/statusline ──
rate_limitsを含む、ステータスライン JSON のスキーマ説明。