Log Every Agent Invocation: Building Usage Analytics with Claude Code's Stop Hook and transcript_path
A developer built a usage analytics system for Claude Code agents by reading the transcript_path from the Stop hook payload and accumulating agent invocations into a JSONL log. The system has recorded…