About this project

TraceFrugal is a local, single-binary Go application designed to help developers understand and optimize token usage in AI coding workflows, specifically targeting Claude Code and Codex. It provides a unified dashboard that visualizes why workflows consume large amounts of input, highlighting issues like large tool results, repeated calls, and context reuse. The tool allows users to experiment with smaller context rules, track hourly visibility, and measure answer satisfaction, with the ability to undo changes if they do not yield desired results. Key features include an opt-in MCP proxy that archives large read-only results and provides exact recall, stopping data packing after 24 hours to maintain efficiency. TraceFrugal deduplicates copied responses and displays usage data for the last seven days, refreshing every 30 seconds. It offers a clear distinction between native local log imports for Claude Code and Codex and a separate workflow for API application developers using JSONL traces. The tool includes a cost-per-success regression gate and automatic evaluator-driven experiments to ensure that optimizations do not compromise task quality. The application is privacy-focused, requiring no API keys, telemetry, or runtime dependencies. It emphasizes honest boundaries, noting that dollar amounts are estimates based on list prices and that lower token counts do not automatically equate to savings if cache reuse is lost or task quality degrades. TraceFrugal supports various providers through adapters and allows users to bring their own usage data in JSONL format, ensuring that prompts and credentials remain local. It is suitable for CI pipelines, where it can compare baseline and candidate runs to detect cost or outcome regressions.