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

CloudRouter Empowers AI Coding Agents with VM and GPU Management
CloudRouter introduces a CLI tool that allows AI coding agents to autonomously spin up cloud VMs and GPUs, automating tasks like browser verification and GPU-intensive workloads.

Claude-IDE-Bridge Now Works on Remote Servers for AI-Assisted Development
The Claude-IDE-Bridge tool now connects Claude AI to remote development environments on VPS or cloud machines, allowing access to live diagnostics, open files, and test failures from any device.

Microsoft Teams SDK Adds HTTP Server Adapter for Existing AI Agents
The Microsoft Teams SDK now includes an HTTP server adapter that lets developers connect existing AI agents to Teams without rewriting their code. It works with LangChain chains, Slack bots, and Azure Foundry deployments by injecting a POST /api/messages endpoint into existing Express servers.
WorldClaw: Agentic 3D Open-World Generation at Scale
Tencent's WorldClaw is a new system for agentic 3D open-world generation at scale, aiming to create large, detailed virtual environments.