If --out <path> was provided, write the markdown version of the report to that path. Use a proper markdown table for the trend section.
If --json, dump the aggregated data structure as pretty-printed JSON.
Notes on small log files
If <2 sessions in the window: print the report but add Note: too few sessions for meaningful trend data.
If log file is empty/missing: print the same "No TokenWise log found" message that /tokenwise:report uses.
Tools
Read, Bash (for jq aggregation if helpful), Write (for --out).
1---2name: codeshux-tokenwise-23description: Codeshux Tokenwise4---56# /tokenwise:summary — Multi-session trend report78Aggregate `.tokenwise/log.ndjson` over a time window.910## Parse $ARGUMENTS1112- `--week` (default) — last 7 days13- `--month` — last 30 days14- `--all` — entire log15- `--days <N>` — last N days16- `--out <path>` — write the report to a markdown file instead of stdout17- `--json` — output JSON instead of text1819## Steps20211. **Read** `./.tokenwise/log.ndjson` (or the path the user provides)22232. **Filter** entries to the time window:24 - Compute cutoff: `now - <days>*86400`25 - Keep entries where `ts > cutoff`26273. **Aggregate:**28 - **Total:** sessions (unique session_id), tasks, total cost, baseline cost, savings29 - **Per model:** task count, cost, % of total30 - **Per task_class:** task count, avg cost, dominant model31 - **Trend** (only for `--week` or `--days <≤14>`): per-day cost + savings bar chart in plain text32334. **Print:**3435```36TokenWise Summary — last <N> days37==================================3839Sessions: <count>40Tasks routed: <count>41Total spent: $<total>42Baseline: $<baseline>43Savings: $<savings> (<pct>%)4445Per model:46 Haiku <count> tasks $<cost> (<pct>%)47 Sonnet <count> tasks $<cost> (<pct>%)48 Opus <count> tasks $<cost> (<pct>%)4950Top task classes:51 <class> <count> tasks avg cost $<avg> model: <dominant>52 ...5354Daily trend (cost):55 Mon ███████░░░ $4.2156 Tue ███░░░░░░░ $1.8257 Wed ████████░░ $5.0458 ...59```60615. **If `--out <path>`** was provided, write the markdown version of the report to that path. Use a proper markdown table for the trend section.62636. **If `--json`**, dump the aggregated data structure as pretty-printed JSON.6465## Notes on small log files6667- If <2 sessions in the window: print the report but add `Note: too few sessions for meaningful trend data.`68- If log file is empty/missing: print the same "No TokenWise log found" message that `/tokenwise:report` uses.6970## Tools7172Read, Bash (for jq aggregation if helpful), Write (for `--out`).
Run npx skillmds@latest add bilal140202/codeshux-tokenwise-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Codeshux Tokenwise It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Bilal140202 (@bilal140202) published this skill. Their other Agent Skills are listed on their SkillMD profile.