claude-memory: Instructions file for Claude Code

CLAUDE.md

claude-memory CLAUDE.md is an instructions file for Claude Code from AmmarJawad/claude-memory. It costs 1,662 tokens per session, scanned A, original, MIT.

Project instructions for claude-memory, an MCP server that stores information across Claude Code restarts and context-window limits. They describe installation, testing, project synchronization, and the rule that the server stores and returns data while Claude Code performs the reasoning.

In plain words
What is it for?
Use them when working on the claude-memory repository. They cover dependency installation, running the server, interactive tool tests, automated tests, and project synchronization.
Why use it?
They help coding agents preserve useful context and follow the repository's intended architecture and test process.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

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

Reuse

Borrowing it

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

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 claude-memory CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ammarjawad/claude-memory/claude-md.svg)](https://agentmods.dev/instructions/ammarjawad/claude-memory/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/ammarjawad/claude-memory/claude-md"><img src="https://agentmods.dev/badge/instructions/ammarjawad/claude-memory/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,662 This file is loaded in full into every session.
When invoked 1,662 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.01662 $0.01662
Opus 5 $0.00831 $0.00831
Sonnet 5 $0.00332 $0.00332
Haiku 4.5 $0.00166 $0.00166

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

Security

Grade A, and why

claude-memory 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 · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 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.

Overview

claude-memory — an MCP server (server.py + context_bridge/ package) that gives Claude Code persistent memory across terminal restarts and context-window compaction, targeted access to relevant claude.ai conversations, and bidirectional sync with claude.ai Projects.

Commands

# Install dependencies
pip install -r requirements.txt

# Run the server directly (smoke-test)
python3 server.py

# Test tools interactively
python3 -m mcp dev server.py

# Run all tests
pytest test_server.py tests/ -v

# Run project sync CLI
python -m context_bridge --auto

Core server is server.py. Project sync lives in context_bridge/ package. Tests in test_server.py (local storage) and tests/ (project sync).

Hard constraint — no LLM inference in server.py

server.py must never import anthropic or call any inference API. All summarisation and reasoning is performed by Claude Code itself (subscription), not programmatic API calls. The server is a dumb data layer: fetch, store, return raw content. Claude Code does the thinking.

Architecture

Three independent feature areas share server.py.

1. Local storage tools — no network, no Chrome required

Storage root: ~/.claude-memory/

~/.claude-memory/
├── sessions/    {project_name}_{sha1[:8]}_{YYYYMMDDTHHMMSSZ}_{id8}.json
├── images/      {image_id12}.{ext}  +  {image_id12}.json (metadata)
├── projects/    {project_key}.json  (conversation registry, includes project_path)
└── summaries/   {conversation_id}.json  (cached conversation summaries)

Private helpers (shared across tools):

  • _storage(subdir) — mkdir + return Path under ~/.claude-memory/
  • _project_key(path){dirname}_{sha1[:8]}, stable and filesystem-safe
  • _load_registry(pk) / _save_registry(pk, reg) — read/write projects/{pk}.json
  • _get_latest_checkpoint(project_path) — returns checkpoint dict or {"found": False}; used by both resume_session and get_latest_session_checkpoint
  • _get_linked_conversations(project_key) — returns conversations list from registry; used by both resume_session and get_project_conversations
  • _fetch_and_cache_summary(conv_id, refresh) — fetch from cache or API, always caches result; used by get_conversation_summary and link_conversation auto-note generation; raises RuntimeError on API failure

Read the full file on GitHub · 127 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 · 127 lines · 1,662 tokens per session scan A b0d1a6fc306b

Subscribe to this mod's changes

claude-memory CLAUDE.md is an instructions file published in the GitHub repository AmmarJawad/claude-memory (1 stars, last pushed 5mo ago), licensed MIT. It adds 1,662 tokens to every session, about $0.0083 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

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

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

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

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

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