sessionlog:tokenusage

Installation
SKILL.md

Session Token Usage

Extract and report input/output token counts from Claude Code session logs.

Steps

1. Identify session

project_dir="$HOME/.claude/projects/$(pwd | sed 's|/|-|g')"
current_session=$(ls -t "$project_dir"/*.jsonl 2>/dev/null | head -1)
session_id=$(basename "$current_session" .jsonl)
echo "Session: $session_id"
echo "Source: $current_session"

If the user specifies a session ID, use that instead of the most recent one.

2. Extract token usage

Related skills
Installs
2
GitHub Stars
9
First Seen
Apr 15, 2026