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

haansi

v0.1.45

Published

Haansi CLI - Session collector and MCP server for Claude Code & OpenAI Codex

Readme

Haansi CLI

Session collector and MCP server for Claude Code and OpenAI Codex. Uploads your coding-agent session data to the Haansi platform for mining, search, and knowledge retrieval, and registers the Haansi MCP server with either or both agents.

Published to npm as haansi.

Supported agents

| Agent | Sessions read from | MCP config file | | ------------ | ----------------------------------------- | ---------------------- | | Claude Code | ~/.claude/projects/**/*.jsonl | ~/.claude.json | | OpenAI Codex | $CODEX_HOME/sessions/**/rollout-*.jsonl | ~/.codex/config.toml |

By default, commands act on every installed agent. Target a specific one with --agent claude, --agent codex, or --agent both. The choice is remembered in ~/.haansi/config.json. Run haansi agents to see what's detected and selected.

Installation

npm install -g haansi

Requires Node.js >= 18.0.0.

Authentication

The CLI uses hsk_ tokens for authentication. Generate a token at https://app.haansi.co/settings/developer/tokens.

haansi init

This prompts for your token, validates it against the API, and saves it to ~/.haansi/credentials.json (mode 0600). Alternatively, set the HAANSI_TOKEN environment variable.

Commands

| Command | Description | | --------------------------------- | ------------------------------------------------------ | | haansi init | Authenticate and save your API token | | haansi collect [--agent <sel>] | Upload new/changed sessions (once) | | haansi agents | List supported / installed / selected agents | | haansi daemon | Run the collector on a schedule (every 30 min) | | haansi setup-daemon | Install macOS launchd service for auto-start on login | | haansi setup-mcp [t] [--agent] | Register MCP servers with Claude Code and/or Codex | | haansi mcp-server | Start the Haansi MCP server (stdio, used by the agent) | | haansi config get [key] | Show preferences (e.g. session_mode) | | haansi config set <key> <val> | Update a preference | | haansi search-solutions <query> | Semantic search over mined solutions | | haansi list-solutions | List recent mined solutions | | haansi search-knowledge <query> | Search knowledge artifacts | | haansi save-knowledge | Save a problem/solution for future retrieval |

Collect options

  • --agent <sel> -- claude, codex, or both (default: installed agents)
  • --force-all -- Re-upload all sessions, not just new ones
  • --dry-run -- Scan without uploading
  • --limit <n> -- Upload at most n sessions

Configuration

| Environment Variable | Description | Default | | ------------------------- | ----------------------------------------- | ----------------------- | | HAANSI_TOKEN | API token (alternative to haansi init) | -- | | HAANSI_API_URL | API base URL | https://api.haansi.co | | CODEX_HOME | Codex home directory | ~/.codex | | HAANSI_AGENTS | Daemon: comma-separated agents to collect | (all installed) | | HAANSI_COLLECT_SCHEDULE | Cron expression for daemon | */30 * * * * |

User preferences

Set via haansi config set <key> <value>:

  • session_mode -- private or org (default: org)

Daemon (macOS)

haansi setup-daemon            # install and start
haansi setup-daemon --uninstall # stop and remove

Installs a launchd plist at ~/Library/LaunchAgents/co.haansi.daemon.plist. Logs are written to ~/.haansi/daemon.log.

MCP Server

haansi setup-mcp                 # all installed agents
haansi setup-mcp --agent codex   # Codex only
haansi setup-mcp --agent both    # Claude Code + Codex

Registers haansi-solutions (stdio) and haansi-exchange (http) with the selected agent(s): Claude Code via ~/.claude.json, Codex via the [mcp_servers.*] tables in ~/.codex/config.toml. Existing config is preserved — only the managed entries are added/updated. Restart the agent to pick up the change.


Package: haansi Location: apps/cli/