project-mem-mcp: Instructions file for Claude Code

CLAUDE.md

project-mem-mcp CLAUDE.md is an instructions file for Claude Code from wallneradam/project-mem-mcp. It costs 4,693 tokens per session, scanned A, original, MIT.

Instructions for developing project-mem-mcp, an MCP server and Claude Code plugin that stores persistent project memory in MEMORY.md files. MCP is a way for an agent to call tools provided by another program.

In plain words
What is it for?
Setting up and running the server, reading or searching project memory, changing memory entries, and installing the plugin in Claude Code.
Why use it?
It tells contributors how the project is structured, installed, run, and how its memory tools work.

Instructions file for Claude Code

Written for Claude Code: SessionStart hook event. Also seen: mentions CLAUDE.md; mentions subagents; mentions Claude Code.

This is wallneradam/project-mem-mcp's own configuration. It tells Claude Code how to work on project-mem-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything project-mem-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to wallneradam/project-mem-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/wallneradam/project-mem-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/wallneradam/project-mem-mcp

Made for: Claude Code.

Wrote 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.

agentmods badge for project-mem-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/wallneradam/project-mem-mcp/claude-md.svg)](https://agentmods.dev/instructions/wallneradam/project-mem-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/wallneradam/project-mem-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/wallneradam/project-mem-mcp/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 4,693 This file is loaded in full into every session.
When invoked 4,693 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.04693 $0.04693
Opus 5 $0.02346 $0.02346
Sonnet 5 $0.00939 $0.00939
Haiku 4.5 $0.00469 $0.00469

Measured 6d ago against content hash 8eb925a619d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

project-mem-mcp 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 6d 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.

CLAUDE.md · 120 lines

How it starts

The opening of the file, as written. The whole thing — 120 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 (claude.ai/code) when working with code in this repository.

Project Overview

An MCP server + Claude Code plugin that manages persistent project memory files (MEMORY.md) for AI agents. Built with FastMCP 3.x and Python 3.11+.

The MCP server lives in src/project_mem_mcp/server.py. The plugin layer adds auto-read hooks and a dream (consolidation) system.

Development Commands

# Setup
python -m venv venv
source venv/bin/activate
pip install -e .

# Run the server locally
project-mem-mcp
project-mem-mcp --allowed-dir /path/to/projects

# Run without installation (via uvx)
uvx project-mem-mcp

# Plugin installation (in Claude Code)
# /plugin marketplace add /path/to/project-mem-mcp
# /plugin install project-mem@cc-plugin-project-mem

There are no tests or linting configured in this project.

Architecture

MCP Server (src/project_mem_mcp/server.py)

Four MCP tools:

Tool Purpose
get_project_memory Read MEMORY.md — full file, head_only TOC, or offset/limit chunk
search_project_memory Substring search; returns matching lines with 1-indexed line numbers
set_project_memory Overwrite the entire MEMORY.md
update_project_memory Apply a single SEARCH/REPLACE patch to MEMORY.md

Security model: Project paths are validated against --allowed-dir arguments. If none are provided, the server defaults to the current working directory.

Patch format: update_project_memory uses a custom SEARCH/REPLACE block format (not unified diff). The search text must appear exactly once in the file; non-unique matches raise ValueError. Only one block per call is allowed.

File-sourced full rewrite (since 0.4.13): set_project_memory accepts the new content from exactly one of two sources — project_info (literal Markdown text) or project_info_file (absolute path to a UTF-8 file the server reads itself). The file path form exists because the consolidator drafts the shrunk memory in a scratchpad file anyway (to iterate and measure size); handing over the path avoids re-emitting tens of KB as a tool parameter, making the dream writeback near-zero output. Validation: absolute path, regular file, valid UTF-8, non-empty (an empty draft would blank the memory — rejected). The path is deliberately NOT restricted to --allowed-dir (the draft lives in a session scratchpad outside the project); the server runs locally with the agent's own privileges, so this adds no access the agent lacks.

Read the full file on GitHub · 120 lines

Changes

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.

  1. 6d ago First seen · 120 lines · 4,693 tokens per session scan A 8eb925a619d7

Subscribe to this mod's changes

project-mem-mcp CLAUDE.md is an instructions file published in the GitHub repository wallneradam/project-mem-mcp (2 stars, last pushed 18d ago), licensed MIT. It adds 4,693 tokens to every session, about $0.0235 per session on Opus 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-31.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

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).

microsoft/vscode · 6,785 tokens

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.

vercel/next.js · 7,296 tokens

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.

langchain-ai/langchain · 4,469 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens