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

@mohndoe/pi-atlas

v0.2.1

Published

See your agent usage and cost directly in Pi — costs, languages, models, projects, and tools from session logs.

Readme

@mohndoe/pi-atlas

A pi extension that turns your session logs into an interactive dashboard — costs, languages, models, projects, tools, and token usage at a glance.


Features

  • Multiple time ranges — Today, Last 7 days, Last 30 days, or All time
  • Cost tracking — per-model, per-project, based on real usage costs
  • Language breakdown — lines written and edited
  • Model analytics — provider-aware model cost, call count. Models are keyed by provider+model combination (same model on different providers tracked separately). Works with local LLMs too.
  • Project attribution — cost and session count per project directory
  • Usage overview — tool call frequency and token breakdown (input, output, cache read/write)
  • Cache — SHA-256-gated persists session aggregates; near-instant open on next visits
  • Lightweight — only two dependencies: chalk for color output and @mohndoe/pi-tui-extras for TUI components

Dashboard

Tabs

  • Overview — Cards displaying total cost, sessions count, messages count, active days, average cost per day, total tokens. A bar chart displaying cost overtime. And top language, top model, and top project side by side.
  • Languages — Languages ranked by line written.
  • Models — Models ranked by cost. Shows providers, calls and cost per model.
  • Projects — Projects ranked by cost. Shows session count and cost per project.
  • Skills — Skills ranked by cost with invocation count, session count, and token breakdown (total, input, output).
  • Usage — Token breakdown (Total, Input, Output, Cache Read, Cache Write) and table of tool usage.

All tabs display data corresponding to the selected time range (press r to change it). Press / to switch tabs, / to scroll table rows.

Install

pi install npm:@mohndoe/pi-atlas

Then run /reload in pi (or restart pi). The /atlas command is now available.

Usage

In the pi terminal, type /atlas to open the atlas dashboard. Session data is loaded from ~/.pi/agent/sessions/ -- on first load this may take a moment while JSONL files are parsed. Subsequent opens use a cached snapshot and load instantly.

How it works

~/.pi/agent/sessions/*.jsonl
         │
         ▼ parseFile()        ◄── entry types handled
  ┌──────────────────┐
  │  SessionAgg[]     │   per session, cached to disk
  └────────┬─────────┘
           │
           ▼ summarize(sessions, range)
  ┌──────────────────┐
  │ StatsSummary × 4  │   1d, 7d, 30d, All pre-computed
  └────────┬─────────┘
           │
           ▼
  Tab receives StatsSummary  ──→  Component render

Data sources — pi stores every session as a .jsonl file in ~/.pi/agent/sessions/. Pi Atlas parses entry types: session headers, user messages, assistant messages, tool results, model changes, thinking level changes, compactions, and branch summaries.

Caching — On first open, the sessions directory is scanned and all JSONL files are parsed into SessionAgg objects. This aggregate is cached to disk alongside a SHA-256 signature of the directory (file paths, sizes, modification times) and the package version. On subsequent opens, the cache is reused if both the signature and version match, making the dashboard appear instantly.

Language detection — Lines are counted by splitting written/edited content on \n. File extensions map to language names via a built-in mapping of 70+ extensions (TypeScript, Python, Rust, Go, etc.).

Cost attribution — Assistant message costs are attributed to all active projects in the session. See ADR-0001 for details.

Development

# Setup
git clone https://github.com/MohnDoe/pi-atlas.git
cd pi-atlas
bun install

# Type check
bun run typecheck

# Test
bun test

# Coverage
bun test --coverage

Architecture decisions

See docs/adr/ for recorded decisions:

A higher-level ARCHITECTURE.md covers module structure and component hierarchy.

Data privacy

Pi Atlas reads session logs from ~/.pi/agent/sessions/. All processing is done locally - no data ever leaves your machine. The cache file is written to ~/.pi/pi-atlas-cache.json and contains aggregated statistics (costs and counts), not message content.

License

MIT