Developer Script Parses Claude Code Transcripts to Break Down AI Tool Usage
A developer has shared a Bash-Python script that reads Claude Code's locally stored transcript.jsonl files to tally how often individual tools, agents, skills, and MCP servers are called. Claude Code's built-in /usage command only reports token consumption and cost at a session level, without showing which specific tools or agents are driving that usage. The script scans JSONL transcript files stored under ~/.claude/projects/ and counts every tool_use block, extracting tool names and input arguments to build a ranked breakdown. In a sample seven-day run across 51 sessions and 4,230 tool calls, Bash accounted for 61% of all calls, while the claude-in-chrome MCP server led MCP usage with 261 invocations. The author positions the script as a practical aid for cost optimization and environment health checks where the native usage dashboard falls short.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in