Implements pre-commit hooks that enforce memory discipline by blocking commits when decisions lack recorded outcomes or when modifying files with known failed approaches.
Uses SQLite for persistent storage of memories, decisions, rules, and metadata alongside vector embeddings.
Daem0nMCP
AI Memory & Decision System - Give AI agents persistent memory and consistent decision-making with actual semantic understanding.
What's New in v2.16.0
Sacred Covenant Enforcement
The Sacred Covenant is now enforced, not just advisory:
requires_communion: Tools block withCOMMUNION_REQUIREDuntilget_briefing()is calledrequires_counsel: Mutating tools block withCOUNSEL_REQUIREDuntilcontext_check()is calledPreflight tokens:
context_check()returns a cryptographic token valid for 5 minutesRemedies: Each block includes the exact tool call needed to fix it
Affected tools:
Communion required:
remember,remember_batch,add_rule,update_rule,record_outcome,link_memories,pin_memory,archive_memory,prune_memories,cleanup_memories,compact_memoriesExempt (read-only):
recall,recall_for_file,search_memories,find_code,analyze_impact,check_rules,list_rules
MCP Resources (Dynamic Context Injection)
Resources that Claude Desktop/Code can subscribe to for automatic context:
Resource URI | Content |
| All active warnings |
| Failed approaches to avoid |
| All configured rules |
| Combined context (warnings + failed + rules) |
| Auto-recalled context for a file |
Claude Code 2.1.3 Compatibility
Fixed
daem0n_pre_edit_hook.pyto use MCP HTTP instead of removedcheck-triggersCLI commandHooks now communicate directly with MCP server for context triggers
What's New in v2.15.0
Iteration 1: Search Quality
Configurable hybrid weight:
DAEM0NMCP_HYBRID_VECTOR_WEIGHT(0.0-1.0)Result diversity:
DAEM0NMCP_SEARCH_DIVERSITY_MAX_PER_FILElimits same-file resultsTag inference: Auto-adds
bugfix,tech-debt,perf,warningtags
Iteration 2: Code Entity Fidelity
Qualified names: Entities have
module.Class.methodidentifiersStable IDs: Line changes don't invalidate entity IDs
Import extraction: Files track their imports for dependency analysis
Iteration 3: Incremental Indexing
File hash tracking: Only re-parses changed files
index_file_if_changed(): Efficient single-file re-indexingFileHash model: Persists content hashes
Iteration 4: Performance & UX
Parse tree caching: Avoids re-parsing unchanged files
Extended config:
embedding_model,parse_tree_cache_maxsizeEnhanced health: Code index stats, staleness detection
What's New in v2.14.0
Active Working Context (MemGPT-style)
Always-hot memory layer that keeps critical information front and center:
set_active_context(memory_id)- Pin critical memories to active contextget_active_context()- Get all hot memories for current focusremove_from_active_context(memory_id)- Remove from hot contextclear_active_context()- Clear all hot memoriesAuto-included in
get_briefing()responsesFailed decisions auto-activate with high priority
Max 10 items to prevent context bloat
Temporal Versioning
Track how memories evolve over time:
Auto-creates versions on memory creation, outcome recording, relationship changes
get_memory_versions(memory_id)- Get full version historyget_memory_at_time(memory_id, timestamp)- Query historical stateEnables questions like "What did we believe about X last month?"
Hierarchical Summarization
GraphRAG-style community detection and layered recall:
rebuild_communities()- Detect clusters by tag co-occurrencelist_communities()- Get summaries for high-level overviewget_community_details(id)- Drill down to member memoriesrecall_hierarchical(topic)- Layered retrieval: summaries then detailsAuto-generated community names from dominant tags
Auto Entity Extraction (Cognee-style)
Auto-extract and link code entities from memory content:
Auto-extracts functions, classes, files, concepts from memories on
remember()recall_by_entity(name)- Get all memories mentioning an entitylist_entities()- Most frequently mentioned entitiesbackfill_entities()- Extract entities from existing memoriesEnables queries like "show everything about UserService"
Contextual Recall Triggers (Knowledge Graph MCP-style)
Auto-recall memories without explicit calls based on context patterns:
add_context_trigger(pattern, topic)- Define auto-recall rulescheck_context_triggers(file_path)- Get triggered contextlist_context_triggers()/remove_context_trigger(id)Supports file patterns, tag matching, entity matching
Integrated with pre-edit hooks for automatic injection
MCP Resource:
daem0n://triggered/{file_path}
What's New in v2.13.0
Passive Capture (Auto-Remember): Memories without manual calls
Pre-edit hook: Auto-recalls memories for files being modified
Post-edit hook: Suggests remember() for significant changes
Stop hook: Auto-extracts decisions from Claude's responses
CLI
remembercommand for hook integrationSee
hooks/settings.json.examplefor configuration
What's New in v2.12.0
Endless Mode (Context Compression): Reduce token usage by 50-75%
recall(topic, condensed=True)- Returns compressed memoriesStrips rationale, context fields; truncates content to 150 chars
Focus areas in briefings use condensed mode automatically
Inspired by memvid-mind's token efficiency approach
What's New in v2.11.0
Linked Projects (Multi-Repo Support): Work across related repositories
Link client/server or other related repos for cross-awareness
link_projects()/unlink_projects()/list_linked_projects()recall(include_linked=True)- Search across linked reposconsolidate_linked_databases()- Merge child DBs into unified parentget_briefing()now shows linked project warnings/statsSee
docs/multi-repo-setup.mdfor full guideNew skill:
summon_daem0nfor project setup guidance
Previous Features (v2.10.0)
Code Understanding Layer (Phase 2): The Daem0n now understands your code structure
Multi-language AST parsing via
tree-sitter-language-packSupports: Python, TypeScript, JavaScript, Go, Rust, Java, C, C++, C#, Ruby, PHP
Extracts: classes, functions, methods, signatures, docstrings
New MCP tools:
index_project- Index code entities for understandingfind_code- Semantic search across code entitiesanalyze_impact- Analyze what changing an entity would affect
CLI:
python -m daem0nmcp.cli indexNew models:
CodeEntity,MemoryCodeRef
Previous Features (v2.9.0)
Qdrant Vector Backend (Phase 0): Persistent vector storage replaces SQLite blob storage
Qdrant local mode (file-based, no server required)
Hybrid search: TF-IDF + vector similarity (0.3 weight)
Migration script:
python -m daem0nmcp.migrations.migrate_vectors
Proactive File Watcher (Phase 1): The Daem0n now watches your files proactively
Monitors file changes and notifies when files with associated memories are modified
Multi-channel notifications:
System notifications: Desktop alerts via
plyerLog file: JSON-lines at
.daem0nmcp/storage/watcher.logEditor poll: JSON at
.daem0nmcp/storage/editor-poll.jsonfor IDE plugins
Start with:
python -m daem0nmcp.cli watchConfigurable debouncing, skip patterns, extension filters
Previous Features (v2.8.0)
Automatic Tool Reminders (Stop Hook): Claude Code hooks that detect task completion and remind to record outcomes
Enhanced SessionStart Hook: Now reminds to commune with
get_briefing()at session startHook Scripts: New
hooks/directory with reusable Python scripts for Claude Code integration
Previous Features (v2.7.0)
Pre-Commit Enforcement: Git hooks that actually block commits when memory discipline is broken
Blocks commits with decisions >24h old that lack recorded outcomes
Blocks commits modifying files with known failed approaches
Warns on recent pending decisions and file warnings
CLI Resolution Tools: New commands to resolve blocking issues
status- Show pending decisions and what's blockingrecord-outcome- Record outcomes directly from CLIinstall-hooks/uninstall-hooks- Manage git hooks
Automatic Session Tracking:
remember()now auto-tracks decisions as pending
Previous Features (v2.6.0)
Enhanced Bootstrap: First-run context collection extracts 7 memory categories automatically
Smarter Session Start:
get_briefing()reports exactly what was ingested
Previous Features (v2.5.0)
Windows HTTP Transport: Full Windows support via streamable-http (bypasses stdio bugs)
Ritual-Themed Installation:
Summon_Daem0n.mdandBanish_Daem0n.mdfor funClaude Code Hooks: Auto-reminders to use memory tools
Protocol Skill:
daem0nmcp-protocolskill for Superpowers users
Core Features (v2.1+)
TF-IDF Semantic Search: Real similarity matching, not just keyword overlap
Memory Decay: Recent memories weighted higher than old ones
Conflict Detection: Warns when new decisions contradict past failures
Failed Decision Boosting: Past mistakes surface prominently in recalls
File-Level Memories: Associate memories with specific files
Vector Embeddings: sentence-transformers for enhanced semantic matching
Why Daem0nMCP?
AI agents start each session fresh. They don't remember:
What decisions were made and why
Patterns that should be followed
Warnings from past mistakes
Markdown files don't solve this - the AI has to know to read them and might ignore them.
Daem0nMCP provides ACTIVE memory - it surfaces relevant context when the AI asks about a topic, enforces rules before actions, and learns from outcomes.
What Makes This Different
Unlike keyword-based systems:
Semantic matching: "creating REST endpoint" matches rules about "adding API route"
Time decay: A decision from yesterday matters more than one from 6 months ago
Conflict warnings: "You tried this approach before and it failed"
Learning loops: Record outcomes, and failures get boosted in future recalls
Quick Start
The Easy Way (Recommended)
Copy
Summon_Daem0n.mdto your projectStart a Claude Code session in that project
Claude will read the file and perform the summoning ritual automatically
Manual Installation
Installation by Platform
Linux / macOS (stdio transport)
Windows (HTTP transport required)
Windows has a known bug where Python MCP servers using stdio transport hang indefinitely. Use HTTP transport instead:
Start the server (keep this terminal open):
Or use start_daem0nmcp_server.bat
Add to :
Start Claude Code (after server is running)
Core Tools (42 Total)
Memory Tools
Tool | Purpose |
| Store a memory with conflict detection |
| Store multiple memories efficiently in one transaction |
| Semantic memory retrieval by topic (supports |
| Get memories linked to a specific file |
| Search across all memories |
| Discover connected memories |
| Track if a decision worked or failed |
| Pin memories to prevent pruning and boost relevance |
| Hide memories from recall while preserving history |
| Consolidate old episodic memories into summaries |
| Get full version history for a memory |
| Query historical state of a memory at a specific time |
Rule Tools
Tool | Purpose |
| Create decision tree nodes |
| Semantic rule matching |
| Modify existing rules |
| Show all configured rules |
Session & Context Tools
Tool | Purpose |
| Smart session start with git awareness |
| Combined recall + rules in one call |
| Pin memory to active working context |
| Get all hot memories for current focus |
| Remove memory from active context |
| Clear all hot memories |
Graph Memory Tools
Tool | Purpose |
| Create causal relationships between memories |
| Remove relationships between memories |
| Traverse memory graph (forward/backward) |
| Visualize memory relationships (JSON or Mermaid) |
Hierarchical Summarization Tools
Tool | Purpose |
| Detect memory clusters by tag co-occurrence |
| Get community summaries for high-level overview |
| Drill down to member memories in a community |
| Layered retrieval: community summaries then details |
Code Understanding Tools
Tool | Purpose |
| Index code entities (classes, functions, methods) |
| Semantic search across code entities |
| Analyze what changing an entity would affect |
Utility Tools
Tool | Purpose |
| Find TODO/FIXME/HACK comments |
| Get refactoring context for a file |
| Import external documentation |
Maintenance Tools
Tool | Purpose |
| Force rebuild TF-IDF and vector indexes |
| Export all memories and rules as JSON |
| Import memories and rules from JSON |
| Remove old, low-value memories (with protection) |
| Find and merge duplicate memories |
| Get server health, version, and statistics |
Usage Examples
Store a Memory
Retrieve Memories
Create Rules
Track Outcomes
Session Start
Endless Mode (Token Compression)
Import External Docs
AI Agent Protocol
The recommended workflow for AI agents:
See Summon_Daem0n.md for the complete protocol (with ritual theme for fun).
Claude Code Integration
Hooks (Auto-Reminders)
Add to .claude/settings.json:
Passive Capture Hooks
For fully automatic memory capture, enable all hooks in .claude/settings.json:
What each hook does:
Pre-edit: Shows warnings, patterns, and past decisions for files before you modify them
Post-edit: Suggests calling
remember()when you make significant changesStop: Auto-extracts decisions from Claude's responses and creates memories
Protocol Skill
For Superpowers users, a skill is included at .claude/skills/daem0nmcp-protocol/SKILL.md that enforces the memory protocol.
How It Works
TF-IDF Similarity
Instead of simple keyword matching, Daem0nMCP builds TF-IDF vectors for all stored memories and queries. This means:
"authentication" matches memories about "auth", "login", "OAuth"
Rare terms (like project-specific names) get higher weight
Common words are automatically de-emphasized
Memory Decay
Default half-life is 30 days. A 60-day-old memory has ~25% weight. Patterns and warnings are permanent (no decay).
Conflict Detection
When storing a new memory, it's compared against recent memories:
If similar content failed before → warning about the failure
If it matches an existing warning → warning surfaced
If highly similar content exists → potential duplicate flagged
Failed Decision Boosting
Memories with worked=False get a 1.5x relevance boost in recalls.
Warnings get a 1.2x boost. This ensures past mistakes surface prominently.
Data Storage
Each project gets isolated storage at:
Legacy Migration
If upgrading from DevilMCP, data is automatically migrated from .devilmcp/ to .daem0nmcp/.
Configuration
Environment variables (prefix: DAEM0NMCP_):
Variable | Default | Description |
|
| Project root path |
| auto | Override storage location |
|
| Logging level |
Architecture
CLI Commands
Enforcement Commands
All commands support --json for machine-readable output and --project-path to specify the project root.
Upgrading
Upgrading Daem0n-MCP is straightforward:
1. Update the Code
Important: The pip install -e . step is required to install all dependencies:
qdrant-client- Vector database for semantic searchwatchdog- File watching for proactive notificationsplyer- Desktop notificationstree-sitter-language-pack- Multi-language code parsing (Python 3.14 compatible)
All dependencies are required for full functionality.
2. Restart Claude Code
After updating, restart Claude Code to load the new MCP tools.
3. Migrations Run Automatically
Database migrations are applied automatically when any MCP tool runs. The first time you use get_briefing(), remember(), or any other tool after upgrading, the database schema is updated.
No manual migration step required.
4. Install Enforcement Hooks
Pre-commit hooks block commits when decisions lack outcomes:
5. Index Your Codebase
Enable code understanding by indexing your project:
This parses your code with tree-sitter (supports Python, TypeScript, JavaScript, Go, Rust, Java, C, C++, C#, Ruby, PHP) and enables semantic code search via find_code() and impact analysis via analyze_impact().
Troubleshooting
MCP Tools Not Available in Claude Session
Symptom: claude mcp list shows daem0nmcp connected, but Claude can't use mcp__daem0nmcp__* tools.
Cause: Known Claude Code bug (#2682) where MCP tools are discovered but not injected into Claude's toolbox.
Fixes:
Start server before Claude Code:
# Terminal 1: Start Daem0n server first python ~/Daem0nMCP/start_server.py --port 9876 # Wait for "Uvicorn running on http://localhost:9876" # Terminal 2: Then start Claude Code claudeRe-register the server:
claude mcp remove daem0nmcp -s user claude mcp add daem0nmcp http://localhost:9876/mcp -s userVerify tools are available:
Claude should show
mcp__daem0nmcp__*tools in its toolboxIf Claude tries
claude mcp callbash commands instead, the tools aren't injected
Hooks Not Firing
Symptom: Pre-edit hooks don't show Daem0n context.
Check:
MCP server running:
curl http://localhost:9876/mcpshould respondHooks configured in
.claude/settings.jsonProject has
.daem0nmcp/directory
Development
Support
If Daem0nMCP has been useful to you, consider supporting its development:
Uninstallation
See Banish_Daem0n.md for complete removal instructions, or quick version:
Daem0nMCP v2.16.0: Sacred Covenant Enforcement—rigid enforcement decorators, preflight tokens, MCP Resources for dynamic context injection, Claude Code 2.1.3 compatibility.