Skip to content

Track and report malformed line count in Claude Code JSONL parser #190

Description

@kannupriyakalra

Problem

parseClaudeCodeJsonl() in src/token-usage.ts silently skips malformed JSON lines. If a JSONL file is corrupt or partially written, the parser drops data without informing the user.

Solution

Return a { calls, skippedLines } object from parseClaudeCodeJsonl (or add a second return value). When skippedLines > 0, log a warning with the filename and count so users know data may be incomplete.

Acceptance criteria

  • Malformed lines increment a counter rather than being silently dropped
  • A warning is logged when skipped lines exceed 0
  • A unit test verifies the counter increments on bad input

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions