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

unimem

v2.0.1

Published

Universal AI CLI Memory Service - automatic context switching across Claude Code, Gemini CLI, Codex, Copilot, Cursor, and Aider

Downloads

182

Readme

UniMem v2

Automatic Cross-CLI Context Switching for AI Development

UniMem automatically transfers your working context when you switch between AI coding CLIs. No manual steps, no copy-paste, no re-explaining what you were doing.

When you close Claude Code and open Gemini CLI (or vice versa), the new tool already knows what you were working on, which files you touched, and where you left off.

Installation

npm install -g unimem

After install, you'll see a getting-started guide. You can view it anytime with:

unimem guide

Quick Start

# 1. Install hooks into your CLIs (one-time)
unimem install --all

# 2. Start the worker (required for hooks + dashboard)
unimem start

# 3. Work normally — context transfers automatically when you switch CLIs

How It Works

You work in Claude → close it → open Gemini → Gemini has Claude's context
You work in Gemini → close it → open Claude → Claude has Gemini's context

Under the Hood

When a CLI session ends:

  1. A SessionEnd hook fires automatically
  2. All tool usage from the session (file reads, edits, commands) is saved
  3. A handoff snapshot is created with completed work, files touched, and state
  4. Context is written to CLAUDE.md, GEMINI.md, and AGENTS.md in your project

When a CLI session starts:

  • Claude Code reads CLAUDE.md at startup (built-in behavior) — context is already there
  • Gemini CLI receives context via additionalContext in the SessionStart hook response

Supported CLIs

| CLI | MCP Tools | Hooks | Auto-Switch | |-----|-----------|-------|-------------| | Claude Code | Yes | Yes (SessionStart, SessionEnd, PostToolUse, UserPromptSubmit) | Yes | | Gemini CLI | Yes | Yes (SessionStart, SessionEnd, BeforeAgent, AfterTool) | Yes | | Codex | Via MCP | Manual | Via AGENTS.md | | Cursor | Via MCP | Manual | Via .cursorrules |

Dashboard

unimem start
# Open http://localhost:37888

4 tabs:

  • Overview — sessions, observations, CLI breakdown, recent activity
  • Tokens — token consumption per CLI, daily charts, cost tracking
  • Sessions — session chain timeline, handoff history
  • Memory — searchable, filterable observation browser

Token Tracking

UniMem tracks token consumption across CLIs by reading their local stats files:

  • Claude Code: ~/.claude/stats-cache.json
  • Gemini CLI: ~/.gemini/history/
  • Codex: ~/.codex/sessions/

Auto-syncs every 60s. Manual sync: curl -X POST http://localhost:37888/api/tokens/sync

CLI Commands

unimem              # Run stdio MCP server (npx compatible)
unimem serve        # Same as above (explicit)
unimem start        # Start HTTP worker + dashboard
unimem install      # Configure CLI integrations (--gemini, --claude, --all)
unimem status       # Show project memory stats
unimem resume       # Show handoff context
unimem handoff      # Create manual handoff snapshot
unimem guide        # Show getting started guide

MCP Tools

Available inside any connected CLI:

| Tool | Description | |------|-------------| | memory_search | Full-text search across all observations | | memory_save | Store observations (discoveries, bugfixes, implementations) | | memory_resume | Get "where we left off" context | | memory_status | Overview of memory state | | memory_timeline | Chronological observation view | | memory_handoff | Create explicit handoff snapshot |

Requirements

  • Node.js >= 18
  • npm >= 8
  • At least one supported AI CLI installed (Claude Code, Gemini CLI)
  • The UniMem worker must be running for hooks to function (unimem start)

Known Limitations

  • Worker must be running: Hooks communicate with the UniMem worker via HTTP on port 37888. If the worker is not running, hooks queue events to disk (~/.unimem/offline-queue/) and replay them when the worker starts. No data is lost, but auto-switch won't work until the worker is running.
  • Observation granularity: UniMem captures tool usage (file reads, edits, commands) but not the AI's internal reasoning. For richer handoffs, ask the AI to call memory_save with important decisions and context.
  • Concurrent CLIs: Running two CLIs on the same project simultaneously is detected and warned about, but context files may be overwritten. Best practice: close one CLI before opening another.
  • Local only: All data is stored locally in ~/.unimem/unimem.db (SQLite). There is no cloud sync, no remote storage, no data leaving your machine.
  • Token tracking accuracy: Token data is parsed from CLI tools' local cache files. Accuracy depends on the format those tools use, which may change across versions.

Data & Privacy

  • All data is local. UniMem stores everything in ~/.unimem/ on your machine.
  • No telemetry. No data is sent anywhere.
  • No API keys required. UniMem doesn't call any external APIs.
  • Context files (CLAUDE.md, GEMINI.md) are written to your project directory. Add them to .gitignore if you don't want them committed:
    CLAUDE.md
    GEMINI.md
    AGENTS.md

Troubleshooting

"Worker not running" warning:

unimem start  # Start it in a separate terminal

Hooks not firing:

# Verify installation
cat ~/.gemini/settings.json | grep unimem
cat ~/.claude/settings.json | grep unimem
cat ~/.mcp.json | grep unimem

# Re-install if needed
unimem install --all

No context showing up after switching CLIs:

  1. Make sure both CLIs are started from the same directory (project name is derived from cwd)
  2. Check that the worker is running: curl http://localhost:37888/api/status
  3. Check if observations exist: unimem status

Database issues:

# Reset the database (WARNING: deletes all stored memories)
rm ~/.unimem/unimem.db
unimem status  # Recreates the database

Architecture

  • SQLite with WAL mode + FTS5 full-text search
  • MCP protocol for Claude Code / Gemini CLI tool integration
  • Express HTTP worker for dashboard + hook receiver
  • React + Tailwind dashboard (bundled, no separate install)
  • Offline queue for resilience when worker is down

License

MIT

Author

Prashant Gupta