Install
npx codex-session-insightsclaude mcp add codex-session-insights -- npx codex-session-insights{
"mcpServers": {
"codex-session-insights": {
"command": "npx",
"args": [
"codex-session-insights"
]
}
}
}Install command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →codex-session-insights
Generate a report analyzing your Codex sessions.
codex-session-insights reads your local Codex history, extracts recurring patterns from your sessions, and renders a narrative report as both HTML and JSON.
Quick Start
Run it directly:
npx codex-session-insights
The default flow is:
- Read your local Codex thread index
- Estimate likely analysis token usage
- Let you confirm the plan in an interactive terminal
- Generate
report.htmlandreport.json - Try to open the HTML report in your browser
If you only want the estimate first:
npx codex-session-insights --estimate-only
If you already know what you want and do not want the confirmation flow:
npx codex-session-insights --yes
What You Get
By default the tool writes:
~/.codex/usage-data/report.html~/.codex/usage-data/report.json
The HTML report includes these sections:
At a GlanceWhat You Work OnHow You Use CodexImpressive Things You DidWhere Things Go WrongOpen Loops(sessions that ended without confirmed completion)Features to TryOn the HorizonOne More Thing
How the headline numbers are defined
Active Timesums the gaps between consecutive rollout events, skipping any gap longer than 30 minutes. The raw first-to-last span of each thread is shown separately asThread span (wall clock)in the appendix.Median Turnis the time from a user message to the assistant's final answer for that turn. It includes tool, build, and sub-agent run time, so it describes how long turns take, not how responsive the model is.Tool Errorscounts non-zero command exits plus failed tool calls. Probe misses such asrg,grep, ortestexiting 1 with nothing found are excluded and reported separately.Failure Hotspots (by command)groups failures by the program that actually ran (git push,cmake,npm test), not by the Codexparsed_cmdtype, which labels most compound commandsunknown.Failure Causesis a heuristic classification from exit code and output text (test_failed,build_failed,git_error,command_not_found,interrupted, and so on).unclassifiedmeans the cause could not be determined.Session TypesandOutcomesonly cover threads that received an LLM label. Each panel states its coverage (for example "12 of 124 labeled threads"), and the narrative sections are instructed not to extrapolate beyond it. Re-running the tool extends coverage because labels are cached.
Typical Usage
Default run:
npx codex-session-insights
Lite local run for prompt and layout testing:
npx codex-session-insights --preset lite
Estimate first, then decide:
npx codex-session-insights --days 7 --limit 20 --facet-limit 8 --estimate-only
Use a custom output directory:
npx codex-session-insights --out-dir ./insights-output
Emit JSON to stdout instead of a terminal summary:
npx codex-session-insights --stdout-json
Include archived threads:
npx codex-session-insights --include-archived
Include sub-agent threads as well as main threads:
npx codex-session-insights --include-subagents
Choose the report language explicitly:
npx codex-session-insights --lang zh-CN
npx codex-session-insights --lang en
Use the OpenAI API instead of your local Codex CLI login:
Similar plugs
CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies
Bash is all you need - A nano claude code–like 「agent harness」, built from 0 to 1
Documented system prompts from Anthropic - Claude Fable 5.1, Opus 5.5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro,…
Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini…