Skip to main content

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 runs with --days 30 --tool all --llm-analyzer auto. Deep LLM analysis order is codex -> claude -> gemini. When LLM analysis succeeds, core narrative/recommendation sections are replaced by live model output.

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

Metadata

Release files for ai-cli-insights 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-cli-insights 0.1.9
File Size Uploaded Provenance
ai_cli_insights-0.1.9.tar.gz 54.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-cli-insights 0.1.9
File Interpreter ABI Platform
ai_cli_insights-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 121.1 kB

Release files / ai_cli_insights-0.1.9.tar.gz

Download URL ai_cli_insights-0.1.9.tar.gz
Size 54.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ac96bf6b2a333cf11a4849001eb5abba3207a285d247b24fa76567c7d51b3d38
BLAKE2b-256 checksum
How to use checksums
bbcfe21938cd839960d21d6ff6930f9810591ba04c804306f43e098704ae3f05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 5, 2026.

Transparency log

Release files / ai_cli_insights-0.1.9-py3-none-any.whl

Download URL ai_cli_insights-0.1.9-py3-none-any.whl
Size 66.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4888ffe4655b58c91ba1bf3bd2299ed90d500f2aea9f15981ae7dbe26130ce1a
BLAKE2b-256 checksum
How to use checksums
32f9b1c5a6d373cc52c991f0ff982e020b98d0f3e51c01a350946d858d546ecd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 5, 2026.

Transparency log

Security for ai-cli-insights 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ai_cli_insights-0.1.9.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page