Session Cache
FreeStale (191d)In-memory file cache for Claude Code subagents that eliminates redundant file reads across parallel tasks.
About
In-memory file cache for Claude Code subagents that eliminates redundant file reads across parallel tasks.
README
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
As a Claude Code plugin (recommended)
- Open Claude Code
- Open Manage Plugins (
/pluginsor via the menu) - In the Marketplaces tab, enter the GitHub URL:
https://github.com/Kuroakira/session-cache-mcp - Switch to the Plugins tab and install it
When installed as a plugin, the MCP server, usage protocol (skill), and SubagentStart hook are all automatically available — no manual CLAUDE.md or settings.json configuration needed.
Other plugins (e.g., claude-praxis) can invoke the session-cache:session-cache-protocol skill to inject the cache protocol into their workflows.
As an npm MCP server (manual setup)
If using via npx or global install without the plugin system, add the following to 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.
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
Install Session Cache in Claude Desktop, Claude Code & Cursor
unyly install session-cacheInstalls into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.
First time? Get the CLI: curl -fsSL https://unyly.org/install | sh
Or configure manually
Run in your terminal:
claude mcp add session-cache -- npx -y session-cache-mcpStep-by-step: how to install Session Cache
FAQ
Is Session Cache MCP free?
Yes, Session Cache MCP is free — one-click install via Unyly at no cost.
Does Session Cache need an API key?
No, Session Cache runs without API keys or environment variables.
Is Session Cache hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Session Cache in Claude Desktop, Claude Code or Cursor?
Open Session Cache on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Changes
Versions and requested access over time.
- New version published
- New version published
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectAmap Maps Mcp Server
MCP server for using the AMap Maps API
by duxiaohuiSupabase
Database, auth and storage
by SupabaseEverything
Reference / test server with prompts, resources, and tools.
Git
Tools to read, search, and manipulate Git repositories.
Sequential Thinking
Dynamic and reflective problem-solving through thought sequences.
Time
Time and timezone conversion capabilities.
Compare Session Cache with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
