This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
nix develop- Enter development shell with all dependenciesnix develop -c cargo run- Run the main application directlycargo run- Run the main CLI application (requires dev shell)cargo run -- --help- Show CLI help and options
nix build- Build the project using Nixcargo build- Build using Cargo (requires dev shell)cargo test- Run testscargo run --example basic_usage- Run the basic usage example
just- Show available just commandsjust run [ARGS]- Run cargo with optional argumentsjust watch [ARGS]- Auto-recompile and run using baconjust pre-commit-all- Run pre-commit hooks on all files (formatting, linting)pre-commit run -a- Alternative way to run pre-commit hooks
nix flake update- Update all flake inputsnix --accept-flake-config run github:juspay/omnix ci- Build all outputs
This is a Rust workspace with two main crates:
Located in crates/claude-usage-lib/, this is the main functionality library for Claude API usage monitoring and analysis. Key modules:
calculator.rs- Usage calculations and projectionsdata_structures.rs- Core data types (UsageEntry, TokenCounts, BurnRate, etc.)identifier.rs- Session identificationloader.rs- Data loading functionalitymonitor.rs- Usage monitoringpricing.rs- Pricing calculations
The library exports a convenient prelude module with commonly used types.
Located in crates/claude-usage/, this is a simple CLI app that uses clap for argument parsing. Currently serves as a basic "hello world" style application but can be extended to use the core library.
- Uses Nix flakes for reproducible development environment
- Includes pre-commit hooks for automatic formatting and linting
- VSCode configuration included for immediate IDE experience
- Uses rust-flake and crane for Rust/Nix integration
- Supports both Nix-based and rustup-based CI workflows
- serde/serde_json - JSON serialization
- chrono - Date/time handling with serde support
- anyhow - Error handling
- clap - CLI argument parsing (main app)
- tokio - Async runtime (dev dependencies)