npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

codex-session-insights

v0.2.3

Published

Generate a report analyzing your Codex sessions.

Readme

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.

codex-session-insights screenshot

Quick Start

Run it directly:

npx codex-session-insights

The default flow is:

  1. Read your local Codex thread index
  2. Estimate likely analysis token usage
  3. Let you confirm the plan in an interactive terminal
  4. Generate report.html and report.json
  5. 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 Glance
  • What You Work On
  • How You Use Codex
  • Impressive Things You Did
  • Where Things Go Wrong
  • Features to Try
  • On the Horizon
  • One More Thing

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:

npx codex-session-insights --provider openai --api-key $OPENAI_API_KEY

Defaults

Current default analysis plan:

  • days: 30
  • limit: 200
  • facet-limit: 50
  • provider: codex-cli
  • facet-model: gpt-5.4-mini
  • fast-section-model: gpt-5.4-mini
  • insight-model: gpt-5.4
  • facet-effort: low
  • fast-section-effort: low
  • insight-effort: high

Important behavior defaults:

  • --preset lite maps to days=7, limit=20, facet-limit=8, preview=10
  • limit means the target number of substantive threads to include in the report, not just the first 50 indexed threads
  • facet-limit means the max number of uncached per-thread facet analyses to run in a single report
  • Report language follows a best-effort system locale check
  • Main-thread analysis is the default; sub-agent threads are excluded unless you pass --include-subagents
  • The CLI shows an estimate before running in interactive terminals
  • The CLI tries to open the generated HTML report in your browser after generation

What It Reads

  • ~/.codex/state_*.sqlite for the thread index
  • ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl for rollout events

Requirements

  • Node.js >=18
  • sqlite3 available on your system PATH
  • Codex CLI installed if you use the default codex-cli provider

Supported platform status:

  • macOS: expected to work
  • Linux: expected to work if sqlite3 and codex are installed
  • Windows: not yet verified

Privacy

The tool reads local Codex data from your machine.

  • With provider=codex-cli, analysis is performed through your local Codex CLI session
  • With provider=openai, prompts are sent through the OpenAI Responses API
  • Generated reports may contain project paths, thread titles, summaries, and other local development context

Review report.html and report.json before sharing them.

Limitations

  • Rollout event schemas may drift across Codex versions
  • Token estimates are conservative, not billing-accurate
  • The tool is designed around Codex local storage layout and is not a generic agent log analyzer
  • Windows support is not yet verified

Advanced Overrides

If you want to override the default model split manually:

npx codex-session-insights \
  --facet-model gpt-5.4-mini \
  --fast-section-model gpt-5.4-mini \
  --insight-model gpt-5.4 \
  --facet-effort low \
  --fast-section-effort low \
  --insight-effort high

To suppress browser opening:

npx codex-session-insights --no-open

To force browser opening:

npx codex-session-insights --open

For Contributors

Useful local commands:

npm install
npm test
npm run check
npm run report:lite
npm run generate:test-report

npm run report:lite runs a smaller local analysis preset for testing prompt and layout changes without paying the full 200/50 default cost. npm run generate:test-report writes a deterministic sample report page to test-artifacts/sample-report/.