edgemem
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@edgememwrite memory/stack.md with our tech stack"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
edgemem
Filesystem-native agent memory for Claude Code — your team's conventions, decisions, and context, available to every agent session without repeating yourself.
- "We use Drizzle not Prisma. pnpm not npm. No default exports."
- (repeated every session, by every developer, forever)
+ edgemem write "memory/stack.md" "..." # once
+ # Claude knows. Every session. Every developer.The problem
Claude Code forgets everything when you close a session.
Every morning, every developer on your team re-explains the same things:
Which ORM you use
Which patterns are required
Which decisions were made and why
What the new dev should know on day one
CLAUDE.md helps — but it's static, requires a commit to update, can't be written by the agent, and grows until it fills the context window.
edgemem fixes this.
How it works
Team writes conventions once → stored in Supermemory cloud
↓
Every Claude Code session → edgemem loads what's relevant
↓
Agent learns something new → edgemem saves it automatically
↓
Next session → Claude already knowsMemory lives in the cloud. Every developer shares it. No commits required.
Three modes — pick what fits
Phase 1 · File sync | Phase 2 · MCP | Phase 3 · Hook | |
How |
| Live tools in Claude Code | Auto-inject on every session |
Agent writes back | ❌ | ✅ | ✅ |
Setup effort | Low | Medium | Medium |
Best for | Getting started, onboarding | Active development | Zero-effort, always-on |
All three modes share the same Supermemory container — one source of truth.
Quick start
Prerequisites
Node.js 18+
A Supermemory API key
Phase 1 — File sync (start here)
export SUPERMEMORY_API_KEY=sm-...
export EDGEMEM_CONTAINER=myproject-team
npx edgemem init # setup project, update CLAUDE.md
npx edgemem write "memory/stack.md" "
Database: PostgreSQL 16
ORM: Drizzle (not Prisma)
Package manager: pnpm
Framework: Next.js App Router
"
npx edgemem sync # pull memory → .claude/memory/
claude # open Claude Code — it reads memory automaticallyPhase 2 — MCP server (real-time)
Add .mcp.json to your project root:
{
"mcpServers": {
"edgemem": {
"command": "npx",
"args": ["@edgemem/mcp"],
"env": {
"SUPERMEMORY_API_KEY": "${SUPERMEMORY_API_KEY}",
"EDGEMEM_CONTAINER": "myproject-team"
}
}
}
}Claude Code now has 5 memory tools — see MCP tools below.
Phase 3 — Hook (zero effort)
cp -r examples/phase3-hook/.claude .claude
export EDGEMEM_CONTAINER=myproject-teamEvery Claude Code session now starts with memory pre-loaded. No commands. No prompting.
Security
Protected core files
The following memory files are read-only by default. The agent cannot overwrite them — only a human can, with an explicit override:
File | Purpose |
| Tech stack and versions |
| Coding conventions |
| Architecture decisions |
| New developer guide |
To allow human-initiated mutations:
# CLI — use the --force flag
npx edgemem write "memory/stack.md" "updated stack" --force
# MCP server — set the env var
EDGEMEM_ALLOW_CORE_MUTATION=true npx @edgemem/mcpAny attempt by the agent to write to these files without the override is rejected with a clear error before any API call is made.
PII and secret scanner
Every write and append operation automatically scans content and redacts high-probability credentials before they reach Supermemory:
Pattern | Label |
| Stripe API keys |
| Google Cloud / Firebase API keys |
| AWS Access Key IDs |
| GitHub tokens |
| Slack bot tokens |
| Generic bearer tokens |
| Password literals |
| Secret literals |
Redacted content is stored as [REDACTED:label]. The audit log records which labels were stripped.
Offline resilience
edgemem never crashes Claude Code if Supermemory is unreachable.
On every successful read, content is written to a local disk cache at ~/.edgemem/cache/<container>/.
If the API is unreachable:
read— returns the latest cached version, warns tostderrwrite/append— writes to local cache, warns tostderrgrep— returns empty string, warns tostderrlist— returns empty array
The agent continues working with stale-but-available data instead of failing.
Audit log
Every operation is appended to .claude/memory/edgemem.log in JSON Lines format:
{"timestamp":"2026-06-08T10:33:10Z","action":"read","file_path":"memory/stack.md","status":"ok"}
{"timestamp":"2026-06-08T10:33:11Z","action":"write","file_path":"memory/auto-saved.md","status":"pii-redacted","detail":"redacted: stripe-live-key"}
{"timestamp":"2026-06-08T10:33:12Z","action":"read","file_path":"memory/stack.md","status":"cache-hit"}Field | Values |
|
|
|
|
| Optional — present when status is |
The log file is append-only and never throws on write failure (audit itself is fail-silent).
Smart context chunking
mem_grep (and the CLI grep command) runs a semantic search, then chunks the result before returning it to Claude.
Instead of dumping an entire file into the context window, edgemem:
Splits the result by headings (
#,##,###) or paragraphsScores each section by how many query terms it matches (heading matches score 3×)
Returns only the top sections within a 4,000-token budget
Prepends a warning when sections were dropped
[edgemem] Showing 3/8 sections (~2,400 tokens). Remaining omitted to protect context window.
## Database
PostgreSQL 16 with Drizzle ORM.
## Migrations
Run with pnpm db:migrate. Never edit migrations by hand.CLI reference
# Setup
npx edgemem init [--container <name>] [--api-key-env <name>]
# Sync (Phase 1)
npx edgemem sync [--output <dir>] [--container <name>]
# Read / write
npx edgemem read <path> [--container <name>]
npx edgemem write <path> <content> [--container <name>] [--force]
npx edgemem append <path> <content> [--container <name>] [--force]
# Search
npx edgemem grep <query> [--path <path>] [--container <name>]
npx edgemem list [--path <path>] [--container <name>]
# Hook injection (Phase 3)
npx edgemem inject [--container <name>] [--format context|json]--force bypasses write protection on core files. Intended for human use only — the agent should never pass this flag autonomously.
MCP tools
Tool | Description | Protected-path safe? |
| Read a file from team memory | ✅ (read-only) |
| Write or overwrite a memory file | Blocked unless |
| Append content to a memory file | Blocked unless |
| Semantic search (returns chunked results) | ✅ (read-only) |
| List memory files | ✅ (read-only) |
All tools return a text error message (never throw) so Claude Code always gets a usable response.
For teams
All developers share the same memory container. One person writes a convention — everyone's agent knows it immediately.
# Developer A (Monday)
npx edgemem append "memory/conventions.md" "Use server actions for mutations" --force
# Developer B (Tuesday, different machine)
claude
# → Claude already knows about server actions. No sync needed. No commit needed.Onboarding a new developer:
git clone your-repo
export SUPERMEMORY_API_KEY=sm-... # from team 1Password
claude
# → Claude knows the entire project context from day oneMemory file conventions
memory/stack.md — tech stack, versions, tools [protected]
memory/conventions.md — coding conventions and patterns [protected]
memory/decisions.md — architecture decisions and rationale [protected]
memory/onboarding.md — guide for new developers [protected]
memory/auto-saved.md — conventions captured automatically [writable]
memory/<anything>.md — your own files [writable]Protected files require --force (CLI) or EDGEMEM_ALLOW_CORE_MUTATION=true (MCP/env) to modify. All other files are freely writable by the agent.
Write signatures
Every write and append stamps an invisible HTML comment at the end of the content for conflict tracing:
<!-- edgemem: 2026-06-08T10:33:10.123Z | session: a3f9b2c1 -->The session ID is generated once per createMem() call. Passing sessionId in MemOptions makes it stable across calls (useful for identifying agent sessions in the audit log).
edgemem vs CLAUDE.md
Both solve the same problem. They work best together.
CLAUDE.md | edgemem | |
Stored | Git repo | Supermemory cloud |
Update | Commit required | Write anytime |
Agent can write | ❌ | ✅ |
Size limit | Context window | Load only what's needed |
Search | Read whole file | Semantic search |
Per-person notes | ❌ everyone sees | ✅ separate containers |
Offline access | ✅ always | ✅ local cache fallback |
Recommended pattern:
# CLAUDE.md — structural rules (static)
Project layout, tool configuration, things that almost never change.
# Dynamic memory — managed by edgemem
@.claude/memory/conventions.md
@.claude/memory/decisions.mdKeep CLAUDE.md short and structural. Let edgemem handle living knowledge.
Configuration
Config is resolved in this order (first match wins):
Environment variables:
SUPERMEMORY_API_KEY,EDGEMEM_CONTAINER.claudercin the project root~/.edgemem/config.json(global default)
.clauderc:
{
"container": "myproject-team",
"apiKeyEnv": "SUPERMEMORY_API_KEY"
}~/.edgemem/config.json:
{
"container": "myproject-team",
"apiKey": "sm-..."
}Development
pnpm install
pnpm build # compile all packages
pnpm test # run all 167 testsPackage structure
packages/
core/ @edgemem/core — MemClient, guard, cache, audit, chunker
mcp/ @edgemem/mcp — MCP server (5 tools)
cli/ edgemem — CLI (init, sync, read, write, append, grep, list, inject)
examples/
phase1-claudemd/ — file sync example + setup.sh
phase2-mcp/ — .mcp.json + CLAUDE.md instructions
phase3-hook/ — .claude/settings.json + auto-save.shTest coverage
Package | Test files | Tests |
|
| 107 |
|
| 30 |
|
| 30 |
Total | 9 | 167 |
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AnuwatThisuka/edgemem'
If you have feedback or need assistance with the MCP directory API, please join our Discord server