claude-code-usageCheck Claude Code OAuth usage limits (session & weekly quotas). Use when user asks about Claude Code usage, remaining limits, rate limits, or how much Claude usage they have left. Includes automated session refresh reminders and reset detection monitoring.
Install via ClawdBot CLI:
clawdbot install azaidi94/claude-code-usageCheck your Claude Code OAuth API usage limits for both session (5-hour) and weekly (7-day) windows.
cd {baseDir}
./scripts/claude-usage.sh
# Default: show cached usage (if fresh)
./scripts/claude-usage.sh
# Force refresh from API
./scripts/claude-usage.sh --fresh
# JSON output
./scripts/claude-usage.sh --json
# Custom cache TTL
./scripts/claude-usage.sh --cache-ttl 300
Text format (default):
š¦ Claude Code Usage
ā±ļø Session (5h): š¢ āāāāāāāāāā 40%
Resets in: 2h 15m
š
Weekly (7d): š” āāāāāāāāāā 60%
Resets in: 3d 8h
JSON format (--json):
{
"session": {
"utilization": 40,
"resets_in": "2h 15m",
"resets_at": "2026-01-19T22:15:00Z"
},
"weekly": {
"utilization": 60,
"resets_in": "3d 8h",
"resets_at": "2026-01-22T04:00:00Z"
},
"cached_at": "2026-01-19T20:00:00Z"
}
--fresh flag to bypass cachesecret-tool for credential storageapi.anthropic.com/api/oauth/usage with OAuth bearer tokenfive_hour and seven_day utilization metricsDefault cache: /tmp/claude-usage-cache (60s TTL)
Override:
CACHE_FILE=/tmp/my-cache CACHE_TTL=300 ./scripts/claude-usage.sh
Check usage before starting work:
./scripts/claude-usage.sh --fresh
Integrate with statusline:
usage=$(./scripts/claude-usage.sh | grep "Session" | awk '{print $NF}')
echo "Session: $usage"
Get JSON for monitoring:
./scripts/claude-usage.sh --json | jq '.session.utilization'
Get notified exactly when your 5-hour session quota refreshes!
Quick Setup:
./scripts/session-reminder.sh
This creates a self-scheduling chain of cron jobs that:
What You'll Get:
š Claude Code Session Status
ā±ļø Current usage: 44%
ā° Next refresh: 2h 15m
Your 5-hour quota will reset soon! š¦
ā
Next reminder scheduled for: Jan 22 at 01:22 AM
How It Works:
claude-usage.sh to find the exact session reset timeBenefits:
Get automatic notifications when your Claude Code quotas reset by polling usage.
Quick Setup:
# Test once
./scripts/monitor-usage.sh
# Setup automated monitoring (runs every 30 minutes)
./scripts/setup-monitoring.sh
Or add via Clawdbot directly:
# Check every 30 minutes
clawdbot cron add --cron "*/30 * * * *" \
--message "cd /Users/ali/clawd/skills/claude-code-usage && ./scripts/monitor-usage.sh" \
--name "Claude Code Usage Monitor" \
--session isolated --deliver --channel telegram
What You'll Get:
š Claude Code Session Reset!
ā±ļø Your 5-hour quota has reset
š Usage: 2%
ā° Next reset: 4h 58m
Fresh usage available! š¦
How It Works:
/tmp/claude-usage-state.jsonCustomization:
# Change check interval
clawdbot cron add --cron "*/15 * * * *" ... # Every 15 minutes
clawdbot cron add --cron "0 * * * *" ... # Every hour
# Custom state file location
STATE_FILE=/path/to/state.json ./scripts/monitor-usage.sh
| Feature | Session Reminder | Reset Detection |
|---------|-----------------|-----------------|
| Accuracy | ā Exact minute | ~30min window |
| API calls | Minimal | Every check |
| Notification timing | Right on reset | Up to 30min delay |
| Setup | One command | One command |
| Maintenance | Self-scheduling | Cron runs forever |
Recommendation: Use Session Reminder for precise, real-time notifications.
No credentials found:
claude once to trigger OAuth flowAPI request failed:
--fresh to force new requestLinux users:
Install libsecret for credential storage:
# Debian/Ubuntu
sudo apt install libsecret-tools
# Fedora/RHEL
sudo dnf install libsecret
Generated Mar 1, 2026
Development teams using Claude Code for coding assistance can monitor their API usage to avoid hitting rate limits during critical sprints. This skill helps track session and weekly quotas, ensuring uninterrupted access and optimizing resource allocation across team members.
Freelancers relying on Claude Code for client projects can use this skill to manage their usage limits and schedule work around quota resets. It prevents unexpected interruptions, allowing for better time management and consistent delivery of services.
Universities or training programs with shared Claude Code accounts can implement this skill to monitor usage across students or researchers. It helps enforce fair usage policies and alerts administrators when quotas are nearing limits to adjust access.
Startups using Claude Code for prototyping and development can leverage this skill to track API consumption and avoid overage charges. By monitoring usage patterns, they can optimize workflows and plan budgets more effectively.
Large organizations integrating Claude Code into CI/CD pipelines can use this skill to ensure API quotas are not exceeded during automated processes. It provides real-time insights and notifications to maintain operational efficiency.
Offer a cloud-based service that provides enhanced monitoring and alerting for Claude Code usage, with tiered pricing based on features like advanced analytics or team collaboration tools. Revenue is generated through monthly or annual subscriptions from developers and businesses.
Provide consulting services to help companies integrate this skill into their existing workflows, offering customization, training, and support. Revenue comes from one-time project fees or ongoing retainer agreements for maintenance and updates.
Distribute the skill as a free open-source tool with basic features, while offering premium add-ons such as advanced monitoring dashboards, API integrations, or priority support. Revenue is generated through upgrades and enterprise licenses.
š¬ Integration Tip
Integrate this skill into existing CI/CD pipelines or monitoring dashboards using the JSON output option for automated alerts and data logging.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Provides a 7-step debugging protocol plus language-specific commands to systematically identify, verify, and fix software bugs across multiple environments.
A comprehensive skill for using the Cursor CLI agent for various software engineering tasks (updated for 2026 features, includes tmux automation guide).
Write, run, and manage unit, integration, and E2E tests across TypeScript, Python, and Swift using recommended frameworks.
Control and operate Opencode via slash commands. Use this skill to manage sessions, select models, switch agents (plan/build), and coordinate coding through Opencode.
Coding style memory that adapts to your preferences, conventions, and patterns for consistent coding.