# Send Token Counter to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- 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.
## Suggested prompts
### New install

```text
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.
```
### Upgrade existing

```text
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.
```
## Machine-readable fields
```json
{
  "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": {
    "downloadUrl": "/downloads/token-counter",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=token-counter",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "agents/openai.yaml",
      "references/classification-rules.md",
      "scripts/token_counter.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "token-counter",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-10T01:31:54.218Z",
      "expiresAt": "2026-05-17T01:31:54.218Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=token-counter",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=token-counter",
        "contentDisposition": "attachment; filename=\"token-counter-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "token-counter"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "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."
      ]
    }
  },
  "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"
  }
}
```
## Documentation

### Overview

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.

### Quick Start

Run:

$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter --period 7d

### Common Commands

Basic report:

$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter --period 7d

Focus on selected breakdowns:

$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter \\
  --period 1d \\
  --breakdown tools,category,client

Analyze one session:

$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter \\
  --session agent:main:cron:d3d76f7a-7090-41c3-bb19-e2324093f9b1

Export JSON:

$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter \\
  --period 30d \\
  --format json \\
  --output $OPENCLAW_WORKSPACE/token-usage/token-usage-30d.json

Persist daily snapshot:

$OPENCLAW_SKILLS_DIR/token-counter/scripts/token-counter \\
  --period 1d \\
  --save

This writes JSON to:
$OPENCLAW_WORKSPACE/token-usage/daily/YYYY-MM-DD.json

### Defaults and Data Sources

Sessions index: $OPENCLAW_DATA_DIR/agents/main/sessions/sessions.json
Session transcripts: $OPENCLAW_DATA_DIR/agents/main/sessions/*.jsonl
Cron definitions: $OPENCLAW_DATA_DIR/cron/jobs.json

The parser reads assistant usage fields for token counts and uses tool-call records for attribution.

### Notes on Attribution

Tool token attribution is heuristic: assistant-message tokens are split across tool calls in that message.
Session totalTokens may come from either session index metadata or transcript usage sums (max is used).
Client detection is rules-based (personal, bonsai, mixed, unknown) using path/domain/email markers.

### Validation

Run:

python3 $OPENCLAW_SKILLS_DIR/skill-creator/scripts/quick_validate.py \\
  $OPENCLAW_SKILLS_DIR/token-counter

### References

See:

references/classification-rules.md for category/client detection logic and keyword mapping.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: mkhaytman87
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-10T01:31:54.218Z
- Expires at: 2026-05-17T01:31:54.218Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/token-counter)
- [Send to Agent page](https://openagent3.xyz/skills/token-counter/agent)
- [JSON manifest](https://openagent3.xyz/skills/token-counter/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/token-counter/agent.md)
- [Download page](https://openagent3.xyz/downloads/token-counter)