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

claude-codex-usage

v0.6.0

Published

Per-day word + message counts for Claude Code and Codex CLI sessions — local, zero-config

Readme

claude-codex-usage

npm version npm downloads license node

How many words per day do you actually read and type with coding agents?

A zero-config CLI that scans your local Claude Code and Codex CLI session logs and prints a per-day breakdown of messages and words, plus a summary that translates it into hours of typing, voice dictation, and reading. Nothing leaves your machine.


Install-free run

bunx claude-codex-usage
# or
npx claude-codex-usage

By default it shows the last 30 days. Use --all for the full history.

Example

┌────────────┬─────────────────────────────────────────────────┐
│            │                     claude                      │
│    date    ├──────────┬───────────┬────────────┬─────────────┤
│            │ you msgs │ you words │ reply msgs │ reply words │
├────────────┼──────────┼───────────┼────────────┼─────────────┤
│ 2026-04-17 │      132 │     4,805 │        438 │      50,201 │
│ 2026-04-18 │      157 │     9,212 │        562 │      48,847 │
│ 2026-04-19 │       39 │     1,513 │        110 │       8,078 │
│ 2026-04-20 │       44 │       625 │        104 │       6,710 │
├────────────┼──────────┼───────────┼────────────┼─────────────┤
│   TOTAL    │      372 │    16,155 │      1,214 │     113,836 │
│  AVG/day   │       93 │     4,038 │        303 │      28,459 │
└────────────┴──────────┴───────────┴────────────┴─────────────┘

Active days: 4 / 4

On an average active day with Claude Code:
  You send 93 messages (4,038 words) — about 50 min typing at 80 WPM,
    or 40 min dictating at 100 WPM.
  You read 303 assistant text blocks (28,459 words) — roughly 1h 53m at 250 WPM.
  (3.3× more reply blocks than prompts — the agent emits text between each tool call.)

The default view has three column groups — all, claude, codex — showing both tools side by side.

Below the table you also get two small line charts — messages per day (claude / codex / all) and words per day (you / reply) — so you can eyeball trends without squinting at rows:

Messages per day   ● claude   ● codex   ● all
   2,612 ┼     ╭╮
   1,306 ┤  ╭╮ ││
     980 ┤  ││ ││╭╮
     653 ┼──╯│╭╯╰╯│╭──╮
     327 ┼╮╭╯││╯│╭╰╯  │
       0 ┤╰╯╯╰╯╰╰╯╰───╰
  2026-04-10 → 2026-04-23 (14 days)

Pass --no-graph to suppress the charts, or --csv for data-only output.

Usage

claude-codex-usage [--days N | --since YYYY-MM-DD | --all]
                   [--claude-only | --codex-only] [--csv] [--no-graph]

| flag | effect | |---|---| | --days N | Only the last N days (default: 30) | | --since YYYY-MM-DD | Only activity on or after that date | | --all | Full history (slower; scans every session file) | | --claude-only | Hide Codex columns | | --codex-only | Hide Claude Code columns | | --csv | Emit CSV instead of a table | | --no-graph | Suppress the line charts under the table | | -h, --help | Show help |

What gets counted

The goal is to count only the text you actually read and type — not the agent's internal reasoning, not tool calls, not code written via Edit/Write, not tool results.

Claude Code — session files at ~/.claude/projects/<project>/<session>.jsonl:

  • assistant.content[] blocks where type == "text" (what the agent shows you)
  • user.content when it's a raw string (your prompts; system wrappers like <system-reminder> and <command-name> are stripped)
  • thinking, tool_use, tool_result

Codex — session files at ~/.codex/sessions/**/rollout-*.jsonl and ~/.codex/archived_sessions/:

  • event_msg with payload.type == "agent_message" (final/commentary text)
  • event_msg with payload.type == "user_message"
  • agent_reasoning, exec_command_end, patch_apply_end, token_count, task_started/complete, thread_name_updated, view_image_tool_call
  • ❌ All response_item/* (duplicates of event_msg/agent_message for assistants; framework-injected context for users)

Why reply msgsyou msgs

One prompt produces multiple assistant text blocks because the agent narrates between each tool call:

you:       "fix the bug"
assistant: "Let me look at the stack trace first"      ← block 1
           Read(...)
assistant: "Found it — null check missing"             ← block 2
           Edit(...)
assistant: "Running tests now."                        ← block 3
           Bash(...)
assistant: "All 42 pass."                              ← block 4

So reply msgs counts how many text chunks you have to read, not the number of "responses". Expect 3–5× more reply blocks than prompts. The word counts are the real measure of reading and typing volume.

Privacy

Everything runs locally. No network calls. No data leaves your machine. It only reads files under ~/.claude/ and ~/.codex/ that you already have.

Performance

By default the last 30 days takes ~2–3 s; --days 7 runs in under 1 s. File mtime is used to skip irrelevant history without parsing it. --all forces a full scan and can take ~10 s depending on archive size.

Development

git clone https://github.com/madeyexz/claude-codex-usage.git
cd claude-codex-usage
bun install            # or: npm install
bun run build          # or: npm run build
node dist/index.js --days 7

Dependencies are intentionally minimal: cli-table3 for borders, picocolors for ANSI, and asciichart for the line charts.

License

MIT