How to Audit Token Usage and Hidden Reminders in Claude Code Session Logs
Claude Code session logs stored as JSON Lines files may contain service messages, internal reminder markers, and token usage metadata that do not appear in the visible chat interface. Developers can audit these records to track occurrences of markers like ip_reminder and analyze how input, output, and cache tokens are distributed across a session. The audit workflow involves locating the session file, preserving an auditable copy with a SHA-256 digest, and parsing records to extract structured data. Token counters logged in these files can help characterize request activity, though they do not perfectly reconstruct the exact context the model received at every moment. Cache reads, retries, and duplicated usage objects mean that simple text-match counts or naive token sums can produce misleading totals without record-level inspection.
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