Borrowing it
Nothing to install: this file belongs to elvismdev/mem0-mcp-selfhosted. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/elvismdev/mem0-mcp-selfhosted/main/CLAUDE.mdgit clone --depth 1 https://github.com/elvismdev/mem0-mcp-selfhostedWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/elvismdev/mem0-mcp-selfhosted/claude-md)<a href="https://agentmods.dev/instructions/elvismdev/mem0-mcp-selfhosted/claude-md"><img src="https://agentmods.dev/badge/instructions/elvismdev/mem0-mcp-selfhosted/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/elvismdev/mem0-mcp-selfhosted/claude-md"><img src="https://agentmods.dev/badge/instructions/elvismdev/mem0-mcp-selfhosted/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00865 | $0.00865 |
| Opus 5.5 | $0.00346 | $0.00346 |
| Sonnet 5.5 | $0.00173 | $0.00173 |
| Haiku 4.5 | $0.00086 | $0.00086 |
Grade A, and why
mem0-mcp-selfhosted CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 43 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code when working with code in this repository.
MCP Servers
- mem0: Persistent memory across sessions. At the start of each session,
search_memoriesfor relevant context before asking the user to re-explain anything. Useadd_memorywhenever you discover project architecture, coding conventions, debugging insights, key decisions, or user preferences. Useupdate_memorywhen prior context changes. Save information like: "This project uses PostgreSQL with Prisma", "Tests run with pytest -v", "Auth uses JWT validated in middleware". When in doubt, save it — future sessions benefit from over-remembering.
Build & Test Commands
pip install -e ".[dev]" # Install with dev dependencies
python3 -m pytest tests/unit/ -v # Unit tests (mocked, no infra needed)
python3 -m pytest tests/contract/ -v # Contract tests (validates mem0ai internals)
python3 -m pytest tests/integration/ -v # Integration tests (requires live Qdrant + Neo4j + Ollama)
python3 -m pytest tests/ -v # All tests
python3 -m pytest tests/ -m "not integration" -v # Skip integration
python3 -m pytest tests/unit/test_auth.py::TestIsOatToken -v # Single test class
python3 -m pytest tests/unit/test_auth.py::TestIsOatToken::test_oat_token_detected -v # Single test
Architecture
Self-hosted MCP server using mem0ai as a library. 11 tools (9 memory + 2 graph), FastMCP orchestrator.
Module roles:
server.py— FastMCP orchestrator, registers all tools +memory_assistantpromptconfig.py— Env vars → mem0aiMemoryConfigdict, handles all 5 graph LLM provider configsauth.py— 3-tier token fallback:MEM0_ANTHROPIC_TOKEN→~/.claude/.credentials.json→ANTHROPIC_API_KEYllm_anthropic.py— Custom Anthropic provider registered with mem0ai'sLlmFactory; handles OAT headers, structured outputs (JSON schema viaoutput_config), and tool-call parsingllm_router.py—SplitModelGraphLLMroutes by tool name: extraction tools → Gemini, contradiction tools → Claudehelpers.py—_mem0_call()error wrapper,call_with_graph()threading lock for per-call graph toggle,safe_bulk_delete()iterates+deletes individually (never callsmemory.delete_all()),patch_graph_sanitizer()monkey-patches mem0ai's relationship sanitizer for Neo4j compliancegraph_tools.py— Direct Neo4j Cypher queries with lazy driver init__init__.py— Suppresses mem0ai telemetry before any imports
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 43 lines · 865 tokens per session scan A e5731251948b
mem0-mcp-selfhosted CLAUDE.md is an instructions file published in the GitHub repository elvismdev/mem0-mcp-selfhosted (112 stars, last pushed 7mo ago), licensed MIT. It adds 865 tokens to every session, about $0.0035 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
vscode model-prompts.instructions.md
Model-specific prompt authoring and registry guidelines.