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 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 domainsproject_patterns— patterns to identify which project a session belongs totemplate_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_cli_insights-0.1.7.tar.gz.
File metadata
- Download URL: ai_cli_insights-0.1.7.tar.gz
- Upload date:
- Size: 54.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
011426a8174384d7f3f601f0cd0b673e824bcc471cad58f46769beed5c77f3d9
|
|
| MD5 |
2bc83d449d77e74a8a364bb709a94845
|
|
| BLAKE2b-256 |
dc6b368979507a957db9b5e087d87d8e3b27b68685cab8fa1086c313da6b6725
|
Provenance
The following attestation bundles were made for ai_cli_insights-0.1.7.tar.gz:
Publisher:
publish-pypi.yml on baoluchuling/ai-cli-insights
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_cli_insights-0.1.7.tar.gz -
Subject digest:
011426a8174384d7f3f601f0cd0b673e824bcc471cad58f46769beed5c77f3d9 - Sigstore transparency entry: 1040114856
- Sigstore integration time:
-
Permalink:
baoluchuling/ai-cli-insights@e202b20918760e031cd26f98e6f80579de230d99 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/baoluchuling
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e202b20918760e031cd26f98e6f80579de230d99 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ai_cli_insights-0.1.7-py3-none-any.whl.
File metadata
- Download URL: ai_cli_insights-0.1.7-py3-none-any.whl
- Upload date:
- Size: 66.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c140783dc85e645224421260ae224ed50c70c99227a944d68909442549557390
|
|
| MD5 |
335f85ded5ef17f12014d7a95cfdda15
|
|
| BLAKE2b-256 |
3d10db8829fc9eb3dfa9ed86cd024f4eee2c36fa014344e26636ea046e03a78f
|
Provenance
The following attestation bundles were made for ai_cli_insights-0.1.7-py3-none-any.whl:
Publisher:
publish-pypi.yml on baoluchuling/ai-cli-insights
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_cli_insights-0.1.7-py3-none-any.whl -
Subject digest:
c140783dc85e645224421260ae224ed50c70c99227a944d68909442549557390 - Sigstore transparency entry: 1040114913
- Sigstore integration time:
-
Permalink:
baoluchuling/ai-cli-insights@e202b20918760e031cd26f98e6f80579de230d99 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/baoluchuling
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e202b20918760e031cd26f98e6f80579de230d99 -
Trigger Event:
release
-
Statement type: