Skip to content

v0.4.1: Better Discoverability & Critical README Fixes

Choose a tag to compare

@Mullassery Mullassery released this 05 Jul 19:31

🎯 What's New in v0.4.1

πŸ“ˆ GitHub Discoverability (New!)

  • βœ… Added 5 repository topics for better search visibility: claude-code, claude-skills, cost-tracking, llm-optimization, token-optimization
  • βœ… Optimized README hook for 30-second understanding (was 5-min read)
  • βœ… Added "Why PyCostAudit Different" comparison table (vs alternatives)

πŸ“Š Real-World Example Added

  • Before: "Spent $47 today"
  • After: "$32 on PDFs (save $23) + $12 GitHub ops (save $280/mo) + $3 hours"
  • Includes $420/month hidden cost discovery example

πŸ”§ Critical README Fixes (10 errors corrected)

  • Fixed variable naming in code examples (use auditor consistently)
  • Fixed class names (PyCostReporter β†’ PyCostAudit everywhere)
  • Fixed package/import names (pycostreporter β†’ pycostaudit)
  • Fixed database paths (~/.pycostreporter/ β†’ ~/.pycostaudit/)
  • Fixed environment variable names (PYCOSTREPORTER_DB β†’ PYCOSTAUDIT_DB)
  • Fixed multiplier descriptions and baseline clarifications
  • Fixed terminology ("busy hour" β†’ "peak hour")
  • All code examples now executable and testable

🏷️ Enhanced Documentation

  • Clear scope statement: "Tracks Claude Code only (not Desktop, Web, or API direct calls)"
  • Added cost estimate disclaimers including local taxes and currency considerations
  • Added UV installation instructions alongside pip
  • Added clear agent integration examples for autonomous workflows
  • Reorganized Claude Code integration guidance for users and agents

🐍 Python & Runtime Improvements

  • Fixed Tokio runtime initialization for Python tests (using once_cell::Lazy for global runtime)
  • Updated Python wrapper to use PyCostAudit class consistently
  • Fixed test imports to use Python wrapper instead of Rust core directly
  • Improved error handling and JSON parsing

πŸ§ͺ Tests

  • βœ… 15 Rust unit tests passing
  • βœ… 2 core integration tests passing (basic_cost_tracking, file_format_multipliers)
  • Fixed test assertions to match actual JSON field names

πŸ“¦ Release Highlights

  • PyPI: https://pypi.org/project/pycostaudit/0.4.1/
  • Installation: pip install pycostaudit or uv pip install pycostaudit
  • Quick Start: Track Claude Code costs in 3 lines of code
  • Platform Support: Python 3.9-3.13, macOS/Linux/Windows

πŸ“‹ Installation

# With pip
pip install pycostaudit==0.4.1

# With uv (faster)
uv pip install pycostaudit==0.4.1

# From source
git clone https://github.com/Mullassery/PyCostAudit.git
cd PyCostAudit
make install

πŸš€ Quick Start

from pycost_audit import PyCostAudit

auditor = PyCostAudit()

# Track an operation
cost = auditor.track_operation(
    operation_type="file_read",
    tokens_input=450,
    tokens_output=120,
    model="claude-3-5-haiku",
    file_source="pdf_url"  # 3.6x multiplier!
)

# Get today's breakdown
breakdown = auditor.analyze_daily()
print(f"Today: ${breakdown['total_cost_usd']:.2f}")

# Get recommendations
recommendations = auditor.get_recommendations()

πŸŽ“ Learn More

πŸ™ Thanks

  • Thanks to everyone using PyCostAudit to optimize their Claude Code costs
  • Special thanks to Caveman Claude for inspiring better discoverability practices

πŸ“ Breaking Changes

None. This is a backward-compatible release.

πŸ› Known Issues

  • Some integration tests for analyze_daily() show zero costs (database state timing issue being investigated)
  • Recommend using track_operation() for immediate cost tracking; analysis queries may require additional debugging

πŸ™‹ Support