Engineering
new-analyzer avatar

new-analyzer

Guide for implementing a new AI coding agent analyzer in Splitrail to track token usage, costs, and performance metrics.

Introduction

The new-analyzer skill provides a comprehensive technical roadmap for software engineers and contributors aiming to extend Splitrail by integrating support for additional AI coding agents. As the landscape of agentic AI evolves, this skill enables users to add custom parsers for tools like Copilot, Cline, and various CLI-based or VS Code-integrated agents. It serves as a systematic checklist for standardizing how Splitrail discovers, parses, and aggregates token usage data and cost statistics across different development environments.

  • Streamlines the integration of proprietary or open-source coding agents by defining a consistent implementation process.

  • Provides guidance on registering new variants within the Application enum to ensure seamless integration with existing stats and message types.

  • Details the implementation of the Analyzer trait to handle file discovery, JSONL parsing, and session data extraction.

  • Explains how to leverage built-in helpers for discovering VS Code extension data, supporting complex cross-platform paths like Linux, macOS, and Windows.

  • Includes best practices for unit testing analyzers using mock source data fixtures to ensure reliability before production deployment.

  • Users must create a new Rust module in the src/analyzers/ directory and export it through the central mod.rs file.

  • Developers should register the analyzer in src/main.rs to make it accessible to the CLI and MCP server components.

  • For agents lacking native cost reporting, developers should update src/models.rs to include relevant model pricing data.

  • Implementation requires familiarity with Rust, serde for data deserialization, and the project's internal contribution cache strategy.

  • Ensure that all analyzer logic accounts for potential duplicates or multi-session data, utilizing the existing deduplication patterns seen in models like Claude Code.

Repository Stats

Stars
175
Forks
16
Open Issues
6
Language
Rust
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 05:01 AM
View on GitHub