{
  "schemaVersion": "1.0",
  "item": {
    "slug": "token-counter",
    "name": "Token Counter",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/mkhaytman87/token-counter",
    "canonicalUrl": "https://clawhub.ai/mkhaytman87/token-counter",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/token-counter",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=token-counter",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "agents/openai.yaml",
      "references/classification-rules.md",
      "scripts/token_counter.py"
    ],
    "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. 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. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-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/token-counter"
    },
    "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/token-counter",
    "agentPageUrl": "https://openagent3.xyz/skills/token-counter/agent",
    "manifestUrl": "https://openagent3.xyz/skills/token-counter/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/token-counter/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. 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. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Overview",
        "body": "Use this skill to produce token usage reports from local OpenClaw data. It parses session transcripts (.jsonl), session metadata, and cron definitions, then reports usage by category, client, tool, model, and top token consumers."
      },
      {
        "title": "Quick Start",
        "body": "Run:\n\n$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter --period 7d"
      },
      {
        "title": "Common Commands",
        "body": "Basic report:\n\n$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter --period 7d\n\nFocus on selected breakdowns:\n\n$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter \\\n  --period 1d \\\n  --breakdown tools,category,client\n\nAnalyze one session:\n\n$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter \\\n  --session agent:main:cron:d3d76f7a-7090-41c3-bb19-e2324093f9b1\n\nExport JSON:\n\n$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter \\\n  --period 30d \\\n  --format json \\\n  --output $OPENCLAW_WORKSPACE/token-usage/token-usage-30d.json\n\nPersist daily snapshot:\n\n$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter \\\n  --period 1d \\\n  --save\n\nThis writes JSON to:\n$OPENCLAW_WORKSPACE/token-usage/daily/YYYY-MM-DD.json"
      },
      {
        "title": "Defaults and Data Sources",
        "body": "Sessions index: $OPENCLAW_DATA_DIR/agents/main/sessions/sessions.json\nSession transcripts: $OPENCLAW_DATA_DIR/agents/main/sessions/*.jsonl\nCron definitions: $OPENCLAW_DATA_DIR/cron/jobs.json\n\nThe parser reads assistant usage fields for token counts and uses tool-call records for attribution."
      },
      {
        "title": "Notes on Attribution",
        "body": "Tool token attribution is heuristic: assistant-message tokens are split across tool calls in that message.\nSession totalTokens may come from either session index metadata or transcript usage sums (max is used).\nClient detection is rules-based (personal, bonsai, mixed, unknown) using path/domain/email markers."
      },
      {
        "title": "Validation",
        "body": "Run:\n\npython3 $OPENCLAW_SKILLS_DIR/skill-creator/scripts/quick_validate.py \\\n  $OPENCLAW_SKILLS_DIR/token-counter"
      },
      {
        "title": "References",
        "body": "See:\n\nreferences/classification-rules.md for category/client detection logic and keyword mapping."
      }
    ],
    "body": "Token Counter\nOverview\n\nUse this skill to produce token usage reports from local OpenClaw data. It parses session transcripts (.jsonl), session metadata, and cron definitions, then reports usage by category, client, tool, model, and top token consumers.\n\nQuick Start\n\nRun:\n\n$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter --period 7d\n\nCommon Commands\nBasic report:\n$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter --period 7d\n\nFocus on selected breakdowns:\n$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter \\\n  --period 1d \\\n  --breakdown tools,category,client\n\nAnalyze one session:\n$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter \\\n  --session agent:main:cron:d3d76f7a-7090-41c3-bb19-e2324093f9b1\n\nExport JSON:\n$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter \\\n  --period 30d \\\n  --format json \\\n  --output $OPENCLAW_WORKSPACE/token-usage/token-usage-30d.json\n\nPersist daily snapshot:\n$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter \\\n  --period 1d \\\n  --save\n\n\nThis writes JSON to: $OPENCLAW_WORKSPACE/token-usage/daily/YYYY-MM-DD.json\n\nDefaults and Data Sources\nSessions index: $OPENCLAW_DATA_DIR/agents/main/sessions/sessions.json\nSession transcripts: $OPENCLAW_DATA_DIR/agents/main/sessions/*.jsonl\nCron definitions: $OPENCLAW_DATA_DIR/cron/jobs.json\n\nThe parser reads assistant usage fields for token counts and uses tool-call records for attribution.\n\nNotes on Attribution\nTool token attribution is heuristic: assistant-message tokens are split across tool calls in that message.\nSession totalTokens may come from either session index metadata or transcript usage sums (max is used).\nClient detection is rules-based (personal, bonsai, mixed, unknown) using path/domain/email markers.\nValidation\n\nRun:\n\npython3 $OPENCLAW_SKILLS_DIR/skill-creator/scripts/quick_validate.py \\\n  $OPENCLAW_SKILLS_DIR/token-counter\n\nReferences\n\nSee:\n\nreferences/classification-rules.md for category/client detection logic and keyword mapping."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/mkhaytman87/token-counter",
    "publisherUrl": "https://clawhub.ai/mkhaytman87/token-counter",
    "owner": "mkhaytman87",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/token-counter",
    "downloadUrl": "https://openagent3.xyz/downloads/token-counter",
    "agentUrl": "https://openagent3.xyz/skills/token-counter/agent",
    "manifestUrl": "https://openagent3.xyz/skills/token-counter/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/token-counter/agent.md"
  }
}