trajectory-audit

Analyze Claude Code session transcripts to identify token-weighted cost inefficiencies and behavioral patterns.

30|12|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/anthony-chaudhary/fak --skill trajectory-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trajectory-audit
Source: https://github.com/anthony-chaudhary/fak/tree/main/.claude/skills/trajectory-audit
Command: npx skills add https://github.com/anthony-chaudhary/fak --skill trajectory-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill addresses the lack of visibility into cross-session token usage, cost distribution, and behavioral inefficiencies like tool-use loops or churn that occur across multiple Claude Code sessions.

Core Features & Use Cases

  • Token & Cost Analysis: Provides exact token accounting and cost breakdowns by billing bucket and model provider.
  • Behavioral Auditing: Detects stuck loops, file mutation churn, shell timeout kills, and inefficient cache-CREATE bursts.
  • Use Case: Use this when you need to identify which projects are consuming the most tokens, why a specific session is looping, or to verify if your prompt-caching strategy is actually saving costs.

Quick Start

Run the trajectory-audit skill to generate a markdown report of all sessions from the last seven days.

Frequently Asked Questions about trajectory-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Claude Code session transcripts for token cost and efficiency?

You can audit token usage and cost distribution across multiple Claude Code sessions by parsing JSONL transcript logs. This process identifies token-weighted cost inefficiencies, tool-use error rates, and file mutation churn to optimize agent performance and billing.

Why does my Claude Code session loop and consume excessive tokens?

Your session may be experiencing stuck loops, file mutation churn, or shell timeout kills. Behavioral auditing detects these patterns in JSONL logs to pinpoint exactly why a specific Claude Code session is looping and burning through tokens.

How do I check if my prompt-caching strategy is actually saving costs?

Verify your prompt-caching strategy by evaluating cache-read shares and cache-CREATE bursts within your session transcripts. The audit calculates whether your caching implementation is genuinely reducing token billing or causing inefficiencies.

Do I need Python to run a token usage and cost analysis on Claude Code logs?

Yes, Python is required to execute the session_audit.py script. This script parses the JSONL transcript logs and generates the markdown summary reports needed for token accounting and behavioral pattern analysis.

What is the best way to identify which projects are consuming the most tokens?

The best way is to audit cross-session token usage by running the session parser. It provides exact token accounting and cost breakdowns by billing bucket and model provider across multiple Claude Code runs to identify your most expensive projects.

What file format is required for analyzing Claude Code behavioral patterns and tool-use errors?

The required file format is JSONL. The skill parses JSONL transcript logs to extract behavioral patterns, enabling the evaluation of tool-use error rates, file mutation churn, and shell timeout kills across your Claude Code sessions.