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

@maol-1997/ai-usage

v1.0.3

Published

Upload local Claude Code and Codex usage to a private ingestion endpoint

Downloads

385

Readme

@maol-1997/ai-usage

Uploads local Claude Code and Codex token usage to a private ingestion endpoint without installing SwiftCode. The endpoint URL is required on every upload and is not built into this package.

It scans the official local history locations:

  • Claude Code: $CLAUDE_CONFIG_DIR/projects, or ~/.claude/projects by default.
  • Codex: $CODEX_HOME/sessions, or ~/.codex/sessions by default.

On native Windows, ~ is %USERPROFILE%, so the defaults become %USERPROFILE%\.claude\projects and %USERPROFILE%\.codex\sessions. Linux and WSL use the current Linux user's home. When running inside WSL to scan data created by a native Windows installation, pass the mounted homes explicitly with --claude-home and --codex-home.

The CLI sends only token counts, model, timestamp, local day, cost, source, a deduplication hash, and the machine name. It never uploads prompts, responses, files, project paths, or session IDs.

Run

macOS and Linux:

AI_USAGE_TOKEN="your-token" npx @maol-1997/ai-usage --url "https://your-endpoint.example/ingest"

Windows PowerShell:

$env:AI_USAGE_TOKEN="your-token"
npx @maol-1997/ai-usage --url "https://your-endpoint.example/ingest"

Every run scans and resends all available local history, independently of SwiftCode's upload cursor. The endpoint deduplicates entries, so rerunning the command is safe. Use --dry-run to inspect how many entries would be sent. This scans the provider JSONL files, not SwiftCode's SQLite database, and does not upload plan reports.

npx @maol-1997/ai-usage@latest --dry-run
npx @maol-1997/ai-usage --url "https://your-endpoint.example/ingest" --source codex
npx @maol-1997/ai-usage --help

Requires Node.js 20 or newer.

Current release

Version 1.0.3 includes the current model pricing snapshot (including Claude Haiku 5.5), long-prompt rates for models that charge more past a prompt length, Priority/Fast pricing, applied Codex model and service-tier settings, and deduplication of repeated cumulative Codex token notifications. It sends usage revision 3 so the endpoint can correct older matching entries without duplicating history. Pricing is refreshed when the package is built for publication; installed releases use their bundled snapshot.

Path defaults follow the Claude Code application data documentation and Codex's official CODEX_HOME configuration.