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

codex-mem

v0.1.1

Published

Persistent memory system for Codex sessions with SQLite + FTS5 + MCP tools

Readme

codex-mem

Persistent memory for Codex sessions.

codex-mem ingests local Codex session/history logs into SQLite + FTS5, then exposes memory through both CLI commands and MCP tools.

Features

  • Incremental ingest from ~/.codex/sessions, ~/.codex/archived_sessions, and ~/.codex/history.jsonl
  • Persistent local store: ~/.codex-mem/codex-mem.db
  • Token-efficient retrieval flow:
    • search (index)
    • timeline (context)
    • get_observations (full details)
  • MCP server for in-session retrieval by Codex
  • Manual save_memory support
  • Background worker mode for automatic sync polling
  • Browser dashboard with live SSE status, project/session lens, timeline drill-down, and context preview
  • Shared API contracts/schemas across CLI, dashboard HTTP, and MCP tool inputs (API-first boundary validation)

Install

cd /Users/chadsimon/code/codex-mem
npm install
npm run build
npm link

Register MCP Server With Codex

codex-mem init-mcp

Equivalent manual command:

codex mcp add codex-mem -- node /path/to/codex-mem/dist/cli.js mcp-server

CLI

codex-mem sync --json
codex-mem search "schema migration" --limit 10 --json
codex-mem timeline 42 --before 8 --after 8 --json
codex-mem get 40 41 42 --json
codex-mem save "Use migration lock before batch writes" --title "migration lock" --json
codex-mem context --cwd /Users/chadsimon/code --limit 8
codex-mem stats --cwd /Users/chadsimon/code --json
codex-mem projects --limit 20 --json
codex-mem sessions --cwd /Users/chadsimon/code --limit 20 --json
codex-mem build-context --query "schema migration" --session-limit 5 --json
codex-mem worker --interval-seconds 15
codex-mem dashboard --host 127.0.0.1 --port 37811
codex-mem mcp-server

search excludes tool_call/tool_output noise by default; pass --type tool_call or --type tool_output when you want raw tool traces. dashboard defaults to http://127.0.0.1:37811.

MCP Tools

  • search(query, limit, offset, cwd, type)
  • timeline(anchor, before, after, cwd)
  • get_observations(ids)
  • save_memory(text, title, cwd)
  • stats(cwd)
  • list_projects(limit)
  • recent_sessions(cwd, limit)
  • build_context(query, cwd, limit, sessionLimit)

Development

npm run typecheck
npm test
npm run build

Architecture

  1. Importer reads JSONL events incrementally using per-file offsets.
  2. Repository stores normalized observations in SQLite.
  3. FTS5 powers full-text retrieval.
  4. Service layer orchestrates sync + retrieval.
  5. Contracts layer defines canonical observation/API schemas.
  6. CLI, MCP, and dashboard HTTP layer expose the same underlying service with contract-validated inputs.
  7. Dashboard frontend is split into modules (api, controller, dom, render, state) and loaded via static module assets.

Notes

  • v1 focuses on local-first persistence and retrieval.
  • No Codex internals are modified.