{
  "schemaVersion": "1.0",
  "item": {
    "slug": "claude-code-usage",
    "name": "Claude Code Usage",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/azaidi94/claude-code-usage",
    "canonicalUrl": "https://clawhub.ai/azaidi94/claude-code-usage",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/claude-code-usage",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=claude-code-usage",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "CRON_SETUP.md",
      "README.md",
      "SKILL.md",
      "scripts/claude-usage.sh",
      "scripts/monitor-and-notify.sh",
      "scripts/monitor-usage.sh"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/claude-code-usage"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/claude-code-usage",
    "agentPageUrl": "https://openagent3.xyz/skills/claude-code-usage/agent",
    "manifestUrl": "https://openagent3.xyz/skills/claude-code-usage/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/claude-code-usage/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Claude Code Usage",
        "body": "Check your Claude Code OAuth API usage limits for both session (5-hour) and weekly (7-day) windows."
      },
      {
        "title": "Quick Start",
        "body": "cd {baseDir}\n./scripts/claude-usage.sh"
      },
      {
        "title": "Usage",
        "body": "# Default: show cached usage (if fresh)\n./scripts/claude-usage.sh\n\n# Force refresh from API\n./scripts/claude-usage.sh --fresh\n\n# JSON output\n./scripts/claude-usage.sh --json\n\n# Custom cache TTL\n./scripts/claude-usage.sh --cache-ttl 300"
      },
      {
        "title": "Output",
        "body": "Text format (default):\n\n🦞 Claude Code Usage\n\n⏱️  Session (5h): 🟢 ████░░░░░░ 40%\n   Resets in: 2h 15m\n\n📅 Weekly (7d): 🟡 ██████░░░░ 60%\n   Resets in: 3d 8h\n\nJSON format (--json):\n\n{\n  \"session\": {\n    \"utilization\": 40,\n    \"resets_in\": \"2h 15m\",\n    \"resets_at\": \"2026-01-19T22:15:00Z\"\n  },\n  \"weekly\": {\n    \"utilization\": 60,\n    \"resets_in\": \"3d 8h\",\n    \"resets_at\": \"2026-01-22T04:00:00Z\"\n  },\n  \"cached_at\": \"2026-01-19T20:00:00Z\"\n}"
      },
      {
        "title": "Features",
        "body": "📊 Session limit (5-hour window) - Short-term rate limit\n📅 Weekly limit (7-day window) - Long-term rate limit\n⚡ Smart caching - 60-second cache to avoid API spam\n🎨 Beautiful output - Progress bars, emojis, color-coded status\n🔄 Force refresh - --fresh flag to bypass cache\n📤 JSON output - Machine-readable format\n🔔 Automated monitoring - Get notified when quotas reset"
      },
      {
        "title": "Status Indicators",
        "body": "🟢 Green - 0-50% usage (healthy)\n🟡 Yellow - 51-80% usage (moderate)\n🔴 Red - 81-100% usage (high/critical)"
      },
      {
        "title": "Requirements",
        "body": "macOS: Uses Keychain to access Claude Code credentials\nLinux: Uses secret-tool for credential storage\nCredentials: Must have Claude Code CLI authenticated"
      },
      {
        "title": "How It Works",
        "body": "Retrieves OAuth token from system keychain\nQueries api.anthropic.com/api/oauth/usage with OAuth bearer token\nParses five_hour and seven_day utilization metrics\nCalculates time remaining until reset\nFormats output with progress bars and status indicators\nCaches result for 60 seconds (configurable)"
      },
      {
        "title": "Cache",
        "body": "Default cache: /tmp/claude-usage-cache (60s TTL)\n\nOverride:\n\nCACHE_FILE=/tmp/my-cache CACHE_TTL=300 ./scripts/claude-usage.sh"
      },
      {
        "title": "Examples",
        "body": "Check usage before starting work:\n\n./scripts/claude-usage.sh --fresh\n\nIntegrate with statusline:\n\nusage=$(./scripts/claude-usage.sh | grep \"Session\" | awk '{print $NF}')\necho \"Session: $usage\"\n\nGet JSON for monitoring:\n\n./scripts/claude-usage.sh --json | jq '.session.utilization'"
      },
      {
        "title": "Session Refresh Reminders (Recommended)",
        "body": "Get notified exactly when your 5-hour session quota refreshes!\n\nQuick Setup:\n\n./scripts/session-reminder.sh\n\nThis creates a self-scheduling chain of cron jobs that:\n\nChecks your current session expiry time\nSchedules the next reminder for when your session refreshes\nNotifies you with current usage stats\nAuto-removes itself (the new cron takes over)\n\nWhat You'll Get:\n\n🔄 Claude Code Session Status\n\n⏱️  Current usage: 44%\n⏰ Next refresh: 2h 15m\n\nYour 5-hour quota will reset soon! 🦞\n\n✅ Next reminder scheduled for: Jan 22 at 01:22 AM\n\nHow It Works:\n\nEach reminder runs claude-usage.sh to find the exact session reset time\nSchedules a one-time cron for that exact moment\nRepeats every 5 hours automatically\nSelf-correcting if session times ever drift\n\nBenefits:\n\n✅ Accurate to the minute\n✅ No manual scheduling needed\n✅ Adapts to your actual usage patterns\n✅ Minimal API calls (only when needed)"
      },
      {
        "title": "Reset Detection Monitor (Alternative)",
        "body": "Get automatic notifications when your Claude Code quotas reset by polling usage.\n\nQuick Setup:\n\n# Test once\n./scripts/monitor-usage.sh\n\n# Setup automated monitoring (runs every 30 minutes)\n./scripts/setup-monitoring.sh\n\nOr add via Clawdbot directly:\n\n# Check every 30 minutes\nclawdbot cron add --cron \"*/30 * * * *\" \\\n  --message \"cd /Users/ali/clawd/skills/claude-code-usage && ./scripts/monitor-usage.sh\" \\\n  --name \"Claude Code Usage Monitor\" \\\n  --session isolated --deliver --channel telegram\n\nWhat You'll Get:\n\n🎉 Claude Code Session Reset!\n\n⏱️  Your 5-hour quota has reset\n📊 Usage: 2%\n⏰ Next reset: 4h 58m\n\nFresh usage available! 🦞\n\nHow It Works:\n\nMonitors usage every 30 minutes (configurable)\nDetects resets when usage drops significantly (>10% or <5%)\nSends notifications via Telegram when resets occur\nTracks state in /tmp/claude-usage-state.json\n\nCustomization:\n\n# Change check interval\nclawdbot cron add --cron \"*/15 * * * *\" ...  # Every 15 minutes\nclawdbot cron add --cron \"0 * * * *\" ...      # Every hour\n\n# Custom state file location\nSTATE_FILE=/path/to/state.json ./scripts/monitor-usage.sh"
      },
      {
        "title": "Which Monitoring Method?",
        "body": "FeatureSession ReminderReset DetectionAccuracy✅ Exact minute~30min windowAPI callsMinimalEvery checkNotification timingRight on resetUp to 30min delaySetupOne commandOne commandMaintenanceSelf-schedulingCron runs forever\n\nRecommendation: Use Session Reminder for precise, real-time notifications."
      },
      {
        "title": "Troubleshooting",
        "body": "No credentials found:\n\nEnsure Claude Code CLI is installed and authenticated\nRun claude once to trigger OAuth flow\n\nAPI request failed:\n\nCheck internet connection\nVerify OAuth token hasn't expired\nTry --fresh to force new request\n\nLinux users:\nInstall libsecret for credential storage:\n\n# Debian/Ubuntu\nsudo apt install libsecret-tools\n\n# Fedora/RHEL\nsudo dnf install libsecret"
      }
    ],
    "body": "Claude Code Usage\n\nCheck your Claude Code OAuth API usage limits for both session (5-hour) and weekly (7-day) windows.\n\nQuick Start\ncd {baseDir}\n./scripts/claude-usage.sh\n\nUsage\n# Default: show cached usage (if fresh)\n./scripts/claude-usage.sh\n\n# Force refresh from API\n./scripts/claude-usage.sh --fresh\n\n# JSON output\n./scripts/claude-usage.sh --json\n\n# Custom cache TTL\n./scripts/claude-usage.sh --cache-ttl 300\n\nOutput\n\nText format (default):\n\n🦞 Claude Code Usage\n\n⏱️  Session (5h): 🟢 ████░░░░░░ 40%\n   Resets in: 2h 15m\n\n📅 Weekly (7d): 🟡 ██████░░░░ 60%\n   Resets in: 3d 8h\n\n\nJSON format (--json):\n\n{\n  \"session\": {\n    \"utilization\": 40,\n    \"resets_in\": \"2h 15m\",\n    \"resets_at\": \"2026-01-19T22:15:00Z\"\n  },\n  \"weekly\": {\n    \"utilization\": 60,\n    \"resets_in\": \"3d 8h\",\n    \"resets_at\": \"2026-01-22T04:00:00Z\"\n  },\n  \"cached_at\": \"2026-01-19T20:00:00Z\"\n}\n\nFeatures\n📊 Session limit (5-hour window) - Short-term rate limit\n📅 Weekly limit (7-day window) - Long-term rate limit\n⚡ Smart caching - 60-second cache to avoid API spam\n🎨 Beautiful output - Progress bars, emojis, color-coded status\n🔄 Force refresh - --fresh flag to bypass cache\n📤 JSON output - Machine-readable format\n🔔 Automated monitoring - Get notified when quotas reset\nStatus Indicators\n🟢 Green - 0-50% usage (healthy)\n🟡 Yellow - 51-80% usage (moderate)\n🔴 Red - 81-100% usage (high/critical)\nRequirements\nmacOS: Uses Keychain to access Claude Code credentials\nLinux: Uses secret-tool for credential storage\nCredentials: Must have Claude Code CLI authenticated\nHow It Works\nRetrieves OAuth token from system keychain\nQueries api.anthropic.com/api/oauth/usage with OAuth bearer token\nParses five_hour and seven_day utilization metrics\nCalculates time remaining until reset\nFormats output with progress bars and status indicators\nCaches result for 60 seconds (configurable)\nCache\n\nDefault cache: /tmp/claude-usage-cache (60s TTL)\n\nOverride:\n\nCACHE_FILE=/tmp/my-cache CACHE_TTL=300 ./scripts/claude-usage.sh\n\nExamples\n\nCheck usage before starting work:\n\n./scripts/claude-usage.sh --fresh\n\n\nIntegrate with statusline:\n\nusage=$(./scripts/claude-usage.sh | grep \"Session\" | awk '{print $NF}')\necho \"Session: $usage\"\n\n\nGet JSON for monitoring:\n\n./scripts/claude-usage.sh --json | jq '.session.utilization'\n\nAutomated Monitoring\nSession Refresh Reminders (Recommended)\n\nGet notified exactly when your 5-hour session quota refreshes!\n\nQuick Setup:\n\n./scripts/session-reminder.sh\n\n\nThis creates a self-scheduling chain of cron jobs that:\n\nChecks your current session expiry time\nSchedules the next reminder for when your session refreshes\nNotifies you with current usage stats\nAuto-removes itself (the new cron takes over)\n\nWhat You'll Get:\n\n🔄 Claude Code Session Status\n\n⏱️  Current usage: 44%\n⏰ Next refresh: 2h 15m\n\nYour 5-hour quota will reset soon! 🦞\n\n✅ Next reminder scheduled for: Jan 22 at 01:22 AM\n\n\nHow It Works:\n\nEach reminder runs claude-usage.sh to find the exact session reset time\nSchedules a one-time cron for that exact moment\nRepeats every 5 hours automatically\nSelf-correcting if session times ever drift\n\nBenefits:\n\n✅ Accurate to the minute\n✅ No manual scheduling needed\n✅ Adapts to your actual usage patterns\n✅ Minimal API calls (only when needed)\nReset Detection Monitor (Alternative)\n\nGet automatic notifications when your Claude Code quotas reset by polling usage.\n\nQuick Setup:\n\n# Test once\n./scripts/monitor-usage.sh\n\n# Setup automated monitoring (runs every 30 minutes)\n./scripts/setup-monitoring.sh\n\n\nOr add via Clawdbot directly:\n\n# Check every 30 minutes\nclawdbot cron add --cron \"*/30 * * * *\" \\\n  --message \"cd /Users/ali/clawd/skills/claude-code-usage && ./scripts/monitor-usage.sh\" \\\n  --name \"Claude Code Usage Monitor\" \\\n  --session isolated --deliver --channel telegram\n\n\nWhat You'll Get:\n\n🎉 Claude Code Session Reset!\n\n⏱️  Your 5-hour quota has reset\n📊 Usage: 2%\n⏰ Next reset: 4h 58m\n\nFresh usage available! 🦞\n\n\nHow It Works:\n\nMonitors usage every 30 minutes (configurable)\nDetects resets when usage drops significantly (>10% or <5%)\nSends notifications via Telegram when resets occur\nTracks state in /tmp/claude-usage-state.json\n\nCustomization:\n\n# Change check interval\nclawdbot cron add --cron \"*/15 * * * *\" ...  # Every 15 minutes\nclawdbot cron add --cron \"0 * * * *\" ...      # Every hour\n\n# Custom state file location\nSTATE_FILE=/path/to/state.json ./scripts/monitor-usage.sh\n\nWhich Monitoring Method?\nFeature\tSession Reminder\tReset Detection\nAccuracy\t✅ Exact minute\t~30min window\nAPI calls\tMinimal\tEvery check\nNotification timing\tRight on reset\tUp to 30min delay\nSetup\tOne command\tOne command\nMaintenance\tSelf-scheduling\tCron runs forever\n\nRecommendation: Use Session Reminder for precise, real-time notifications.\n\nTroubleshooting\n\nNo credentials found:\n\nEnsure Claude Code CLI is installed and authenticated\nRun claude once to trigger OAuth flow\n\nAPI request failed:\n\nCheck internet connection\nVerify OAuth token hasn't expired\nTry --fresh to force new request\n\nLinux users: Install libsecret for credential storage:\n\n# Debian/Ubuntu\nsudo apt install libsecret-tools\n\n# Fedora/RHEL\nsudo dnf install libsecret"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/azaidi94/claude-code-usage",
    "publisherUrl": "https://clawhub.ai/azaidi94/claude-code-usage",
    "owner": "azaidi94",
    "version": "1.2.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/claude-code-usage",
    "downloadUrl": "https://openagent3.xyz/downloads/claude-code-usage",
    "agentUrl": "https://openagent3.xyz/skills/claude-code-usage/agent",
    "manifestUrl": "https://openagent3.xyz/skills/claude-code-usage/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/claude-code-usage/agent.md"
  }
}