wisdom-store
Includes automation scripts for tmux to facilitate session reloading and context injection workflows.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@wisdom-store save the lesson about handling the race condition in our auth middleware"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
wisdom-store
An MCP server that gives AI coding assistants persistent memory, context control, and anti-hallucination tools.
Early release — actively developed, APIs may change. Expect rough edges.
What it does
Context control — Trim conversation context live (no restart needed), inject curated knowledge into sessions, monitor context usage.
Persistent knowledge — Save lessons, patterns, cautions, and edge cases to flat files that survive across sessions. Organize by project section, file, or globally.
Project indexing — AST-based symbol extraction (via @ast-grep/napi), API route detection, HTML page inventory. Produces a compact project overview designed to give Claude a detailed map of your project for a fraction of your context window.
Anti-hallucination — Symbol registry with fuzzy matching catches hallucinated function names, typos, and unknown symbols. Includes a post-write hook that automatically warns about hallucinated imports, file paths, function calls, and API routes after every edit.
Related MCP server: ContextStream MCP Server
Tools (11)
Context Control
Tool | Description |
| Check context usage — message count, estimated tokens, bloat indicators |
| Trim old messages live. Modes: |
| Insert curated context as a new conversation root. Requires |
Persistent Knowledge
Tool | Description |
| Persist lessons, patterns, cautions, edge cases, or decisions to |
| Load wisdom for a file, section, or keyword. Call with no args for project overview |
| Document feature plans with files, decisions, and status |
| Browse what wisdom exists — sections, plans, patterns, sidecars |
Project Index
Tool | Description |
| Scan project, extract symbols via AST, save to |
| Compact project map — file tree, symbols, API routes, HTML pages. Always fresh |
Anti-Hallucination
Tool | Description |
| Cross-reference symbols against registry. Reports: confirmed, fuzzy match (typo?), or unknown (hallucinated?) |
| Re-scan and update the symbol registry |
Install
git clone https://github.com/InfiniQuest-App/wisdom-store.git
cd wisdom-store
npm installAdd to your ~/.claude.json or project .mcp.json (see examples/mcp.json):
{
"mcpServers": {
"wisdom-store": {
"command": "node",
"args": ["/path/to/wisdom-store/src/mcp-server/index.js"],
"env": {}
}
}
}Restart Claude Code or run /mcp to connect.
Teaching Claude to use it
Copy the relevant sections from examples/CLAUDE.md into your project's CLAUDE.md. This teaches Claude when to load wisdom, save knowledge, check symbols, and manage context.
Hooks
The hooks/ directory contains Claude Code hooks that integrate with wisdom-store automatically.
Add to your settings file — ~/.claude/settings.json (global), .claude/settings.json (project), or .claude/settings.local.json (personal per-project). Replace /path/to/wisdom-store with your actual clone path.
Post-Write Hallucination Check
Automatically checks for hallucinations after every Write/Edit:
Import paths pointing to files that don't exist
Imported symbols not in the project registry
Standalone function calls to unknown symbols
API routes not found in the project index
Requires .wisdom/symbols.json — run get_project_overview once to generate it (auto-refreshes on each call). Only fires for code files (.js, .ts, .py, .go, .rs).
Pre-Compact Save Reminder
Reminds Claude to save important findings to wisdom-store before context gets compacted. Fires on both manual (/compact) and automatic compaction. Only fires in projects with a .wisdom/ directory.
Setup
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit",
"hooks": [{
"type": "command",
"command": "/path/to/wisdom-store/hooks/post-write-symbol-check.sh",
"timeout": 10
}]
},
{
"matcher": "Write",
"hooks": [{
"type": "command",
"command": "/path/to/wisdom-store/hooks/post-write-symbol-check.sh",
"timeout": 10
}]
}
],
"PreCompact": [
{
"matcher": "",
"hooks": [{
"type": "command",
"command": "/path/to/wisdom-store/hooks/pre-compact-save-reminder.sh",
"timeout": 10
}]
}
]
}
}How it works
Storage
Everything is flat files in a .wisdom/ directory at your project root:
.wisdom/
index.json # Project metadata + file list
symbols.json # Symbol registry (functions, classes, exports, routes)
sections/ # Knowledge organized by topic
auth.md
estimates.md
plans/ # Feature plans
v2-migration.md
patterns/ # Reusable patterns
error-handling.mdWisdom is stored at three levels:
Project —
.wisdom/sections/,.wisdom/plans/,.wisdom/patterns/for knowledge about this projectFile-specific — Sidecar files next to source:
myfile.jsgetsmyfile.js.wisdomGlobal —
~/.claude/wisdom/for cross-project lessons (usescope: "global"withsave_wisdom)
Context manipulation
prune_context works by setting parentUuid: null on a target message in the JSONL conversation file, orphaning everything before it. This takes effect live on the next message — no restart needed.
inject_context appends a new message with parentUuid: null as a fresh root. Requires /resume to reload. A helper script (hooks/send-resume.sh) is included as a starting point for tmux automation, but manual /resume is the most reliable approach.
AST extraction
Uses @ast-grep/napi (tree-sitter based) for JavaScript/TypeScript/TSX. Extracts functions, classes, variables, exports, interfaces, types, enums. Regex fallback for Python, Go, and Rust.
The project overview is designed to be context-efficient — compact enough to fit in a single tool response while covering file tree, symbols, routes, and pages.
Example output
Running get_project_overview on this repo:
# Project Overview
## Files (16)
Total: 3,093 lines
- hooks/: symbol-check.mjs (273L)
- src/mcp-server/: index.js (371L)
- src/mcp-server/lib/: indexer.js (643L), jsonl.js (276L), wisdom.js (325L)
- src/mcp-server/tools/: check-symbols.js (87L), context-status.js (123L),
get-project-overview.js (58L), get-wisdom.js (179L), inject-context.js (177L),
list-wisdom.js (144L), prune-context.js (125L), refresh-symbols.js (15L),
reindex-project.js (92L), save-wisdom.js (106L), update-plan.js (99L)
## Symbols
Functions: 62, Classes/Types: 0, Exports: 40
### Exports
- appendLine — src/mcp-server/lib/jsonl.js:273
- checkSymbols — src/mcp-server/lib/indexer.js:543
- findConversationFile — src/mcp-server/lib/jsonl.js:30
- generateOverview — src/mcp-server/lib/indexer.js:450
- handleCheckSymbols — src/mcp-server/tools/check-symbols.js:24
- handlePruneContext — src/mcp-server/tools/prune-context.js:23
- scanProject — src/mcp-server/lib/indexer.js:50
- walkChain — src/mcp-server/lib/jsonl.js:160
... (40 exports total)Typical workflow
1. Start working on a task
2. get_project_overview → understand the codebase
3. get_wisdom for relevant files/sections → load past knowledge
4. Work on the task
5. save_wisdom to persist new insights
6. check_symbols after writing code → catch hallucinations
7. If context gets large: save_wisdom → prune_context → continueLanguage support
Language | AST extraction | Regex fallback |
JavaScript (.js, .mjs, .cjs, .jsx) | Full | - |
TypeScript (.ts, .tsx) | Full | - |
Python (.py) | - | Functions, classes, methods |
Go (.go) | - | Functions, types, variables |
Rust (.rs) | - | Functions, structs, enums, traits |
HTML (.html) | - | Page titles, structure |
Requirements
Node.js 18+
Claude Code (for MCP integration and hooks)
License
MIT
Available Tools
14 toolsannotate_wisdomA
Add a comment or correction to existing wisdom. Use when you discover a previous assumption was wrong, needs clarification, or has new context. Annotations are timestamped and appended below the matching entry. Think of it as leaving a sticky note for future sessions.
Inputs: comment (required), search, section, file_path.
backup_planA
Back up your current Claude Code plan file to .wisdom/plan-backups/. Your plan name is in your plan mode system prompt (the filename in ~/.claude/plans/). Saves a timestamped copy so you can restore it later.
Inputs: plan_name (required), source_path.
check_symbolsA
Verify symbol names you just used are real. Pass function/class/variable names and get back: confirmed (exists), fuzzy match (possible typo — did you mean X?), or unknown (might be hallucinated). Call this after writing code that references existing symbols, especially in unfamiliar parts of the codebase. Only reports problems — confirmed symbols are counted but not listed.
Inputs: symbols (required), verbose, project_path.
context_statusA
Check how much context you have left. Shows message count, estimated token usage, and bloat indicators. Call this when starting a complex task or when you suspect context is getting large. If usage is >70%, consider pruning old messages with prune_context before continuing.
Inputs: conversation_id.
get_project_overviewA
Get a compact map of the project: file tree with line counts, all classes/types, and all exports. Call this early in a session to orient yourself in an unfamiliar codebase. Much cheaper than reading individual files. Auto-runs reindex_project if no index exists yet.
Inputs: project_path.
get_wisdomA
Load relevant wisdom before working on a file or area. Call with no args for a project overview, then drill into specifics. Recommended workflow: get_wisdom() overview → get_wisdom(file_path) for the files you are about to edit → get_wisdom(keyword) if you need to find related knowledge. This gives you accumulated project knowledge from previous sessions.
Inputs: mode, plan, keyword, section, +1 more.
inject_contextA
Inject curated context into the conversation as a new branch. Use to restore important context after pruning or to seed a session with relevant knowledge. Auto-triggers /resume via the dashboard if available. Keep injected content natural-sounding — avoid markers like [INJECTED] that trigger prompt injection detection.
Inputs: content (required), session, prune_orphans, conversation_id.
list_wisdomB
Browse what wisdom exists in the project. Filter by: all, sections, plans, patterns, sidecars, or global.
Inputs: filter.
prune_contextA
Free up context by trimming old messages. Works live without restart. Use when context_status shows >70% usage. Before pruning, save any important findings with save_wisdom so they survive the trim. Typical workflow: save_wisdom → prune_context(mode:"oldest_percent", percent:40) → continue working with more room.
Inputs: mode (required), phrase, percent, message_number, +1 more.
refresh_symbolsA
Re-scan the project and update the symbol registry. Run this after you have made code changes (added/renamed/removed functions) so that check_symbols works against the latest codebase state.
Inputs: max_depth, max_files, project_path.
reindex_projectA
Build or refresh the project symbol index. Extracts all functions, classes, variables, and exports using AST parsing (JS/TS) or regex (Python/Go/Rust). Run this when starting work on a project for the first time, or after significant code changes. The index powers check_symbols and get_project_overview. Fast: ~350 files in under 2 seconds.
Inputs: max_depth, max_files, project_path.
request_compactA
Request context compaction for your session. Sends /compact to your tmux session via the dashboard — it executes after your current turn completes. Use when context is getting large and you want to compact proactively. Save important findings with save_wisdom first, as compaction summarizes and trims conversation history. Requires DASHBOARD_URL env var.
Inputs: session, conversation_id.
save_wisdomA
Persist a lesson, pattern, caution, edge case, or decision so future sessions can benefit. Save when you discover something non-obvious: a tricky bug, an important constraint, a pattern that works well, or a decision rationale. Use file_path for file-specific wisdom (creates sidecar), section for broader project area knowledge, or scope:"global" for cross-project patterns. Keep entries concise and actionable — future you will thank present you.
Inputs: content (required), scope, section, keywords, +2 more.
update_planA
Document a feature plan so future sessions understand what was built and why. Include files it touches, design decisions, and current status. Update existing plans when you complete or change direction on a feature. Plans are stored in .wisdom/plans/ and cross-referenced in the project index.
Inputs: name (required), files, status, content, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool has a clearly distinct purpose: wisdom management, plan management, symbol operations, context control, and project overview. No two tools overlap significantly.
Most tools follow a verb_noun pattern (e.g., save_wisdom, list_wisdom, check_symbols). A few like context_status are noun_noun but still readable and consistent in using lowercase snake_case.
14 tools is well-scoped for the server's purpose. Each tool serves a specific need without being excessive or insufficient.
The tool surface covers core operations for wisdom (CRUD except delete), plans (backup and update), symbols (check, refresh, reindex), and context (status, prune, inject, compact). Minor gaps like a delete-wisdom tool exist, but annotations compensate.
Maintenance
Related MCP Connectors
Shared memory for coding agents. Stop re-explaining your codebase every session.
Project memory, documentation and controlled secret access for AI coding agents.
Gives your AI assistant persistent memory and intelligence about your work patterns.
Persistent engineering memory designed to follow developers across coding agents.
Related MCP Servers
- AlicenseBqualityCmaintenanceProvides AI assistants with persistent memory of your project architecture, development history, and technical decisions, allowing them to give context-aware coding help without needing repeated explanations.1661 npm2MIT
- AlicenseCqualityAmaintenanceProvides AI assistants with persistent memory and code intelligence across all tools and conversations. Features semantic search, knowledge graphs, decision tracking, and impact analysis with 60+ tools for universal context preservation.362,856 npm46MIT
- AlicenseAqualityCmaintenanceProvides persistent memory and a codebase knowledge graph for AI coding assistants, enabling shared context across multiple tools like Claude, Cursor, and ChatGPT, with significant token reduction.534 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding assistants to persistently save, search, checkpoint, and restore context across sessions, with channels, file caching, git integration, and sharing between parallel sessions.195 npmMIT