Agent skill

Task Token Usage

by platonai in platonai/Browser4

Analyzes Claude Code session traces (JSONL) and draft task files to report token usage per task.

Apache-2.0Auto-check passed

Install Task Token Usage

skills CLI
$ npx skills add platonai/Browser4 --skill task-token-usage -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install platonai/Browser4 task-token-usage --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/platonai/Browser4.git skills-src && mkdir -p .claude/skills && cp -r skills-src/coworker/skills/task-token-usage .claude/skills/task-token-usage && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
task-token-usage
GitHub stars
1.2k
Token cost
~701 tokens
SKILL.md length
257 words
Files
2 (incl. scripts)
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

Analyzes Claude Code session traces (JSONL) and draft task files to report token usage per task.

  • Works in 4 steps: Scans ~/.claude/projects// for JSONL… → Extracts input_tokens, output_tokens,… → Optionally matches sessions to draft… → …
  • Asked about token usage
  • SKILL.md covers When to Use, How It Works, Usage and Output Columns (Summary Mode), plus 2 more sections
  • Runs Python scripts from its folder; calls python3

What it does

Task Token Usage is an agent skill from platonai/Browser4. Analyzes Claude Code session traces (JSONL) and draft task files to report token usage per task. Use when asked about token usage, session costs, or task efficiency metrics.

Its SKILL.md is about 700 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/list-tasks.py`).

The repository describes itself as: Browser4 — an AI-native browser engine for autonomous agents, intelligent extraction, and large-scale web automation. The licence is Apache-2.0.

When your agent uses it

  • Asked about token usage
  • Task efficiency metrics

Example prompts

  • “Use the task-token-usage skill to analyz Claude Code session traces (JSONL) and draft task files to report token usage per task”
  • “/task-token-usage”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Bash(python3:*)

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Scans ~/.claude/projects// for JSONL session traces
  2. Extracts input_tokens, output_tokens, cache_read_input_tokens from each assistant message
  3. Optionally matches sessions to draft task files in coworker/tasks/issues/draft/
  4. Prints a summary table grouped by task

What it can do on your machine

Read from SKILL.md and the folder at commit 0fdba82. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(python3:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Task Token Usage loads about 701 tokens when it runs. Until then it costs about 48 tokens; SKILL.md has 257 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~48
When it runs · the whole SKILL.md, loaded when a task matches
~701

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from platonai/Browser4 at commit 0fdba82, republished under its Apache-2.0 licence (© platonai). 257 words, ~701 tokens.

Download SKILL.mdSave it as .claude/skills/task-token-usage/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
task-token-usage
description
Analyzes Claude Code session traces (JSONL) and draft task files to report token usage per task. Use when asked about token usage, session costs, or task efficiency metrics.
allowed-tools
Bash(python3:*)
title
Task Token Usage — List tasks with their token consumption

Task Token Usage

Analyzes Claude Code conversation traces to report token consumption per task.

When to Use

  • "list tasks with token usage"
  • "show me token usage for each task"
  • "how many tokens did task X use?"
  • "what tasks ran in the last N hours?"
  • "compare token usage across tasks"

How It Works

  1. Scans ~/.claude/projects/<project>/ for JSONL session traces
  2. Extracts input_tokens, output_tokens, cache_read_input_tokens from each assistant message
  3. Optionally matches sessions to draft task files in coworker/tasks/issues/draft/
  4. Prints a summary table grouped by task

Usage

Run the bundled script:

bash
python3 coworker/skills/task-token-usage/scripts/list-tasks.py [OPTIONS]
Options
FlagDescription
--recent NOnly show sessions from last N hours (default: 24)
-d, --detailPer-session breakdown instead of grouped summary
-a, --allShow all sessions (no time filter)
Examples
bash
# Summary of last 12 hours
python3 coworker/skills/task-token-usage/scripts/list-tasks.py --recent 12

# Detailed per-session view for all time
python3 coworker/skills/task-token-usage/scripts/list-tasks.py --all --detail

# Default: last 24 hours, grouped summary
python3 coworker/skills/task-token-usage/scripts/list-tasks.py

Output Columns (Summary Mode)

ColumnDescription
TaskTask name (matched from draft files or first step description)
RunsNumber of evaluation sessions for this task
In TokTotal input tokens across all runs
Out TokTotal output tokens across all runs
CacheTotal cache-read + cache-creation tokens
TOTALSum of all tokens
Avg/runAverage total tokens per run

Output Columns (Detail Mode)

ColumnDescription
TimeWhen the session ended
TaskMatched task name
InInput tokens
OutOutput tokens
CacheRCache-read tokens
TOTALTotal tokens
ModelAI model used

Token Pricing (Approximate)

The script does not compute cost, but you can estimate:

ModelInput (per 1M)Output (per 1M)Cached (per 1M)
claude-sonnet-4.6$3.00$15.00$0.30
claude-opus-4$15.00$75.00$1.50
claude-haiku-4.5$1.00$5.00$0.10

Cache tokens account for ~96% of total usage in typical evaluation sessions.

© platonai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in coworker/skills/task-token-usage of platonai/Browser4.

  • SKILL.md
  • scripts/list-tasks.py

Open the folder on GitHubat commit 0fdba82

Compare with similar skills

Task Token Usage next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Task Token Usage compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Task Token Usage this skillplatonai/Browser41.2k—~701Automated safety check: PassApache-2.0
Analyze Io Tracesmoeru-ai/airi50k—~542Automated safety check: PassMIT
Analyze Performance Tracestutti-os/tutti3.8k—~3.3kAutomated safety check: PassApache-2.0
Cache Trace Analyzerben-manes/caffeine18k—~702Automated safety check: NotesApache-2.0
Analyze Perfetto TraceZacSweers/metro1.4k—~2.7kAutomated safety check: PassApache-2.0
Observe Traceruvnet/ruflo74k—~522Automated safety check: NotesMIT

Similar skills

  • Analyze Io Traces

    moeru-ai/airi

    Read and analyze AIRI IO traces that Tamagotchi saved to local files.

    50k GitHub stars~542 tokensUpdated today
    Auto-check passed
  • Analyze Chrome, Chromium, Electron, React DevTools, or Perfetto-compatible JSON traces and audit user-reported profiling findings without loading large artifacts into context; prove…

    3.8k GitHub stars~3.3k tokensUpdated 1 mo ago
    MobileAuto-check passed
  • Cache Trace Analyzer

    ben-manes/caffeine

    Analyzes a cache trace file for the Caffeine simulator, characterizes its access pattern and recommends which eviction policies to compare.

    18k GitHub stars~702 tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Analyze Perfetto Trace

    ZacSweers/metro

    Query and analyze Metro's perfetto compiler traces to find real hot spots and untraced time.

    1.4k GitHub stars~2.7k tokensUpdated yesterday
    MobileAuto-check passed
  • Observe Trace

    ruvnet/ruflo

    Trace agent execution by collecting spans and building a trace tree for a task

    74k GitHub stars~522 tokensUpdated today
    Auto-check: notes
  • Agent skill for code-analyzer - invoke with $agent-code-analyzer

    74k GitHub starsUsed in 3 repos~1.5k tokens
    DevelopmentAuto-check passed

More from platonai/Browser4

All 17 skills in this repo
  • Data Validation

    platonai/Browser4

    Validates data against common and custom rules (required fields, formats, ranges).

    1.2k GitHub stars~896 tokensUpdated today
    Auto-check passed
  • Form Filling

    platonai/Browser4

    Automatically fills web forms using provided field data and can optionally submit the form.

    1.2k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Web Scraping

    platonai/Browser4

    Extracts data from web pages using browser automation and CSS/JavaScript selectors.

    1.2k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Organize Task Files

    platonai/Browser4

    Lists, pairs, deduplicates, and moves task files across the Coworker task state machine (0draft → 6git-pushed).

    1.2k GitHub stars~801 tokensUpdated today
    Auto-check passed
  • Weather

    platonai/Browser4

    Fetches current weather conditions and a 7-day forecast for a requested location using Open-Meteo geocoding and forecast APIs.

    1.2k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Browser4 Plugin

    platonai/Browser4

    Guides the creation of Browser4 plugins from requirements gathering through deployment.

    1.2k GitHub stars~3.6k tokensUpdated today
    Auto-check passed

Questions about Task Token Usage

What does Task Token Usage do?

Analyzes Claude Code session traces (JSONL) and draft task files to report token usage per task. Task Token Usage is an agent skill from platonai/Browser4. Analyzes Claude Code session traces (JSONL) and draft task files to report token usage per task.

When should I use Task Token Usage?

Task Token Usage fits situations like: asked about token usage; task efficiency metrics.

How do I install Task Token Usage in Claude Code?

Run `npx skills add platonai/Browser4 --skill task-token-usage -a claude-code`. Or copy the skill folder (coworker/skills/task-token-usage in platonai/Browser4) into .claude/skills/task-token-usage in your project. Claude Code loads it when a task matches its description.

How do I install Task Token Usage in Codex?

Run `npx skills add platonai/Browser4 --skill task-token-usage -a codex`. Or copy the skill folder (coworker/skills/task-token-usage in platonai/Browser4) into .agents/skills/task-token-usage in your project. Codex loads it when a task matches its description.

Can I use Task Token Usage in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add platonai/Browser4 --skill task-token-usage -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/task-token-usage, .gemini/skills/task-token-usage, .github/skills/task-token-usage and .opencode/skills/task-token-usage in your project.

What does Task Token Usage need to run?

Going by SKILL.md and its folder, Task Token Usage needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Bash(python3:*).

Does Task Token Usage access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Task Token Usage safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Task Token Usage use?

Task Token Usage is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Task Token Usage use?

About 701 tokens (SKILL.md is roughly 2.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Task Token Usage?

Skills that share tags, products or a category with Task Token Usage: Analyze Io Traces (moeru-ai/airi, 50k stars), Analyze Performance Traces (tutti-os/tutti, 3.8k stars), Cache Trace Analyzer (ben-manes/caffeine, 18k stars) and Analyze Perfetto Trace (ZacSweers/metro, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Task Token Usage?

platonai (a GitHub user) maintains it in platonai/Browser4, which has 1,152 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

Source: platonai/Browser4 on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.