Skip to main content

Cross-tool usage analytics for Claude Code and Codex CLI

Project description

ai-cli-insights

Cross-tool usage analytics for Claude Code and Codex CLI. Collects session data from both tools and generates rich HTML insight reports with narratives, trend charts, friction analysis, and actionable recommendations.

Features

  • Unified data collection from Claude Code (~/.claude/) and Codex CLI (~/.codex/)
  • Three report modes: cross-tool comparison, Claude-only, Codex-only
  • Optional deep analysis via external LLM CLI (Codex / Claude / Gemini)
  • Period-over-period comparison, trend sparklines, quality scoring
  • Friction pattern analysis with evidence-based recommendations
  • Prompt library with copy-to-clipboard templates
  • Zero third-party dependencies — pure Python standard library

Installation

pip install ai-cli-insights

Quick Start

# Generate a cross-tool report for the last 30 days
ai-cli-insights generate --days 30 --tool all

# Force a specific LLM analyzer
ai-cli-insights generate --days 30 --tool all --llm-analyzer claude

# Claude-only report
ai-cli-insights generate --tool claude

# Codex-only report
ai-cli-insights generate --tool codex

# Short form (generate is the default command)
ai-cli-insights --days 7 --tool claude

The HTML report is saved to the output directory and can be opened in any browser.

By default, generate will try deep LLM analysis in this order: codex -> claude -> gemini.

Configuration

# Create a config template
ai-cli-insights init

This writes a config.json to your config directory:

  • macOS: ~/Library/Application Support/ai-cli-insights/config.json
  • Linux: ~/.config/ai-cli-insights/config.json

Edit it to customize:

  • domain_patterns — keyword patterns to classify sessions into work domains
  • project_patterns — patterns to identify which project a session belongs to
  • template_modes — report titles and slugs

Without a config file, reports still work — domains and projects will just show raw paths.

Claude Code Skill

# Install a Claude Code skill for easy /multi-insights access
ai-cli-insights install-skill

# Install a Codex CLI skill
ai-cli-insights install-codex-skill

This writes:

  • Claude Code skill: ~/.claude/skills/multi-insights/SKILL.md
  • Codex CLI skill: ~/.codex/skills/multi-insights/SKILL.md

CLI Reference

ai-cli-insights [command] [options]

Commands:
  generate        Generate an HTML insights report (default)
  init            Write a config template to the config directory
  install-skill   Install Claude Code skill file
  install-codex-skill  Install Codex CLI skill file

Generate options:
  --days N        Analyze the last N days (default: 30)
  --tool MODE     all | claude | codex (default: all)
  --analyst WHO   codex | claude — label the analyzing model (default: codex)
  --output-dir    Override the output directory
  --llm-analyzer  auto | codex | claude | gemini | none (default: auto)
  --llm-model     Optional model name passed to selected LLM CLI
  --llm-timeout-sec  Timeout per provider call (default: 120)

python -m ai_cli_insights also works.

Data Sources

Tool Source What it provides
Claude Code ~/.claude/usage-data/session-meta/*.json Session metadata, tool counts, tokens
Claude Code ~/.claude/usage-data/facets/*.json Outcomes, friction, goals
Codex CLI ~/.codex/state_5.sqlite Thread metadata, tokens
Codex CLI ~/.codex/sessions/*.jsonl Event details, timestamps, tools
Codex CLI ~/.codex/history.jsonl User message counts

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_cli_insights-0.1.2.tar.gz (56.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_cli_insights-0.1.2-py3-none-any.whl (69.2 kB view details)

Uploaded Python 3

File details

Details for the file ai_cli_insights-0.1.2.tar.gz.

File metadata

  • Download URL: ai_cli_insights-0.1.2.tar.gz
  • Upload date:
  • Size: 56.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ai_cli_insights-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5133c1cbece0b5ce8778c343f888e731fd9a23f613e049a542689a02b7b82d6f
MD5 2f49e3193ba6d216ec7185eaabb721fe
BLAKE2b-256 3b4c6a36f4b6cab02b24705463162301b81997bdbc28001db9fc4ab894cd0d38

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_cli_insights-0.1.2.tar.gz:

Publisher: publish-pypi.yml on baoluchuling/ai-cli-insights

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_cli_insights-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_cli_insights-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e50c2edb94f30c30dd2b8ecb5cde728ce58e9e109b1c630369559cd5c1f3c04c
MD5 4b8a38fc9a823139f955c80f921b532e
BLAKE2b-256 41ce82b8711a5ae6c472b40c4759bc8179418104efa1519239af9e80004d877f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_cli_insights-0.1.2-py3-none-any.whl:

Publisher: publish-pypi.yml on baoluchuling/ai-cli-insights

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page