By leotimus
Read/write protocol and ergonomics for a Graphiti-backed memory MCP. Ships a skill (file-vs-graph rule, write triggers, bi-temporal discipline, token-budget heuristics), /kb-search and /kb-write slash commands, and a PreToolUse hook that blocks add_memory writes to indexer-owned canonical groups.
A Claude Code plugin that wires Claude into a Graphiti-backed knowledge-graph memory MCP and ships the read/write protocol that makes the memory loop tight instead of leaky.
It bundles the MCP connection + the protocol Claude should follow into one installable unit, so memory usage is consistent across machines and projects.
| Piece | Purpose |
|---|---|
.mcp.json | Bundles the memory MCP at ${KB_MEMORY_URL} with bearer auth from ${MEMORY_MCP_TOKEN}. Both are environment variables — nothing host-specific is committed. |
skills/memory-protocol/SKILL.md | The rule-of-thumb Claude follows: file-memory vs graph split, when to read, when to write, bi-temporal triggers, token budget, stale-fact handling. |
commands/kb-search.md | /kb-search <keywords> — guided multi-group search across <project>, <project>-docs, <project>-notes, and team-prefs. |
commands/kb-write.md | /kb-write <type> <body> — structured add_memory to <project>-notes (or team-prefs for cross-project preferences); never to the indexed canonical groups. Checks for contradictions before writing. |
hooks/hooks.json + hooks/guard-add-memory.py | PreToolUse hook on add_memory that blocks writes to indexer-owned groups. Allows *-notes, team-prefs, anything in $KB_WRITE_ALLOWLIST, or no group_id (server falls back to its default); denies the rest with a fix-it message. Fail-open on parse errors. |
KB_MEMORY_URL — the MCP URL (e.g. https://your-graphiti-host/mcp)MEMORY_MCP_TOKEN — bearer token for that endpointKB_WRITE_ALLOWLIST (optional) — comma-separated group IDs the write-guard hook should let through in addition to *-notes / team-prefs. Use it for a deliberate one-off seed of a canonical group.Export both (the allowlist is optional) in your shell — or set them in your Claude env — before starting Claude Code:
export KB_MEMORY_URL=https://your-graphiti-host/mcp
export MEMORY_MCP_TOKEN=... # ask the endpoint owner for a token
This repo doubles as a single-plugin marketplace (.claude-plugin/marketplace.json):
# from a marketplace
/plugin marketplace add leotimus/kb-alms
/plugin install kb-memory@kb-alms
# or from a local checkout
git clone https://github.com/leotimus/kb-alms.git
/plugin marketplace add ./kb-alms
/plugin install kb-memory@kb-alms
Verify the MCP is connected:
/mcp
You should see memory listed.
Skill + commands + one hook: the add_memory write-guard above. It's deliberately the only hook so far — it enforces a hard, well-settled rule (never write the indexer-owned groups) rather than nudging behaviour, and it fails open. Still on the follow-up list: a UserPromptSubmit keyword reminder and a Stop write-suggestion (both are nudges, not invariants, so they wait until the conventions around them settle).
The hook is the fast-feedback layer — it only protects sessions that have this plugin installed. The durable wall is server-side: the Graphiti MCP image in alms-memory makes add_memory closed by default (GRAPHITI_WRITE_GUARD=notes-only) — only -notes groups and GRAPHITI_WRITE_ALLOWLIST entries are accepted, for every client. Run both.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub leotimus/kb-alms --plugin kb-memoryPermanent coding companion for Claude Code — survives any update. MCP-based terminal pet with ASCII art, stats, reactions, and personality.
Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.
Comprehensive skill pack with 66 specialized skills for full-stack developers: 12 language experts (Python, TypeScript, Go, Rust, C++, Swift, Kotlin, C#, PHP, Java, SQL, JavaScript), 10 backend frameworks, 6 frontend/mobile, plus infrastructure, DevOps, security, and testing. Features progressive disclosure architecture for 50% faster loading.
Comprehensive startup business analysis with market sizing (TAM/SAM/SOM), financial modeling, team planning, and strategic research
v9.44.1 — Patch release for Gemini environment/version detection and qwen auth gating. Run /octo:setup.
Complete creative writing suite with 10 specialized agents covering the full writing process: research gathering, character development, story architecture, world-building, dialogue coaching, editing/review, outlining, content strategy, believability auditing, and prose style/voice analysis. Includes genre-specific guides, templates, and quality checklists.