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

@latten/adapter-codex

v0.1.0

Published

Adapter: parse Codex CLI session rollouts (~/.codex/sessions/**/*.jsonl) into a Latten Session. Reads token counts and hashes tool args/results on-device; the Session carries only counts and hashes, never raw prompts/code/output.

Readme

@latten/adapter-codex

See what your Codex sessions cost. Locally, in seconds.

This adapter parses Codex CLI rollouts (~/.codex/sessions/**/*.jsonl) into a Latten session model, so the @latten/cost detectors can point at recoverable spend — redundant round trips, stuck loops, uncached context — on your machine, with nothing sent anywhere.

Install

npm install @latten/adapter-codex @latten/cost

Usage

Three lines to your last 24 hours:

import { readCodexSessions } from '@latten/adapter-codex'
import { detectStuckLoop } from '@latten/cost'

const sessions = await readCodexSessions({ sinceMs: Date.now() - 86_400_000 })
sessions.forEach((s) => console.log(s.sessionId, detectStuckLoop(s)))

Need control? findCodexRollouts() and parseCodexRollout() are the pieces readCodexSessions() is made of — bring your own file list, inject a price function per model, or parse a single transcript string.

Prefer zero code? npx @latten/glow reads the same rollouts and shows your usage across every coding agent in one view.

What it extracts

  • Per-call token counts from Codex token_count events — input, output, and the cached portion split out, so cache misses are visible.
  • Model name per call (from the turn context), for accurate pricing.
  • Tool calls (shell, exec, web_search, …) with stable hashes of their arguments, and tool outputs hashed for equality checks.
  • Read-only discovery classification for common tools and shell commands, so detectors never mistake git status for real work.
  • Assistant text hashes for repeated-output loop detection.

Privacy model

The session files this adapter reads contain your prompts, code, and command output. None of that survives parsing:

  • prompts and developer messages are dropped entirely, not even hashed;
  • tool arguments, outputs, and assistant text are reduced to on-device SHA-256 hashes, used only for local equality checks;
  • token counts and tool types are the only facts that leave the parser;
  • pricing is injected by the caller — the parser never touches the network;
  • malformed or partial JSONL lines are ignored.

This is the same values-never contract as every Latten package: types and counts, never values. The test suite asserts it — serialize a parsed session and the raw content is provably absent.

Part of the Latten session model

@latten/adapter-claude-code does the same for Claude Code transcripts, and @latten/adapter-gemini covers Gemini CLI (honestly — see its README). One session model, every agent your team runs.


You moved fast with AI. Latten helps you stay in control of it. See what your AI costs — and where your data goes: Latten turns the AI calls across your company into one live graph — cost, reach, and PII exposure, attributed and observed from real traffic. One prompt to your coding agent, a PR you review, live in minutes. latten.io