Skip to content

thanhquangqb95/cclog-cli

Repository files navigation

cclog-cli

Understand what Claude Code is really costing you.

A local-first dashboard and CLI that turns your Claude Code session logs into actionable insights — token usage by project, daily trends, session history, and cost estimates. No cloud. No account. Your data stays on your machine.

npm version License: MIT Node.js ESM

Install

npm i -g cclog-cli

Requires Node.js 18+.

Quick start

# Launch the local dashboard
cclog-cli run

# Use a different port
cclog-cli run --port 8080

# Skip browser auto-open
cclog-cli run --no-open

The dashboard reads your local Claude Code logs and displays project summaries, daily token trends, session lists, subagent details, and estimated costs.

CLI commands

# Help
cclog-cli --help

# Overview in terminal
cclog-cli summary

# Ranked session list
cclog-cli sessions

# Per-project breakdown
cclog-cli projects

# Export JSON or CSV
cclog-cli export --format csv --out usage.csv

# Check for updates
cclog-cli update

Screenshots

Overview

Overview dashboard

Projects

Projects page

Session detail

Session detail

Version & update

# Show installed version
cclog-cli --version
cclog-cli version

# Check for updates
cclog-cli update

When you run cclog-cli run, the CLI can show a short notice if a newer npm version is available. Use cclog-cli update to upgrade.

Maintainer release

Release versioning is tracked in CHANGELOG.md and the detailed rules live in docs/versioning-release-policy.md.

  1. Update package.json version.
  2. Update web/package.json to match the root version.
  3. Add the matching CHANGELOG.md entry with ## vX.Y.Z - YYYY-MM-DD.
  4. Run npm run release:check.
  5. Build and test.
  6. Run the git skill release flow to validate metadata, create the tag, and push branch + tag.
  7. Publish with npm publish.

Network notes

  • Session analysis and dashboard data come from your local ~/.claude/projects/ logs.
  • cclog-cli run may perform a lightweight npm registry check for newer releases.
  • --refresh-prices fetches the latest pricing snapshot from pricepertoken.com.
  • Set CCLOG_CLI_NO_UPDATE_CHECK=1 if you want to skip the version check on run.

Features

  • Session analysis by input, output, total, and cache tokens
  • Project summaries from local Claude Code logs
  • Cost estimation from bundled pricing snapshots
  • Browser dashboard for exploration and filtering
  • JSON and CSV export
  • Read-only log analysis

Data source

cclog-cli reads ~/.claude/projects/ in read-only mode. It does not modify your source files or session logs.

Cost estimation

Pricing data comes from pricepertoken.com with a bundled local snapshot for offline use. Estimates are approximate.

Develop

npm install
npm run build
npm run dev -- summary
npm test

Tech stack

TypeScript 5.4 · Node.js ESM · Commander.js · Express · Vite + React

License

MIT

About

cclog-cli tracks Claude Code usage, including tokens, requests, and responses. It provides history and analytics to help debug workflows, monitor costs, and optimize performance by making AI interactions transparent.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors