graph-mem: Instructions file for Claude Code

CLAUDE.md

graph-mem CLAUDE.md is an instructions file for Claude Code from quequiere/graph-mem. It costs 2,842 tokens per session, scanned B, original, Apache-2.0.

A project instruction file for graph-mem, a local Claude Code plugin that stores project knowledge as a connected graph instead of a simple list of notes. It describes the Python server, databases, language-model service, and development commands.

In plain words
What is it for?
Use it when developing, running, or debugging graph-mem, its graph database, its Graphiti service, its OpenRouter connection, or its Docker setup.
Why use it?
It gives coding agents the system context needed to work safely on a multi-service project. The architecture and setup details reduce confusion about how the parts communicate.

Instructions file for Claude Code

Written for Claude Code: SessionStart hook event. Also seen: reads .claude/ paths; mentions Claude Code.

This is quequiere/graph-mem's own configuration. It tells Claude Code how to work on graph-mem 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 graph-mem configures →

Reuse

Borrowing it

Nothing to install: this file belongs to quequiere/graph-mem. 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/quequiere/graph-mem/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/quequiere/graph-mem

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 graph-mem CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/quequiere/graph-mem/claude-md/github.svg)](https://agentmods.dev/instructions/quequiere/graph-mem/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/quequiere/graph-mem/claude-md"><img src="https://agentmods.dev/badge/instructions/quequiere/graph-mem/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.

agentmods 80×15 button for graph-mem CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/quequiere/graph-mem/claude-md"><img src="https://agentmods.dev/badge/instructions/quequiere/graph-mem/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,842 This file is loaded in full into every session.
When invoked 2,842 The same file — it is already loaded in full.
Security scan B 1 finding. 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.02842 $0.02842
Opus 5.5 $0.01137 $0.01137
Sonnet 5.5 $0.00568 $0.00568
Haiku 4.5 $0.00284 $0.00284

Measured 2mo ago against content hash 1cc96d74cd0a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

graph-mem CLAUDE.md scanned grade B with 1 finding 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 2mo 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Configured in `~/.claude/settings.json`:
CLAUDE.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

graph-mem - Project Tracking

Project Overview

graph-mem is a Claude Code plugin that provides persistent, intelligent memory using Graphiti's knowledge graph. Unlike flat memory stores, it leverages entity relationships, temporal awareness, and semantic search to build a rich understanding of the developer over time.

Current Status

Working end-to-end on branch feat/openrouter-graphiti-patch. Stack: Neo4j 5.26 + patched Graphiti + OpenRouter (gemma-4-26b + qwen3-embedding-8b).

Design Spec

Full design document: .docs/specs/2026-04-05-graph-mem-design.md

Architecture

Claude Code (stdio) → graph-mem MCP server (Python, local)
                          → Graphiti REST API (Docker, httpx over HTTP)
                              → Neo4j 5.26 (Docker)
                              → OpenRouter API (LLM + embeddings)
  • Language: Python, installed via pip install -e .
  • No graphiti_core dependency: pure REST/HTTP client
  • LLM backend: OpenRouter (configurable via .env)
  • Embeddings: qwen/qwen3-embedding-8b (4096 native, truncated to 1024 client-side)

Docker Stack

docker compose up -d --build   # from project root

Requires .env with OPENROUTER_API_KEY. See docker-compose.yml.

Patched files in graphiti/:

  • zep_graphiti.py — ExampleLLMClient (fixes schema echoing for Gemma/Qwen/Llama), configures embedder + cross-encoder from env vars
  • ingest.py — AsyncWorker catches exceptions instead of dying silently (upstream bug)
  • Dockerfile — extends zepai/graphiti:latest with patches

MCP Tools (current — minimal surface)

Only 3 tools exposed to keep model attention focused:

Tool Purpose
__IMPORTANT__graph_mem Workflow reminder — tells model how to use graph-mem
save_memory(content, scope) Save info. scope="user" or "project"
search_memory(query, scope) Search. scope="all", "user", or "project"

scope replaces the old group_id parameter — the server computes the correct group_id automatically from cwd's git remote URL. This prevents the model from inventing group_ids.

Read the full file on GitHub · 228 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. 2mo ago First seen · 228 lines · 2,842 tokens per session scan B 1cc96d74cd0a

Subscribe to this mod's changes

graph-mem CLAUDE.md is an instructions file published in the GitHub repository quequiere/graph-mem (5 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 2,842 tokens to every session, about $0.0114 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

graph-mem CLAUDE.md compared with instructions from other repositories

graph-mem CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
graph-mem CLAUDE.mdquequiere/graph-memInstructions file56mo agoApache-2.0B2,842Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode