Mneme: A PreToolUse Hook That Blocks Claude Code Edits Violating Architecture Decisions

Marcus Dillavou built Mneme, a PreToolUse hook that intercepts Claude Code edits and checks them against a recorded architecture decisions file before they hit disk. The goal: prevent banned libraries, rejected patterns, and forgotten conventions from reappearing in new files.
Installation
pip install mneme python scripts/install_claude_code.py
This writes the hook entry into .claude/settings.json and installs four slash commands:
/mneme-check— run a violation check/mneme-context— pull context for current file/mneme-record— record a new decision/mneme-review— review existing decisions
How It Works
When Claude attempts an edit, Mneme compares the operation against keyword-indexed decisions. If a violation is detected, the hook blocks the operation and returns the decision ID as feedback. Claude sees the restriction, understands why, and adjusts its output — no manual override needed.
The hook fails open: if Mneme isn't on PATH or times out, it exits 0 and Claude Code proceeds normally. It only blocks when mneme check actually returns a violation verdict.
Edge Cases
Retrieval is keyword-based, so scope of decisions matters. The author is actively looking for real-world feedback on whether the hook fires correctly in production projects.
📖 Read the full source: r/ClaudeAI
👀 See Also

MCP Marketplace Launches Security-Scanned Directory of 1,900+ MCP Tool Plugins
MCP Marketplace (mcp-marketplace.io) provides a security-focused directory of 1,900+ MCP servers with multi-layer security analysis, risk scoring, and one-click installation for Claude Desktop, Cursor, ChatGPT, and VS Code.

Introducing Swarmhook: Free and Open Source Webhooks for Your Bot
Swarmhook.com offers free and open source webhooks to effectively manage events for your bots, streamlining automation and response capabilities.

Claude Counter: Android app tracks Claude usage limits with real-time notifications
A developer built Claude Counter, a free Android app that polls Claude's API to display live session and weekly usage limits. The app shows progress bars, provides rich notifications with percentage remaining, and alerts when limits reset.

ToolLoop: Open-Source Agent Framework for Claude-Style Tools with Any Model
ToolLoop is an open-source Python framework with 11 tools for file operations, code search, shell access, and sub-agents that works with any LLM through LiteLLM. The 2,700-line framework allows switching models mid-conversation with shared context.