token-usage-optimizerMaximize your Claude Code subscription value with smart usage monitoring and burn rate optimization. Track 5-hour session and 7-day weekly quotas, get one-ti...
Install via ClawdBot CLI:
clawdbot install rusel95/token-usage-optimizerVersion: 1.0.5
Get the most out of your Claude Code subscription by monitoring usage in real-time and optimizing your daily burn rate.
You're paying $20-200/month for Claude Code. Are you:
This skill tracks your 5-hour session and 7-day weekly quotas, calculates your daily burn rate, and tells you if you should use more or throttle back.
Run the setup wizard to configure your OAuth tokens:
cd {baseDir}
./scripts/setup.sh
You'll need:
sk-ant-oat01-...)sk-ant-ort01-...)See references/token-extraction.md for how to get these.
./scripts/check-usage.sh
Output:
SESSION=22.0
WEEKLY=49.0
BURN_RATE=OK
CACHED_AT=1771583780
./scripts/report.sh
Output:
๐ Claude Code Daily Check:
โฑ๏ธ SESSION (5h): 22%
๐
WEEKLY (7d): 49%
โช ะะฐ ัะตะผะฟั โ ะพะฟัะธะผะฐะปัะฝะต ะฒะธะบะพัะธััะฐะฝะฝั
| Plan | Monthly | Weekly Budget | Daily Budget |
|------|---------|---------------|--------------|
| Pro | $20 | ~14% | ~2% |
| Max 100 | $100 | ~14% | ~2% |
| Max 200 | $200 | ~14% | ~2% |
(7-day window resets weekly, so ~14% per day = 100% per week)
Add to your HEARTBEAT.md:
### Evening Check (18:00-20:00)
- Claude Code usage: `/path/to/token-usage-optimizer/scripts/report.sh`
Alerts use state tracking (/tmp/claude-usage-alert-state) to avoid spam.
Default: /tmp/claude-usage.cache with 10-minute TTL.
Override:
CACHE_FILE=/custom/path CACHE_TTL=300 ./scripts/check-usage.sh
scripts/setup.sh โ Initial token configurationscripts/check-usage.sh โ Core usage checker (cached, burn rate calc)scripts/report.sh โ Human-readable daily reportreferences/api-endpoint.md โ Anthropic OAuth API docsreferences/token-extraction.md โ How to get OAuth tokensreferences/plans.md โ Claude Code subscription tiersGET https://api.anthropic.com/api/oauth/usage
Authorization: Bearer <access-token>
anthropic-beta: oauth-2025-04-20
Response:
{
"five_hour": {
"utilization": 22.0,
"resets_at": "2026-02-20T14:00:00.364238+00:00"
},
"seven_day": {
"utilization": 49.0,
"resets_at": "2026-02-24T10:00:01.364256+00:00"
}
}
curl โ API requestsdate โ Timestamp parsinggrep, cut, printf โ Text parsingNo external dependencies (jq, etc.).
Tokens are stored in {baseDir}/.tokens (gitignored).
Never share your access/refresh tokens.
OAuth tokens work for ~1 week, then need manual refresh. Set up 30-minute health check for better reliability:
# Add cron job to check token health every 30 minutes
openclaw cron add \
--name "claude-token-refresh" \
--every 30m \
--announce \
--message "ะะฐะฟัััะธ {baseDir}/scripts/auto-refresh-cron.sh"
What it does:
Manual refresh (once per week, 30 seconds):
claude auth login
# Browser opens โ sign in to claude.ai โ done!
Tokens auto-sync to {baseDir}/.tokens after successful login.
"No token configured"
โ Run ./scripts/setup.sh
"Token expired" / "API request failed"
โ OAuth tokens expire after ~1 week
โ Manual refresh: claude auth login (browser opens โ sign in โ done)
โ Set up hourly health check to get alerts before expiry (see above)
Burn rate shows empty
โ API response missing resets_at โ try again in a few minutes
Auto-refresh failed
โ OAuth refresh endpoint may have changed
โ Manual refresh: claude auth login โ copy new tokens โ run ./scripts/setup.sh
auto-refresh-cron.sh (removed quotes handling)~/.claude/.credentials.jsonFound a bug or have a feature request?
โ Open an issue on ClawHub: https://clawhub.ai/friday/token-usage-optimizer
MIT
Generated Mar 1, 2026
Freelancers using Claude Code for client projects can monitor their 5-hour session and weekly quotas to avoid hitting limits mid-task, ensuring they maximize their $20-200/month investment without overspending. This helps them adjust usage based on project deadlines and budget constraints, providing daily reports to stay on track.
Small teams with Pro subscriptions can use this skill to track collective usage across members, optimizing burn rates to prevent early quota exhaustion. It offers one-time alerts for high usage, enabling proactive adjustments to maintain productivity throughout the week without exceeding plan limits.
Schools or coding bootcamps offering Claude Code to students can implement this to monitor usage across classes, ensuring equitable access and preventing overuse that could lead to additional costs. Daily reports help instructors plan sessions and stay within weekly budgets for cost-effective learning.
Startups using Claude Code for prototyping and development can leverage burn rate tracking to optimize their $100-200/month plans as they grow. This ensures they use resources efficiently, avoiding downtime from hitting quotas and aligning usage with sprint cycles for maximum ROI.
Consultants who rely on Claude Code for client deliverables can use this skill to monitor session and weekly usage, ensuring they deliver value without exceeding subscription limits. It helps in billing accurately and maintaining service quality by staying within optimal burn rates.
A SaaS platform could integrate this skill to offer usage optimization as a feature for clients managing multiple AI tool subscriptions, charging a monthly fee per user. It helps clients reduce waste and improve cost-efficiency, generating revenue through tiered plans based on monitoring depth.
Offer a free version with basic usage tracking and charge for advanced features like detailed analytics, team collaboration, or integration with other productivity tools. This attracts individual developers and converts them to paid plans as their needs grow, creating a steady income stream.
Target large companies with custom deployments of this skill to monitor and optimize AI tool usage across departments, charging based on the number of users or usage volume. It reduces operational costs and improves resource allocation, with revenue from licensing and support contracts.
๐ฌ Integration Tip
Integrate this skill with existing cron jobs or heartbeat systems to automate daily reports and alerts, ensuring minimal setup overhead and seamless usage tracking without manual intervention.
Remove signs of AI-generated writing from text. Use when editing or reviewing text to make it sound more natural and human-written. Based on Wikipedia's comprehensive "Signs of AI writing" guide. Detects and fixes patterns including: inflated symbolism, promotional language, superficial -ing analyses, vague attributions, em dash overuse, rule of three, AI vocabulary words, negative parallelisms, and excessive conjunctive phrases.
Humanize AI-generated text to bypass detection. This humanizer rewrites ChatGPT, Claude, and GPT content to sound natural and pass AI detectors like GPTZero,...
Collaborative thinking partner for exploring complex problems through questioning
Humanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 24 pattern detectors, 500+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
ๆ นๆฎ็จๆท็ๅ่ฝ้ๆฑ๏ผๅฎๆไธ VeADK ็ธๅ ณ็ๅ่ฝใ
Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.