PitchHut logo
Efficiently browse and analyze AI code session logs.
Pitch

ccost provides a powerful Rust TUI for easily navigating local Codex and Claude session logs. Search through past chats, estimate API costs, and utilize advanced features like full-text search and custom sorting options. Designed to enhance productivity, it streamlines access to vital information from AI interactions.

Description

ccost is a Rust-based terminal user interface (TUI) designed to facilitate the browsing of local Codex and Claude Code session logs. This tool allows users to efficiently search through past chats and estimate the cost associated with API usage.

Key Features

  • Fast Search Capabilities: Utilize a persistent full-text search with an FST term index that supports prefix matching, highlighting of matches, and a visible search cursor for enhanced user experience.
  • Efficient Session Management: The tool maintains a persisted Merkle tree and file watcher, allowing for quick startup by reusing cached sessions and only re-indexing changed session files.
  • Explicit Search Mode: Users can easily switch to search mode by pressing /, and return to browsing by hitting Enter, allowing for the integration of query text with browsing shortcut keys.
  • Customizable Sorting Options: Sort session data by total cost, time taken, number of tokens used, web searches, model type, session ID, or the first prompt. The default sort order is by total cost in descending order.
  • Safe Cache Management: Incorporates a locking mechanism (index.lock) that allows for controlled writing to the cache. If a second TUI instance is detected, users are given options to access in read-only mode or force a rewrite with a corruption warning.
  • User-Friendly Controls: Navigate easily through sessions with intuitive keyboard shortcuts, enhancing the overall usability of the interface.

Usage Sample

To run ccost, the following command can be used:

ccost --sessions ~/.codex/sessions

For accessing Claude Code transcripts, the command would be:

ccost --sessions ~/.claude/projects

Pricing Information

ccost includes built-in pricing models covering GPT-5.5, GPT-5.4, and Claude Opus/Sonnet/Haiku families, with options for users to override default pricing settings via a --pricing flag. Here is an example of a JSON setup for pricing:

{
  "web_search_per_1k": 10.0,
  "models": {
    "gpt-5.5": {
      "input_per_m": 5.0,
      "output_per_m": 30.0
    }
  }
}

With ccost, users gain an organized, powerful tool to manage code session logs, effectively search through extensive data, and keep track of API-related costs, thereby optimizing their use of Codex and Claude tools.

0 comments

No comments yet.

Sign in to be the first to comment.