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
- 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
# 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.
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
This writes a SKILL.md to ~/.claude/skills/multi-insights/.
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
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
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.0.tar.gz.
File metadata
- Download URL: ai_cli_insights-0.1.0.tar.gz
- Upload date:
- Size: 52.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af90fbba5a8072a7b1440b889e88c4d6d60f542347b3c5a510ffcf0cb454b2c8
|
|
| MD5 |
4e44a436d98f6b45511e4daa1ee85d32
|
|
| BLAKE2b-256 |
2a392778dd0354e3a0046bdad14d8c1111c2a3ea255d040edda28b1941d62647
|
File details
Details for the file ai_cli_insights-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ai_cli_insights-0.1.0-py3-none-any.whl
- Upload date:
- Size: 64.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecf863ca22c7d0defd28c3b2f2de5f0d9e4de0fe725a2624a3ba40559fad44a0
|
|
| MD5 |
403c09f1689eff64466a660ab65bbef6
|
|
| BLAKE2b-256 |
11e8414e3920229db094bca5552ac4f8c4f58597bb63ccaf3a1c9e9fa80b4f9b
|