memoryweb: Instructions file for Claude Code

CLAUDE.md

memoryweb CLAUDE.md is an instructions file for Claude Code from corbym/memoryweb. It costs 4,944 tokens per session, scanned A, original, MIT.

A set of instructions for contributing to Memoryweb, a Go server that stores knowledge as connected concepts and decisions. It communicates through JSON-RPC over standard input and output and saves its data in a SQLite file.

In plain words
What is it for?
Use it when changing Memoryweb's database, tools, migrations, or command-line behavior. It guides where to place new store methods and tool handlers and how the long-running server and SQLite storage work.
Why use it?
It explains the repository's package layout and rules for adding code, helping changes fit the existing design. It also highlights important behavior such as append-only database migrations and safe database shutdown and backups.

Instructions file for Claude Code

Written for Claude Code: PreCompact hook event. Also seen: mentions CLAUDE.md; mentions AGENTS.md.

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

Reuse

Borrowing it

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

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 memoryweb CLAUDE.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/corbym/memoryweb/claude-md"><img src="https://agentmods.dev/badge/instructions/corbym/memoryweb/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,944 This file is loaded in full into every session.
When invoked 4,944 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.04944 $0.04944
Opus 5.5 $0.01978 $0.01978
Sonnet 5.5 $0.00989 $0.00989
Haiku 4.5 $0.00494 $0.00494

Measured today against content hash cc7abeeea198, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

memoryweb 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 today.

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 · 377 lines

How it starts

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

@AGENTS.md

CLAUDE.md — coding agent instructions for memoryweb

Read this before touching any file in this repo.


What this repo is

memoryweb is a MCP (Model Context Protocol) server written in Go. It stores knowledge as a graph of nodes (concepts/decisions) connected by typed, narrative edges. It communicates over stdin/stdout using JSON-RPC 2.0.

The binary is long-lived: one process per MCP session. All state lives in a single SQLite file (WAL mode). There is no HTTP server, no daemon — just a loop reading lines from stdin and writing responses to stdout.


Package layout

db/ and tools/ are split by concern, one file per area — not one monolithic file per package. When adding a new Store method or tool handler, put it in the file for its concern; create a new file only for a genuinely new concern.

main.go               JSON-RPC 2.0 wire loop (stdin → dispatch → stdout)

db/store.go           Store type, New/Close (checkpoints WAL on close), Backup (VACUUM INTO snapshot), schema/version/stats queries, init()
db/migrations.go      migration type, the migrations slice, migrate() — append-only, see below
db/embeddings.go      Ollama embedding client, storeEmbedding, BackfillEmbeddings
db/nodes.go           Node struct, AddNode/GetNode/UpdateNode/ArchiveNode/RestoreNode/ListArchived, batch variants
db/edges.go           Edge struct, AddEdge/AddEdgesBatch/DeleteEdge, collectEdges
db/search.go          SearchNodes/SearchNodesExact, LIKE + semantic search paths
db/graph.go           FindPath/FindConnections/GetNodeNeighbourhood/GetDomainGraph, SuggestEdges
db/timeline.go        RecentChanges(Scoped), Timeline, GetHistoryForMemoryID
db/significance.go    GetSignificance and its memory_id/tags variants
db/audit.go           FindDrift/CountStaleDrift/FindDisconnected
db/domains.go         Alias CRUD, RenameDomain, MergeDomains, ListDomains
db/purge.go           Purge — the one hard-delete path; CLI-only, never an MCP tool, kept visually separate
db/util.go            slug(), shortID(), tagFilter, scanNodeRow(s), and the generic helpers below

tools/tools.go        Handler type, CallTool dispatch switch, Instructions const, shared small helpers
tools/definitions.go  ListTools() — the full MCP tool schema
tools/lean.go         Shared lean-entry helpers (leanEntry, toLeanEntry, truncateWhy, ...)
tools/remember.go     remember tool (addNode + batch)
tools/revise.go       revise tool (updateNode + batch)
tools/connect.go      connect/disconnect/suggest_connections
tools/search.go       search tool
tools/recent.go       recentChanges handler (history order=modified path; no MCP tool)
tools/history.go      history tool
tools/significance.go significance tool
tools/orient.go       orient tool (cross-domain snapshot, topic mode, full domain summary)
tools/domains.go      domains tool
tools/archive.go      forget/forget_all, audit tool, drift
tools/graph.go        why_connected, visualise

cmd/                  CLI-only subcommands (not MCP tools)
stats/                WKD session scoring and stats logging

Read the full file on GitHub · 377 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. today Changed · +1 lines · +49 tokens per session cc7abeeea198
  2. 11d ago Changed · +1 lines · +61 tokens per session cda65e49c3e6
  3. 13d ago Changed · +1 lines · +67 tokens per session cd933082bdc8
  4. 14d ago Changed · +1 lines · +90 tokens per session 47254f00d346
  5. 19d ago Changed 0ae078b624d2
  6. 25d ago Changed 5c4f9cb6a170
  7. 27d ago Changed · +1 lines · +61 tokens per session c44f7a50119a
  8. 1mo ago Changed bb049f4416ef
  9. 1mo ago Changed 21d30e6c04b7
  10. 1mo ago First seen · 372 lines · 4,616 tokens per session scan A e00642d5db99

Subscribe to this mod's changes

memoryweb CLAUDE.md is an instructions file published in the GitHub repository corbym/memoryweb (14 stars, last pushed yesterday), licensed MIT. It adds 4,944 tokens to every session, about $0.0198 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.

Related

Other instructions, from other repositories