{
  "schemaVersion": "1.0",
  "item": {
    "slug": "tokenmeter",
    "name": "tokenmeter",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/cheenu1092-oss/tokenmeter",
    "canonicalUrl": "https://clawhub.ai/cheenu1092-oss/tokenmeter",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/tokenmeter",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=tokenmeter",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "QUICKREF.md",
      "README.md",
      "SKILL.md",
      "TASK.md",
      "examples/daily-report.sh",
      "examples/test-installation.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/tokenmeter"
    },
    "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/tokenmeter",
    "agentPageUrl": "https://openagent3.xyz/skills/tokenmeter/agent",
    "manifestUrl": "https://openagent3.xyz/skills/tokenmeter/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/tokenmeter/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": "tokenmeter - AI Usage & Cost Tracking for OpenClaw",
        "body": "Track your AI token usage and costs across all providers — locally, privately."
      },
      {
        "title": "Slash Command Examples",
        "body": "/tokenmeter — show today's dashboard\n/tokenmeter how much did we spend this week? — weekly cost report\n/tokenmeter costs breakdown by model — model split analysis\n/tokenmeter import latest sessions — pull in new usage data\n/tokenmeter compare max plan savings — show API vs subscription savings"
      },
      {
        "title": "Overview",
        "body": "tokenmeter is a CLI tool that tracks LLM API usage and calculates real-time cost estimates. For OpenClaw users on the Claude Max plan, it helps:\n\nProve Max plan value - Show what you would have paid on API billing\nMonitor usage patterns - Understand which models you use most\nCatch overages early - Know if you're using expensive models too much\nUnified tracking - Track usage across multiple OpenClaw instances\n\nAll data stays local (SQLite at ~/.tokenmeter/usage.db). No telemetry, no cloud sync."
      },
      {
        "title": "Installation",
        "body": "The bot handles everything automatically.\n\nWhen first needed, the bot will:\n\n# 1. Clone repo if it doesn't exist\nif [ ! -d ~/clawd/tokenmeter ]; then\n  cd ~/clawd\n  git clone https://github.com/jugaad-lab/tokenmeter.git\nfi\n\n# 2. Setup Python venv if it doesn't exist\ncd ~/clawd/tokenmeter\nif [ ! -d \".venv\" ]; then\n  python3 -m venv .venv\n  source .venv/bin/activate\n  pip install -e .\nfi\n\n# 3. Activate and use\nsource .venv/bin/activate\ntokenmeter import --auto\n\nAfter first setup: Bot just activates venv and runs commands.\n\nNo admin action needed - the bot clones, installs, and configures automatically when you first ask it to check usage or costs."
      },
      {
        "title": "When You Ask: \"How much did I spend this week?\"",
        "body": "Step 1: Bot reads this SKILL.md\n\nSkill matching triggers on keywords: \"spend\", \"cost\", \"usage\", \"tokens\"\nBot loads this entire file into context\n\nStep 2: Bot checks if tokenmeter exists\n\nif [ ! -d ~/clawd/tokenmeter ]; then\n  cd ~/clawd\n  git clone https://github.com/jugaad-lab/tokenmeter.git\n  cd tokenmeter\n  python3 -m venv .venv\n  source .venv/bin/activate\n  pip install -e .\nfi\n\nStep 3: Bot imports latest usage\n\ncd ~/clawd/tokenmeter\nsource .venv/bin/activate\ntokenmeter import --auto\n\nThis reads all OpenClaw session files and logs them to the database.\n\nStep 4: Bot runs the appropriate command\n\ntokenmeter costs --period week\n\nStep 5: Bot parses the output\n\nModel                    Cost      % of Total\n────────────────────────────────────────────\nanthropic/claude-opus-4  $741.95   65.0%\nanthropic/claude-sonnet-4 $400.26  35.0%\n────────────────────────────────────────────\nTotal                    $1,142.22\n\nStep 6: Bot responds to you in plain English\n\n\"You spent $1,142 this week (API-equivalent). Opus cost $742 (65%), Sonnet cost $400 (35%). Your Max plan ($100/month = ~$25/week) saved you $1,117 this week.\""
      },
      {
        "title": "Bot Command Reference",
        "body": "Standard pattern:\n\ncd ~/clawd/tokenmeter && source .venv/bin/activate && tokenmeter [command]\n\nCommon commands the bot will use:\n\n# Import latest usage\ntokenmeter import --auto\n\n# Quick overview\ntokenmeter dashboard\n\n# Weekly breakdown\ntokenmeter costs --period week\n\n# Monthly summary\ntokenmeter summary --period month"
      },
      {
        "title": "Quick Commands",
        "body": "# Discover session sources (OpenClaw, Claude Code, etc.)\ntokenmeter scan\n\n# Import all discovered sessions\ntokenmeter import --auto\n\n# Preview import without writing\ntokenmeter import --auto --dry-run\n\n# Show today's usage\ntokenmeter dashboard\n\n# Weekly summary\ntokenmeter summary --period week\n\n# Cost breakdown by model\ntokenmeter costs --period month\n\n# List all supported models + pricing\ntokenmeter models\n\n# View recent history\ntokenmeter history --limit 20"
      },
      {
        "title": "Automatic Import (Recommended)",
        "body": "OpenClaw writes token usage to session JSONL files at:\n\n~/.clawdbot/agents/*/sessions/*.jsonl\n\nStep 1: Discover session sources\n\ncd ~/clawd/tokenmeter\nsource .venv/bin/activate\ntokenmeter scan\n\nThis shows all discovered session directories:\n\n.clawdbot/agents/main/sessions/ (OpenClaw)\n.claude/projects/*/sessions/ (Claude Code)\nAny other compatible session formats\n\nStep 2: Import all at once\n\ntokenmeter import --auto\n\nThis will:\n\nParse all discovered session files\nExtract token usage from each LLM call\nLog to tokenmeter with API-equivalent costs\nSkip already-imported entries (idempotent)\nShow total records and cost\n\nOptions:\n\ntokenmeter import --auto --dry-run  # Preview without writing\ntokenmeter import --path ~/.clawdbot/agents/main/sessions/  # Import specific directory\n\nRecommended: Run tokenmeter import --auto daily via cron or manually after heavy usage."
      },
      {
        "title": "Manual Logging (Fallback)",
        "body": "If you need to log usage manually:\n\ntokenmeter log \\\n  --provider anthropic \\\n  --model claude-sonnet-4 \\\n  --input 1500 \\\n  --output 500 \\\n  --app openclaw\n\nOptions:\n\n--provider / -p: anthropic, openai, google, azure\n--model / -m: Model name (see tokenmeter models)\n--input / -i: Input tokens\n--output / -o: Output tokens\n--app / -a: Application name (e.g., \"openclaw\")"
      },
      {
        "title": "Model Pricing (as of Feb 2026)",
        "body": "Token Typeclaude-sonnet-4claude-opus-4claude-3.5-haikuInput$3.00/1M$15.00/1M$0.80/1MOutput$15.00/1M$75.00/1M$4.00/1MCache Write$3.75/1M$18.75/1M$1.00/1MCache Read$0.30/1M$1.50/1M$0.08/1M"
      },
      {
        "title": "Understanding Cache Tokens",
        "body": "What are cache tokens?\n\nOpenClaw (and Claude) use prompt caching to store parts of your conversation in memory. This means you don't send the same context repeatedly.\n\nTwo types of cache tokens:\n\nCache WRITE tokens - Tokens sent ONCE and stored in cache\n\nExample: Your entire codebase, documentation, system prompts\nSlightly more expensive than regular input (~25% markup)\nOnly paid once, then reused for free (almost)\n\n\n\nCache READ tokens - Tokens reused from cache\n\nYou're NOT sending these again - Claude reads them from memory\n90% cheaper than regular input tokens\nThis is where massive savings come from\n\nReal example from our usage:\n\nThis Month:\nRegular Input:    119.5K tokens  ($0.36)\nRegular Output:     3.8M tokens  ($57.00)\nCache Write:      157.2M tokens  ($589.50 - paid once)\nCache Read:     1,024.3M tokens  ($307.29 - 90% discount!)\nTotal: $954.15\n\nWithout caching, we'd send ~1.2 BILLION tokens as regular input ($3,600+).\nWith caching: We only pay $307 for those cache reads.\n\nSavings: $3,293 from caching alone this month! 🎉"
      },
      {
        "title": "Reading the Dashboard",
        "body": "╭─────────────────── tokenmeter ───────────────────╮\n│  TODAY  $122.42  (396.9K tokens)                 │\n│  WEEK  $1142.22  (3.4M tokens)                   │\n╰──────────────────────────────────────────────────╯\n\nProvider   Input   Output  Cache R  Cache W  Total    Cost\n───────────────────────────────────────────────────────────\nAnthropic  12.2K   384.7K  116.4M   13.1M    396.9K   $122.42\n\nReading the columns:\n\nInput: Fresh tokens sent to Claude\nOutput: Tokens Claude generated\nCache R: Tokens reused from cache (READ)\nCache W: Tokens written to cache (WRITE)\nTotal: Input + Output (regular tokens only)\nCost: API-equivalent cost\n\nWhy Cache R is so large: Every time you continue a conversation, Claude reads your entire context from cache instead of you sending it fresh. Over many turns, this adds up to billions of tokens reused.\n\nCost breakdown:\n\nRegular tokens: Expensive ($3-15 per 1M)\nCache Write: Slightly more expensive (~25% markup)\nCache Read: 90% cheaper ($0.30-1.50 per 1M)\n\nThis is why the cost stays low despite huge cache numbers."
      },
      {
        "title": "Comparing to Claude Max Plan",
        "body": "Your Max plan: $100/month flat rate\n\nIf tokenmeter shows $800 this month:\n\nAPI-equivalent cost: $800\nMax plan cost: $100\nSavings: $700 ✅\n\nIf tokenmeter shows $90 this month:\n\nAPI-equivalent cost: $90\nMax plan cost: $100\nOverpaying by $10 (but you get peace of mind!)"
      },
      {
        "title": "Daily Check-In",
        "body": "cd ~/clawd/tokenmeter\nsource .venv/bin/activate\n\n# Import latest usage\ntokenmeter import --auto\n\n# Quick overview\ntokenmeter dashboard"
      },
      {
        "title": "Weekly Review",
        "body": "tokenmeter summary --period week\ntokenmeter costs --period week\n\nLook for:\n\nHeavy Opus usage (expensive!)\nUnusual spikes\nHigh output token counts (code generation, long responses)"
      },
      {
        "title": "Monthly Billing Comparison",
        "body": "At month end:\n\ntokenmeter costs --period month\n\nCompare to your Anthropic invoice:\n\nMax plan: $100 flat\nAPI-equivalent (tokenmeter): $XXX\nDelta = savings (or loss)"
      },
      {
        "title": "Cron Automation (Optional)",
        "body": "Add to your HEARTBEAT.md or run via cron:\n\n# Run daily at 11 PM\n0 23 * * * cd ~/clawd/tokenmeter && source .venv/bin/activate && tokenmeter import --auto\n\nThis keeps tokenmeter in sync without manual effort."
      },
      {
        "title": "Multi-Bot Tracking",
        "body": "If you run multiple OpenClaw instances (e.g., Cheenu + Chhotu):\n\nBoth bots import to tokenmeter on their respective machines\nEach uses --app flag to distinguish:\ntokenmeter log -p anthropic -m claude-sonnet-4 -i 1000 -o 500 --app cheenu\ntokenmeter log -p anthropic -m claude-sonnet-4 -i 800 -o 400 --app chhotu\n\n\nNagaconda can aggregate reports from both to see total team usage"
      },
      {
        "title": "\"tokenmeter: command not found\"",
        "body": "Activate the virtual environment:\n\ncd ~/clawd/skills/tokenmeter\nsource .venv/bin/activate"
      },
      {
        "title": "Empty dashboard after import",
        "body": "Check:\n\nOpenClaw session files exist: ls ~/.clawdbot/agents/*/sessions/*.jsonl\nImport command ran successfully (no errors)\nDatabase has entries: sqlite3 ~/.tokenmeter/usage.db \"SELECT COUNT(*) FROM usage;\""
      },
      {
        "title": "Prices seem wrong",
        "body": "Pricing is based on API rates as of Feb 2026. If Anthropic changes pricing, update tokenmeter/pricing.py or open an issue on GitHub."
      },
      {
        "title": "Example 1: Check today's usage",
        "body": "$ tokenmeter dashboard\n╭─────────────────── tokenmeter ───────────────────╮\n│  TODAY  $4.23  (141,000 tokens)                  │\n│  WEEK   $28.90  (963,000 tokens)                 │\n╰──────────────────────────────────────────────────╯\n\nAnalysis: $4.23 today, trending toward ~$30/week. Well within Max plan ($100/mo)."
      },
      {
        "title": "Example 2: Weekly cost breakdown",
        "body": "$ tokenmeter costs --period week\n\nProvider   Model              Input      Output     Cost      %\n─────────────────────────────────────────────────────────────\nAnthropic  claude-sonnet-4    450K       180K       $4.05    45%\nAnthropic  claude-opus-4       90K        30K       $3.60    40%\nAnthropic  claude-3.5-haiku   800K       200K       $1.44    15%\n─────────────────────────────────────────────────────────────\nTotal                        1,340K      410K       $9.09   100%\n\nAnalysis: Using Opus for 40% of costs but only ~7% of token volume. Consider using Sonnet more."
      },
      {
        "title": "Example 3: Month-end comparison (Real Data - Feb 2026)",
        "body": "$ tokenmeter import --auto\nImported 13,713 records\nTotal cost: $1,246.55\n\n$ tokenmeter costs --period month\n\nModel                    Input   Output    Cost      % of Total\n─────────────────────────────────────────────────────────────────\nanthropic/claude-opus-4  47.3K   1.6M      $743.35   59.6%\nanthropic/claude-sonnet-4 70.8K  2.2M      $501.75   40.3%\n─────────────────────────────────────────────────────────────────\nTotal                    118.8K  3.8M      $1,246.55 100%\n\n$ tokenmeter summary --period month\n\nProvider   Input    Output   Total    Cost        Requests\n─────────────────────────────────────────────────────────\nAnthropic  118.8K   3.8M     3.9M     $1,246.55   12,552\n\nAnalysis:\n\nAPI-equivalent cost: $1,246.55\nMax plan cost: $100.00\nSavings: $1,146.55 ✅\n\nOpus usage (59.6% of cost) shows heavy extended-thinking use. Max plan absolutely paid for itself this month!"
      },
      {
        "title": "FAQ",
        "body": "Q: Does tokenmeter send data anywhere?\nA: No. Everything is stored locally in ~/.tokenmeter/usage.db. Zero telemetry.\n\nQ: What if I delete the database?\nA: You lose history, but can rebuild by re-importing OpenClaw sessions (idempotent).\n\nQ: Can I use this with non-OpenClaw tools?\nA: Yes! It supports Claude Code, Cursor, and manual logging for any LLM tool.\n\nQ: Will this slow down OpenClaw?\nA: No. Import runs separately and reads logs after-the-fact.\n\nQ: What about cache tokens?\nA: tokenmeter includes cache read/write tokens in its calculations (OpenClaw tracks them)."
      },
      {
        "title": "References",
        "body": "GitHub: https://github.com/jugaad-lab/tokenmeter\nOpenClaw Docs: https://docs.openclaw.ai\nAnthropic Pricing: https://anthropic.com/pricing"
      },
      {
        "title": "2026-02-06 (v2)",
        "body": "✅ tokenmeter scan - Auto-discover session sources\n✅ tokenmeter import --auto - Import all discovered sessions\n✅ Real data example showing $1,146 monthly savings on Max plan\n✅ Updated workflows with new commands\n✅ Tested on actual OpenClaw + Claude Code sessions"
      },
      {
        "title": "2026-02-06 (v1)",
        "body": "Initial skill creation\nDocumented installation and usage\nAdded workflow examples\n\nBuilt to answer the question: \"How much is my Max plan really saving me?\" 💰"
      }
    ],
    "body": "tokenmeter - AI Usage & Cost Tracking for OpenClaw\n\nTrack your AI token usage and costs across all providers — locally, privately.\n\nSlash Command Examples\n/tokenmeter — show today's dashboard\n/tokenmeter how much did we spend this week? — weekly cost report\n/tokenmeter costs breakdown by model — model split analysis\n/tokenmeter import latest sessions — pull in new usage data\n/tokenmeter compare max plan savings — show API vs subscription savings\nOverview\n\ntokenmeter is a CLI tool that tracks LLM API usage and calculates real-time cost estimates. For OpenClaw users on the Claude Max plan, it helps:\n\nProve Max plan value - Show what you would have paid on API billing\nMonitor usage patterns - Understand which models you use most\nCatch overages early - Know if you're using expensive models too much\nUnified tracking - Track usage across multiple OpenClaw instances\n\nAll data stays local (SQLite at ~/.tokenmeter/usage.db). No telemetry, no cloud sync.\n\nInstallation\n\nThe bot handles everything automatically.\n\nWhen first needed, the bot will:\n\n# 1. Clone repo if it doesn't exist\nif [ ! -d ~/clawd/tokenmeter ]; then\n  cd ~/clawd\n  git clone https://github.com/jugaad-lab/tokenmeter.git\nfi\n\n# 2. Setup Python venv if it doesn't exist\ncd ~/clawd/tokenmeter\nif [ ! -d \".venv\" ]; then\n  python3 -m venv .venv\n  source .venv/bin/activate\n  pip install -e .\nfi\n\n# 3. Activate and use\nsource .venv/bin/activate\ntokenmeter import --auto\n\n\nAfter first setup: Bot just activates venv and runs commands.\n\nNo admin action needed - the bot clones, installs, and configures automatically when you first ask it to check usage or costs.\n\nHow the Bot Uses This Tool\nWhen You Ask: \"How much did I spend this week?\"\n\nStep 1: Bot reads this SKILL.md\n\nSkill matching triggers on keywords: \"spend\", \"cost\", \"usage\", \"tokens\"\nBot loads this entire file into context\n\nStep 2: Bot checks if tokenmeter exists\n\nif [ ! -d ~/clawd/tokenmeter ]; then\n  cd ~/clawd\n  git clone https://github.com/jugaad-lab/tokenmeter.git\n  cd tokenmeter\n  python3 -m venv .venv\n  source .venv/bin/activate\n  pip install -e .\nfi\n\n\nStep 3: Bot imports latest usage\n\ncd ~/clawd/tokenmeter\nsource .venv/bin/activate\ntokenmeter import --auto\n\n\nThis reads all OpenClaw session files and logs them to the database.\n\nStep 4: Bot runs the appropriate command\n\ntokenmeter costs --period week\n\n\nStep 5: Bot parses the output\n\nModel                    Cost      % of Total\n────────────────────────────────────────────\nanthropic/claude-opus-4  $741.95   65.0%\nanthropic/claude-sonnet-4 $400.26  35.0%\n────────────────────────────────────────────\nTotal                    $1,142.22\n\n\nStep 6: Bot responds to you in plain English\n\n\"You spent $1,142 this week (API-equivalent). Opus cost $742 (65%), Sonnet cost $400 (35%). Your Max plan ($100/month = ~$25/week) saved you $1,117 this week.\"\n\nBot Command Reference\n\nStandard pattern:\n\ncd ~/clawd/tokenmeter && source .venv/bin/activate && tokenmeter [command]\n\n\nCommon commands the bot will use:\n\n# Import latest usage\ntokenmeter import --auto\n\n# Quick overview\ntokenmeter dashboard\n\n# Weekly breakdown\ntokenmeter costs --period week\n\n# Monthly summary\ntokenmeter summary --period month\n\nUsage\nQuick Commands\n# Discover session sources (OpenClaw, Claude Code, etc.)\ntokenmeter scan\n\n# Import all discovered sessions\ntokenmeter import --auto\n\n# Preview import without writing\ntokenmeter import --auto --dry-run\n\n# Show today's usage\ntokenmeter dashboard\n\n# Weekly summary\ntokenmeter summary --period week\n\n# Cost breakdown by model\ntokenmeter costs --period month\n\n# List all supported models + pricing\ntokenmeter models\n\n# View recent history\ntokenmeter history --limit 20\n\nIntegration with OpenClaw\nAutomatic Import (Recommended)\n\nOpenClaw writes token usage to session JSONL files at:\n\n~/.clawdbot/agents/*/sessions/*.jsonl\n\n\nStep 1: Discover session sources\n\ncd ~/clawd/tokenmeter\nsource .venv/bin/activate\ntokenmeter scan\n\n\nThis shows all discovered session directories:\n\n.clawdbot/agents/main/sessions/ (OpenClaw)\n.claude/projects/*/sessions/ (Claude Code)\nAny other compatible session formats\n\nStep 2: Import all at once\n\ntokenmeter import --auto\n\n\nThis will:\n\nParse all discovered session files\nExtract token usage from each LLM call\nLog to tokenmeter with API-equivalent costs\nSkip already-imported entries (idempotent)\nShow total records and cost\n\nOptions:\n\ntokenmeter import --auto --dry-run  # Preview without writing\ntokenmeter import --path ~/.clawdbot/agents/main/sessions/  # Import specific directory\n\n\nRecommended: Run tokenmeter import --auto daily via cron or manually after heavy usage.\n\nManual Logging (Fallback)\n\nIf you need to log usage manually:\n\ntokenmeter log \\\n  --provider anthropic \\\n  --model claude-sonnet-4 \\\n  --input 1500 \\\n  --output 500 \\\n  --app openclaw\n\n\nOptions:\n\n--provider / -p: anthropic, openai, google, azure\n--model / -m: Model name (see tokenmeter models)\n--input / -i: Input tokens\n--output / -o: Output tokens\n--app / -a: Application name (e.g., \"openclaw\")\nUnderstanding the Data\nModel Pricing (as of Feb 2026)\nToken Type\tclaude-sonnet-4\tclaude-opus-4\tclaude-3.5-haiku\nInput\t$3.00/1M\t$15.00/1M\t$0.80/1M\nOutput\t$15.00/1M\t$75.00/1M\t$4.00/1M\nCache Write\t$3.75/1M\t$18.75/1M\t$1.00/1M\nCache Read\t$0.30/1M\t$1.50/1M\t$0.08/1M\nUnderstanding Cache Tokens\n\nWhat are cache tokens?\n\nOpenClaw (and Claude) use prompt caching to store parts of your conversation in memory. This means you don't send the same context repeatedly.\n\nTwo types of cache tokens:\n\nCache WRITE tokens - Tokens sent ONCE and stored in cache\n\nExample: Your entire codebase, documentation, system prompts\nSlightly more expensive than regular input (~25% markup)\nOnly paid once, then reused for free (almost)\n\nCache READ tokens - Tokens reused from cache\n\nYou're NOT sending these again - Claude reads them from memory\n90% cheaper than regular input tokens\nThis is where massive savings come from\n\nReal example from our usage:\n\nThis Month:\nRegular Input:    119.5K tokens  ($0.36)\nRegular Output:     3.8M tokens  ($57.00)\nCache Write:      157.2M tokens  ($589.50 - paid once)\nCache Read:     1,024.3M tokens  ($307.29 - 90% discount!)\nTotal: $954.15\n\n\nWithout caching, we'd send ~1.2 BILLION tokens as regular input ($3,600+). With caching: We only pay $307 for those cache reads.\n\nSavings: $3,293 from caching alone this month! 🎉\n\nReading the Dashboard\n╭─────────────────── tokenmeter ───────────────────╮\n│  TODAY  $122.42  (396.9K tokens)                 │\n│  WEEK  $1142.22  (3.4M tokens)                   │\n╰──────────────────────────────────────────────────╯\n\nProvider   Input   Output  Cache R  Cache W  Total    Cost\n───────────────────────────────────────────────────────────\nAnthropic  12.2K   384.7K  116.4M   13.1M    396.9K   $122.42\n\n\nReading the columns:\n\nInput: Fresh tokens sent to Claude\nOutput: Tokens Claude generated\nCache R: Tokens reused from cache (READ)\nCache W: Tokens written to cache (WRITE)\nTotal: Input + Output (regular tokens only)\nCost: API-equivalent cost\n\nWhy Cache R is so large: Every time you continue a conversation, Claude reads your entire context from cache instead of you sending it fresh. Over many turns, this adds up to billions of tokens reused.\n\nCost breakdown:\n\nRegular tokens: Expensive ($3-15 per 1M)\nCache Write: Slightly more expensive (~25% markup)\nCache Read: 90% cheaper ($0.30-1.50 per 1M)\n\nThis is why the cost stays low despite huge cache numbers.\n\nComparing to Claude Max Plan\n\nYour Max plan: $100/month flat rate\n\nIf tokenmeter shows $800 this month:\n\nAPI-equivalent cost: $800\nMax plan cost: $100\nSavings: $700 ✅\n\nIf tokenmeter shows $90 this month:\n\nAPI-equivalent cost: $90\nMax plan cost: $100\nOverpaying by $10 (but you get peace of mind!)\nWorkflows\nDaily Check-In\ncd ~/clawd/tokenmeter\nsource .venv/bin/activate\n\n# Import latest usage\ntokenmeter import --auto\n\n# Quick overview\ntokenmeter dashboard\n\nWeekly Review\ntokenmeter summary --period week\ntokenmeter costs --period week\n\n\nLook for:\n\nHeavy Opus usage (expensive!)\nUnusual spikes\nHigh output token counts (code generation, long responses)\nMonthly Billing Comparison\n\nAt month end:\n\ntokenmeter costs --period month\n\n\nCompare to your Anthropic invoice:\n\nMax plan: $100 flat\nAPI-equivalent (tokenmeter): $XXX\nDelta = savings (or loss)\nCron Automation (Optional)\n\nAdd to your HEARTBEAT.md or run via cron:\n\n# Run daily at 11 PM\n0 23 * * * cd ~/clawd/tokenmeter && source .venv/bin/activate && tokenmeter import --auto\n\n\nThis keeps tokenmeter in sync without manual effort.\n\nMulti-Bot Tracking\n\nIf you run multiple OpenClaw instances (e.g., Cheenu + Chhotu):\n\nBoth bots import to tokenmeter on their respective machines\nEach uses --app flag to distinguish:\ntokenmeter log -p anthropic -m claude-sonnet-4 -i 1000 -o 500 --app cheenu\ntokenmeter log -p anthropic -m claude-sonnet-4 -i 800 -o 400 --app chhotu\n\nNagaconda can aggregate reports from both to see total team usage\nTroubleshooting\n\"tokenmeter: command not found\"\n\nActivate the virtual environment:\n\ncd ~/clawd/skills/tokenmeter\nsource .venv/bin/activate\n\nEmpty dashboard after import\n\nCheck:\n\nOpenClaw session files exist: ls ~/.clawdbot/agents/*/sessions/*.jsonl\nImport command ran successfully (no errors)\nDatabase has entries: sqlite3 ~/.tokenmeter/usage.db \"SELECT COUNT(*) FROM usage;\"\nPrices seem wrong\n\nPricing is based on API rates as of Feb 2026. If Anthropic changes pricing, update tokenmeter/pricing.py or open an issue on GitHub.\n\nExamples\nExample 1: Check today's usage\n$ tokenmeter dashboard\n╭─────────────────── tokenmeter ───────────────────╮\n│  TODAY  $4.23  (141,000 tokens)                  │\n│  WEEK   $28.90  (963,000 tokens)                 │\n╰──────────────────────────────────────────────────╯\n\n\nAnalysis: $4.23 today, trending toward ~$30/week. Well within Max plan ($100/mo).\n\nExample 2: Weekly cost breakdown\n$ tokenmeter costs --period week\n\nProvider   Model              Input      Output     Cost      %\n─────────────────────────────────────────────────────────────\nAnthropic  claude-sonnet-4    450K       180K       $4.05    45%\nAnthropic  claude-opus-4       90K        30K       $3.60    40%\nAnthropic  claude-3.5-haiku   800K       200K       $1.44    15%\n─────────────────────────────────────────────────────────────\nTotal                        1,340K      410K       $9.09   100%\n\n\nAnalysis: Using Opus for 40% of costs but only ~7% of token volume. Consider using Sonnet more.\n\nExample 3: Month-end comparison (Real Data - Feb 2026)\n$ tokenmeter import --auto\nImported 13,713 records\nTotal cost: $1,246.55\n\n$ tokenmeter costs --period month\n\nModel                    Input   Output    Cost      % of Total\n─────────────────────────────────────────────────────────────────\nanthropic/claude-opus-4  47.3K   1.6M      $743.35   59.6%\nanthropic/claude-sonnet-4 70.8K  2.2M      $501.75   40.3%\n─────────────────────────────────────────────────────────────────\nTotal                    118.8K  3.8M      $1,246.55 100%\n\n$ tokenmeter summary --period month\n\nProvider   Input    Output   Total    Cost        Requests\n─────────────────────────────────────────────────────────\nAnthropic  118.8K   3.8M     3.9M     $1,246.55   12,552\n\n\nAnalysis:\n\nAPI-equivalent cost: $1,246.55\nMax plan cost: $100.00\nSavings: $1,146.55 ✅\n\nOpus usage (59.6% of cost) shows heavy extended-thinking use. Max plan absolutely paid for itself this month!\n\nFAQ\n\nQ: Does tokenmeter send data anywhere? A: No. Everything is stored locally in ~/.tokenmeter/usage.db. Zero telemetry.\n\nQ: What if I delete the database? A: You lose history, but can rebuild by re-importing OpenClaw sessions (idempotent).\n\nQ: Can I use this with non-OpenClaw tools? A: Yes! It supports Claude Code, Cursor, and manual logging for any LLM tool.\n\nQ: Will this slow down OpenClaw? A: No. Import runs separately and reads logs after-the-fact.\n\nQ: What about cache tokens? A: tokenmeter includes cache read/write tokens in its calculations (OpenClaw tracks them).\n\nReferences\nGitHub: https://github.com/jugaad-lab/tokenmeter\nOpenClaw Docs: https://docs.openclaw.ai\nAnthropic Pricing: https://anthropic.com/pricing\nChangelog\n2026-02-06 (v2)\n✅ tokenmeter scan - Auto-discover session sources\n✅ tokenmeter import --auto - Import all discovered sessions\n✅ Real data example showing $1,146 monthly savings on Max plan\n✅ Updated workflows with new commands\n✅ Tested on actual OpenClaw + Claude Code sessions\n2026-02-06 (v1)\nInitial skill creation\nDocumented installation and usage\nAdded workflow examples\n\nBuilt to answer the question: \"How much is my Max plan really saving me?\" 💰"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/cheenu1092-oss/tokenmeter",
    "publisherUrl": "https://clawhub.ai/cheenu1092-oss/tokenmeter",
    "owner": "cheenu1092-oss",
    "version": "0.1.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/tokenmeter",
    "downloadUrl": "https://openagent3.xyz/downloads/tokenmeter",
    "agentUrl": "https://openagent3.xyz/skills/tokenmeter/agent",
    "manifestUrl": "https://openagent3.xyz/skills/tokenmeter/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/tokenmeter/agent.md"
  }
}