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

Multi-operator Claude Code: Hub-based architecture for multi-agent sessions
A hub-based setup for Claude Code enables multiple people to attach to the same session, route subtasks across repos, and run headless agents in Docker containers.

HolyCode: Docker Container for Persistent Claude AI Coding Environments
HolyCode is a Docker container that maintains AI coding environment state across machine switches and rebuilds. It includes 30+ preinstalled tools, browser automation with Chromium + xvfb + Playwright, and preserves context in ./data/opencode.

Qwen 3.5 Chat Template Release with 21 Bug Fixes for Agent Workflows
A developer has released a fixed chat template for Qwen 3.5 models, addressing 21 bugs including tool calling crashes, parallel call separation, and agent loop stability. It's a drop-in replacement tested on llama.cpp, Open WebUI, vLLM, and other platforms.

Selfware: Rust-based local AI agent framework with PDVR architecture
Selfware is an open-source AI agent framework built in Rust for local inference, implementing a PDVR cognitive cycle with 54 built-in tools and designed for long-running tasks on consumer hardware.