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

session-cache-mcp

v0.1.2

Published

Session-scoped MCP server that eliminates redundant file reads across Claude Code subagents

Readme

session-cache-mcp

A session-scoped MCP server that eliminates redundant file reads across Claude Code subagents.

When Claude Code delegates tasks to multiple subagents, each subagent independently reads the same files -- measured at 66.2% redundancy. This MCP server provides a shared in-memory cache where subagents check before reading and record after reading, turning redundant file reads into cheap cache lookups.

How It Works

Subagent needs file → check_cache → Hit? Use summary. Miss? Read file → record_read

Three tools:

| Tool | Purpose | |------|---------| | check_cache(file_path) | Check if a file has been cached. Returns summary on hit, miss indicator otherwise. Detects stale entries via mtime. | | record_read(file_path, summary, symbols?) | Record a file read with a concise summary. Stores the file's mtime for staleness detection. | | get_session_map() | Get all cached file summaries. Useful for planning at the start of a task. |

The cache lives in-memory and dies with the session -- no persistence, no database, no cleanup needed.

Installation

With npx (recommended)

# Project-level
claude mcp add session-cache -- npx -y session-cache-mcp

# User-level (shared across projects)
claude mcp add session-cache -s user -- npx -y session-cache-mcp

Global install

npm install -g session-cache-mcp
claude mcp add session-cache -s user -- session-cache-mcp

Setup

1. Add behavioral rules to CLAUDE.md

Copy the contents of rules/session-cache.md into your project's CLAUDE.md:

Before reading any file, call `check_cache` from the session-cache server with the file path.
If the cache returns a hit, use the summary instead of re-reading the file unless you need
details not covered by the summary.

After reading a file, call `record_read` from the session-cache server with the file path
and a concise summary (2-4 sentences covering the file's purpose, key exports, and important details).

At the start of a complex task, call `get_session_map` to see what files have already been
read in this session.

2. (Optional) Add SubagentStart hook

Add to your .claude/settings.json or project-level hook config:

{
  "hooks": {
    "SubagentStart": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "node node_modules/session-cache-mcp/hooks/subagent-start.js"
          }
        ]
      }
    ]
  }
}

This injects a brief reminder into every spawned subagent, reinforcing the CLAUDE.md rules.

Tool API

check_cache

Input:  { file_path: string }
Output: { status: "hit", summary: string, symbols?: string[], recordedAt: number }
      | { status: "miss", reason: "not_cached" | "stale" | "file_not_found" }

record_read

Input:  { file_path: string, summary: string, symbols?: string[] }
Output: { status: "recorded", file_path: string }

get_session_map

Input:  {}
Output: { file_count: number, files: Record<string, { summary, symbols?, recordedAt }> }

Development

git clone <repo-url>
cd session-cache-mcp
npm install
npm test          # Run all tests (34 tests)
npm run build     # Compile TypeScript
npm run typecheck # Type check without emitting

License

MIT