
cc-obsidian-mem
Automatically captures session activity, errors, decisions, and patterns into a browsable, visualizable knowledge base.
- version
- 1.0.6
- GitHub stars
- 13
Install
/plugin install cc-obsidian-mem@cc-obsidian-memRun it inside Claude Code after adding the marketplace with /plugin marketplace add Z-M-Huang/cc-obsidian-mem.
Contents
Discovered from sourceSkills 8
Memory Audit Skill
Audit your Claude Code knowledge base to identify structural issues and content staleness.
When to Use
- Checking health of your knowledge base
- Finding broken links between notes
- Identifying orphan notes not connected to the hierarchy
- Detecting missing category indexes
- Finding notes with invalid frontmatter
- Optionally: AI-powered detection of stale content
Usage
The skill can run with or without a project specified:
/mem-audit
/mem-audit project:my-project
/mem-audit includeContentValidation:true
Workflow
-
Detect Project
- If no project specified and only one exists, use it automatically
- If multiple projects exist, list them and ask the user to specify
-
Run Audit
- Call
mem_auditwith appropriate options - Structural checks run by default (fast, no AI)
- Content validation is optional and uses AI (slower)
- Call
-
Present Results
- Show summary of issues by severity (errors, warnings, info)
- Group issues by category
- Show suggested fixes and whether they're auto-fixable
- Recommend using
/mem-fixfor auto-fixable issues
Issue Categories
Structural (Fast, No AI)
broken_link: Wikilinks pointing to non-existent notesorphan_note: Notes without parent links (not connected to hierarchy)missing_index: Category folders missing their index filesupersession_inconsistent: Supersession links not properly set upindex_stale: JSON index out of sync with note filesinvalid_frontmatter: Missing required frontmatter fields
Content (AI-Powered, Slower)
- Stale content detection by comparing notes to current code
- Only runs when
includeContentValidation: true
Output Format
# Audit Results: project-name
**Scanned**: 42 notes in 156ms
## Summary
- **Errors**: 2
- **Warnings**: 5
- **Info**: 3
## Broken Link (3)
- [!] `research/2024-01-15_api-design.md`: Broken link: [[old-decision]]
- Fix: Remove broken link [[old-decision]] (auto-fixable)
- ID: `broken_link-abc123`
...
---
Use `mem_fix` to apply fixes. Use `dryRun: true` to preview changes first.
Follow-up Actions
After presenting results, suggest:
/mem-fixto automatically fix auto-fixable issues/mem-fix dryRun:trueto preview changes first- Manual review for non-auto-fixable issues
Memory Consolidate Skill
Two-phase knowledge base cleanup: normalize verbose filenames, then consolidate semantic duplicates.
When to Use
- Long filenames: When files have verbose 40+ character names that should be shortened
- Duplicate topics: When multiple files discuss the same topic with different wording
- Post-migration cleanup: After migrating to topic-based filenames (no date prefixes)
- Knowledge base maintenance: Periodic cleanup to keep notes organized
Usage
/mem-consolidate
/mem-consolidate project:my-project
/mem-consolidate project:my-project dryRun:true
/mem-consolidate project:my-project normalizeOnly:true # Skip duplicate merging
Workflow Overview
Phase 1: Normalize Long Filenames
├── Find files with names > 40 chars
├── AI suggests short generic titles (2-4 words)
├── Rename files, add original as alias
└── Handle collisions (merge or suffix)
Phase 2: Consolidate Semantic Duplicates
├── AI groups notes by topic similarity
├── Merge groups into single files
├── Archive source files
└── Update aliases for future matching
Workflow
0. Get Config (Required First Step)
Before any file operations, you MUST read the config:
-
Read user config:
~/.cc-obsidian-mem/config.json- On Windows:
C:\Users\{username}\.cc-obsidian-mem\config.json - On macOS/Linux:
~/.cc-obsidian-mem/config.json
- On Windows:
-
Extract settings from config:
{ "vault": { "path": "/path/to/obsidian/vault", "memFolder": "_claude-mem" }, "ai": { "enabled": true, "model": "sonnet", "timeout": 30000 } } -
Construct project paths:
- Memory folder:
{vault.path}/{vault.memFolder} - Projects folder:
{vault.path}/{vault.memFolder}/projects - Project folder:
{vault.path}/{vault.memFolder}/projects/{project-name}
- Memory folder:
-
Note AI settings for semantic matching:
ai.enabled: Whether to use AI (default: true)ai.model: "sonnet", "haiku", or "opus" (default: sonnet)
Important: Never hardcode or assume vault paths. Always read from config first.
1. Detect Project
Consolidation is always scoped to a single project. Notes from different projects are never merged together.
- If no project specified, detect from current working directory (find
.gitroot) - If only one project exists in the vault, use it automatically
- If multiple projects exist and none detected, list them and ask the user to specify
2. Collect All Notes
For each category (decisions, patterns, errors, research, knowledge):
-
List all files in
{project}/{category}/folder- Exclude category index files (e.g.,
decisions/decisions.md) - Exclude
.archive/subfolder - Exclude sessions folder
- Exclude category index files (e.g.,
-
Build notes list with title, category, and filename length:
[ { "title": "Stop hook non-blocking", "category": "decisions", "path": "...", "filenameLength": 24 }, { "title": "QA: How to prevent stop hook from blocking", "category": "research", "path": "...", "filenameLength": 53 }, ... ]
3. Normalize Long Filenames (Phase 1)
Before finding duplicates, normalize verbose filenames to short generic titles.
Step 3a: Identify Long Filenames
Find all files with filename length > 40 characters (excluding .md extension):
Long filenames found:
1. [decisions] use-writeifchanged-pattern-to-avoid-unnecessary-fi.md (50 chars)
2. [research] qa-how-to-prevent-stop-hook-from-blocking-claude-s.md (53 chars)
3. [patterns] atomic-file-operations-with-collision-handling.md (47 chars)
Step 3b: AI Prompt for Title Normalization
Send long filenames to AI for generic title suggestions:
Suggest short generic titles (2-4 words) for these verbose filenames.
FILES:
0. [decisions] "use-writeifchanged-pattern-to-avoid-unnecessary-fi"
1. [research] "qa-how-to-prevent-stop-hook-from-blocking-claude-s"
2. [patterns] "atomic-file-operations-with-collision-handling"
Respond with JSON:
{"titles": ["WriteIfChanged pattern", "Stop hook blocking", "Atomic file operations"]}
Rules:
- Keep titles short: 2-4 words maximum
- Capture the core concept, not implementation details
- Remove prefixes like "qa-", "how-to-", "pattern-for-"
- Use title case
Step 3c: Rename Files
For each long filename:
- Rename file to slugified generic title (e.g.,
write-if-changed-pattern.md) - Update frontmatter title to the generic title
- Add original verbose title as alias for future Jaccard matching
- Update parent links if needed
Example transformation:
Before: use-writeifchanged-pattern-to-avoid-unnecessary-fi.md
After: write-if-changed-pattern.md
aliases: ["use writeifchanged pattern to avoid unnecessary fi"]
Step 3d: Handle Collisions
If the generic filename already exists:
- Check if semantically same topic → merge into existing file
- Different topic → add suffix:
write-if-changed-pattern-2.md
4. Find Duplicate Groups Using AI (Phase 2)
Use AI semantic matching to identify groups of notes within the current project that discuss the same topic.
AI Prompt for Grouping
Send this prompt to Claude CLI using the model from config:
Group these notes by semantic similarity (same topic, different wording).
NOTES (0-indexed):
0. [decisions] "Stop hook non-blocking"
1. [research] "QA: How to prevent stop hook from blocking"
2. [research] "QA: Stop hook blocking Claude session"
3. [patterns] "Two-phase locking"
...
Respond with JSON using 0-based indices:
{"groups": [[0,1,2], [3]], "genericTitles": ["Stop hook blocking", "Two-phase locking"]}
Rules:
- Only group notes that are semantically about the SAME topic
- Notes in different categories CAN be grouped if same topic
- Each note appears in at most one group
- Single-note groups can be omitted
- Suggest a short generic title (2-4 words) for each group
Execute AI Call
echo '<prompt>' | claude -p - --model {config.ai.model} --no-session-persistence --output-format text
Parse Response
AI returns groups like:
{
"groups": [[0,1,2], [5,8,12]],
"genericTitles": ["Stop hook blocking", "Windows path normalization"]
}
5. Process Each Duplicate Group
For each group with 2+ notes:
Step 5a: Present Group to User
Show the group for confirmation (unless auto-mode):
Found duplicate group: "Stop hook blocking"
1. [decisions] stop-hook-non-blocking.md
2. [research] qa-how-to-prevent-stop-hook-from-blocking-claude-s.md
3. [research] qa-stop-hook-blocking-claude-session.md
Merge into: decisions/stop-hook-blocking.md ?
[Yes / Skip / Custom target]
Step 5b: Execute Merge
-
Choose target file:
- Prefer existing GENERIC filename (short, 1-4 words)
- Or use AI-suggested generic title
- Keep in the most appropriate category (decisions > patterns > errors > research)
-
Merge content:
- Sort by
createddate (oldest first) - Combine as timestamped entries:
## Entry: YYYY-MM-DD HH:MM - Merge tags (unique union)
- Add all source titles as aliases (for future Jaccard matching)
- Update
entry_count
- Sort by
-
Write merged file to target path
-
Archive source files (except target) to
.archive/
6. Merge Workflow
When merging multiple files into one:
-
Sort files by created date (oldest first)
- Read frontmatter
createdfield (ISO8601 format) - Fallback: use file mtime if
createdmissing
- Read frontmatter
-
Prepare merged content:
- Use oldest file's
createddate - Merge all tags (unique union)
- Combine all aliases (unique, cap at 10)
- Combine content with timestamped entry headers:
## Entry: YYYY-MM-DD HH:MM {content from this file} - Calculate
entry_countfrom all## Entryheaders
- Use oldest file's
-
Write merged file:
- Use generic filename (shortest/most canonical)
- Include aliases from all source files
- If target file exists, append and merge frontmatter
-
Archive source files (except the target file):
- Move to
.archive/subfolder - Handle conflicts with timestamp suffix
- Move to
7. Auto-Merge Mode
When user requests automatic merging (no prompts):
-
Trust AI groupings: Auto-merge all groups identified by AI
- AI has already determined semantic similarity
- Use AI-suggested generic titles
-
Category priority for target: When group spans categories:
- decisions > patterns > errors > research > knowledge
- Or keep in category with most files
-
Still prompt for:
- Groups with notes in very different categories (e.g., errors + decisions)
- When AI confidence indicators suggest uncertainty
8. Report Summary
After processing all files:
# Consolidation Summary
**Scanned**: {N} files across {M} categories
**AI Model**: {config.ai.model}
## Phase 1: Filename Normalization
| Before | After | Category |
|--------|-------|----------|
| use-writeifchanged-pattern-to-avoid-unnecessary-fi.md | write-if-changed-pattern.md | decisions |
| qa-how-to-prevent-stop-hook-from-blocking-claude-s.md | stop-hook-blocking.md | research |
**Normalized**: {X} files renamed to shorter titles
## Phase 2: Duplicate Consolidation
| Group | Files | Target | Aliases Added |
|-------|-------|--------|---------------|
| Stop hook blocking | 3 | decisions/stop-hook-blocking.md | 2 |
| Windows path normalization | 4 | research/windows-path-normalization.md | 3 |
**Merged**: {Y} duplicate groups
## Skipped
- `{filename}`: {reason}
## Final Stats
- Files before: {N}
- Normalized: {X} long filenames → short titles
- Merged: {Y} duplicate groups
- Files after: {M}
- Total reduction: {N-M} files ({percentage}%)
---
Archived files are in `.archive/` folders.
Aliases added will improve future Jaccard matching.
AI Semantic Matching Details
Why AI Instead of Filename Patterns?
Filename-based matching (Jaccard word similarity) misses semantic duplicates:
- "stop-hook-non-blocking" vs "prevent-stop-hook-blocking" → different words, same topic
- "windows-config-location" vs "cc-obsidian-mem-config-path" → same topic
- "jaccard-similarity-limitations" vs "word-based-matching-insufficient" → same topic
AI understands that these are the same topic even with different wording.
Self-Improving System
When AI identifies duplicates and they're merged:
- All source titles added as aliases to merged note
- Next time, Jaccard matching will catch similar titles (aliases are checked)
- Reduces future AI calls - the system learns from consolidation
Handling Large Note Collections
If project has many notes (50+), batch the AI call:
- Send first 50 notes to AI
- Process identified groups
- Repeat with remaining notes
- This avoids prompt size limits
Edge Cases
Category Index Exclusion
Problem: Category index files like decisions/decisions.md have the same slug as their folder name.
Solution: Explicitly exclude files matching ${category}.md pattern.
Sessions Folder
Problem: sessions/ folder contains auto-generated session notes.
Solution: Exclude sessions category from consolidation.
Files Without Created Date
Problem: Some files may not have created field in frontmatter.
Solution: Fall back to filesystem mtime and warn user.
Already-Consolidated Files
Problem: Some generic files may already have multiple entries from previous consolidations.
Solution: Append new entries, merge aliases, update entry_count.
Archive Conflicts
Problem: File already exists in .archive/ from previous consolidation.
Solution: Append timestamp to filename: auth-bug_20260115-103000.md
Safety Features
- Dry run available: Preview changes before applying
- Archive before delete: Old files moved to
.archive/for easy recovery - Conflict handling: Timestamp suffixes prevent overwrites
- Alias preservation: Original titles saved for future matching
- Incremental: Can run multiple times safely
Follow-up Actions
After consolidation, suggest:
- Review archived files in
.archive/folders - Run
/mem-auditto verify vault structure is clean - Clean up old archives when confident changes are correct
Memory Fix Skill
Apply fixes for issues detected in your Claude Code knowledge base.
When to Use
- After running
/mem-auditand finding issues - To clean up broken links
- To add missing parent links to orphan notes
- To create missing category indexes
- To rebuild stale indexes
Usage
/mem-fix project:my-project
/mem-fix project:my-project dryRun:true
/mem-fix project:my-project fixCategories:broken_link,orphan_note
Workflow
-
Run Audit First
- Call
mem_auditto get current issues - Present summary: X errors, Y warnings, Z info
- Call
-
Collect Confirmation
- Group issues by category
- For each category with issues, ask: "Fix all N [category] issues?"
- Show examples (first 3-5) before asking for confirmation
-
Apply Fixes
- Use
dryRun: truefirst to preview changes - Then apply confirmed fixes with
dryRun: false
- Use
-
Report Results
- Show what was fixed successfully
- Show what failed and why
- Suggest re-running audit to verify
Fix Types
| Category | Fix Type | Auto-Fixable |
|---|---|---|
broken_link | Remove the broken wikilink | Yes |
orphan_note | Add parent link to frontmatter | Yes |
missing_index | Create category index file | Yes |
supersession_inconsistent | Update frontmatter (may need manual input) | Partial |
index_stale | Rebuild project index | Yes |
invalid_frontmatter | Add missing fields (except title) | Partial |
Output Format
Dry Run
# Dry Run Results
**Would fix**: 8/10
## Successful
- `broken_link-abc123`: Would remove link [[old-note]]
- link_removed: Removed broken link [[old-note]]
## Failed
- `supersession_inconsistent-def456`: No suggested fix available
---
Run again with `dryRun: false` to apply these changes.
After Applying
# Fix Results
**Fixed**: 8/10
## Successful
- `broken_link-abc123`: Removed link [[old-note]]
- link_removed: Removed broken link [[old-note]]
## Failed
- `supersession_inconsistent-def456`: No suggested fix available
Safety Features
- Dry run by default: Always preview changes first
- Atomic writes: Files are written atomically to prevent corruption
- TOCTOU protection: Checks if files changed since audit before applying fixes
- Individual results: Each fix reports success/failure independently
Follow-up Actions
After fixing, suggest:
/mem-auditto verify all issues are resolved- Review any failed fixes manually
Memory Repair Skill
Clean up and repair common issues with the cc-obsidian-mem memory system.
When to Use
- Getting errors about temp files or stale sessions
- Sessions not starting properly
--continuepicking up wrong sessions- Sessions stuck in "processing" status
- Want to clean up all temp files and start fresh
Usage
/mem-repair
/mem-repair full
Workflow
-
Show Current Status First, show what will be cleaned:
# Windows (cmd) dir "%TEMP%\cc-obsidian-mem-*.txt" 2>nul || echo No temp files dir "%TEMP%\cc-mem-agent-*.txt" 2>nul || echo No legacy temp files dir "%USERPROFILE%\.cc-obsidian-mem\locks\*" 2>nul || echo No lock files # macOS/Linux ls -la /tmp/cc-obsidian-mem-*.txt 2>/dev/null || echo "No temp files" ls -la /tmp/cc-mem-agent-*.txt 2>/dev/null || echo "No legacy temp files" ls -la ~/.cc-obsidian-mem/locks/* 2>/dev/null || echo "No lock files" -
Clean Up Temp Files Remove orphan temp files from crashed sessions:
# Windows (cmd) del /q "%TEMP%\cc-obsidian-mem-*.txt" 2>nul del /q "%TEMP%\cc-mem-agent-*.txt" 2>nul # macOS/Linux rm -f /tmp/cc-obsidian-mem-*.txt rm -f /tmp/cc-mem-agent-*.txt -
Clean Up Stale Lock Files
# Windows (cmd) del /q "%USERPROFILE%\.cc-obsidian-mem\locks\*" 2>nul # macOS/Linux rm -f ~/.cc-obsidian-mem/locks/* -
Clean Up Old Log Files (optional, if user requests full cleanup)
# Windows (cmd) del /q "%TEMP%\cc-obsidian-mem-*.log" 2>nul # macOS/Linux rm -f /tmp/cc-obsidian-mem-*.log -
Clean Up Database Sessions (if sqlite3 is available)
# Mark stale processing sessions as failed (stuck > 30 min) sqlite3 ~/.cc-obsidian-mem/sessions.db "UPDATE sessions SET status = 'failed' WHERE status = 'processing' AND updated_at < datetime('now', '-30 minutes');" # Mark orphan active sessions as failed (active > 24 hours) sqlite3 ~/.cc-obsidian-mem/sessions.db "UPDATE sessions SET status = 'failed' WHERE status = 'active' AND created_at < datetime('now', '-24 hours');" # Show recent sessions sqlite3 ~/.cc-obsidian-mem/sessions.db "SELECT substr(session_id, 1, 12) || '...' as session_id, status, project, created_at FROM sessions ORDER BY created_at DESC LIMIT 10;"Windows alternative (if sqlite3 not in PATH):
# Just show the database file exists dir "%USERPROFILE%\.cc-obsidian-mem\sessions.db" 2>nul || echo No database found -
Clean Polluted Claude Session History (if
--continuepicks wrong sessions)# Windows (PowerShell) - find and delete polluted session files Get-ChildItem -Path "$env:USERPROFILE\.claude\projects" -Recurse -Filter "*.jsonl" | Where-Object { (Get-Content $_.FullName -Raw) -match "cc-mem-agent|cc-obsidian-mem-" } | Remove-Item -Force # macOS/Linux grep -rl "cc-mem-agent\|cc-obsidian-mem-" ~/.claude/projects --include="*.jsonl" | xargs rm -f
Output Format
## Memory System Repair
### Temp Files Cleaned
- Removed 3 orphan temp files
- Removed 1 legacy temp file
### Lock Files Cleaned
- Removed 2 stale lock files
### Database Sessions
- Marked 1 stale processing session as failed
- Marked 0 orphan sessions as failed
### Log Files
- Kept (use `/mem-repair full` to remove)
### Recent Sessions
| Session ID | Status | Project | Created |
|------------|--------|---------|---------|
| abc123... | completed | my-project | 2024-01-15 10:30 |
| def456... | failed | other-proj | 2024-01-14 15:20 |
Repair complete. Start a new session to continue working.
Common Issues Fixed
| Issue | Symptom | Fix |
|---|---|---|
| Orphan temp files | Errors reading temp files | Remove cc-obsidian-mem-*.txt |
| Legacy temp files | --continue picks wrong session | Remove cc-mem-agent-*.txt |
| Stale locks | Sessions stuck in "processing" | Remove files from ~/.cc-obsidian-mem/locks/ |
| Stale processing | Sessions never complete | Mark as failed in database |
| Orphan sessions | Old active sessions | Mark as failed in database |
| Polluted history | --continue reads file paths | Delete polluted JSONL files |
| Old logs | Disk space usage | Remove cc-obsidian-mem-*.log |
After Repair
- Start a fresh session (not
--continue) - If issues persist, check config:
cat ~/.cc-obsidian-mem/config.json - Run
/mem-statusto verify memory system is working
Memory Save Skill
Explicitly save knowledge to the Claude Code memory system for future reference.
When to Use
- Recording an important decision
- Documenting a useful pattern
- Saving a solution to a tricky error
- Noting learnings for future reference
- Creating reusable knowledge
Usage
The skill accepts content to save. Examples:
/mem-save decision: We chose PostgreSQL over MongoDB for this project
/mem-save pattern: This regex pattern works for parsing dates: /\d{4}-\d{2}-\d{2}/
/mem-save learning: The API rate limits at 100 requests per minute
/mem-save error-fix: The CORS issue was fixed by adding the origin header
Note Types
| Type | Use For |
|---|---|
decision | Architectural or design decisions with rationale |
pattern | Reusable code patterns, regex, algorithms |
error | Error solutions and workarounds |
learning | General insights and knowledge |
file | File-specific notes and documentation |
Workflow
-
Identify Content Type
- Parse the user's input to determine the note type
- If unclear, ask for clarification
-
Structure the Content
- Extract the main information
- Add appropriate context (project, tags)
- Format with Obsidian-friendly markdown
-
Save and Confirm
- Use
mem_writeto persist - Show the saved note path
- Offer to add more details
- Use
Content Templates
Decision
## Context
[Why this decision was needed]
## Decision
[What was decided]
## Rationale
[Why this approach was chosen]
## Consequences
- Positive: ...
- Negative: ...
Pattern
## Description
[What this pattern does]
## When to Use
[Scenarios where this applies]
## Implementation
\`\`\`language
[Code example]
\`\`\`
Error Fix
## Problem
[The error encountered]
## Cause
[Root cause]
## Solution
[How it was fixed]
## Prevention
[How to avoid in future]
Guidelines
- Always include context about why something was decided
- Add relevant tags for discoverability
- Link to related notes when possible
- Be specific enough to be useful later
Memory Search Skill
Search your Claude Code knowledge base to find relevant information.
When to Use
- Finding how a previous error was solved
- Recalling decisions made about the codebase
- Looking up patterns used before
- Getting context about a file's history
- Finding knowledge and learnings
Usage
The skill accepts a natural language query. Examples:
/mem-search authentication error fix
/mem-search database schema decisions
/mem-search how did we handle caching
/mem-search API rate limiting patterns
Workflow
-
Analyze the Query
- Determine if they're looking for an error, decision, pattern, or general info
- Identify any project context
-
Search Strategy
- Use
mem_searchwith appropriate filters - For errors: filter by
type: error - For decisions: filter by
type: decision - For patterns: filter by
type: pattern - For knowledge: filter by
type: learning
- Use
-
Present Results
- Show a summary of top matches
- Show title, type, and path for each result
- Offer to show full details with
mem_read
Output Format
Present results clearly:
## Found X results for "query"
### [Title]
**Type**: type | **Path**: `path/to/note.md`
**Project**: project-name
---
Would you like me to show the full details of any of these?
Note: Search returns lightweight results. Use mem_read for full note content.
Advanced Usage
If the user wants project-wide context:
mem_project_context({ project: "project-name" })
This returns unresolved errors, active decisions, and patterns for the project.
Memory Status Skill
Display memory system information and tracked projects.
When to Use
- See if the memory system is working
- List all tracked projects
- Get context for a specific project
Usage
/mem-status
/mem-status projects
Workflow
-
List Projects Use
mem_list_projectstool -
Get Project Context If a project is specified, use
mem_project_context -
Check Config
cat ~/.cc-obsidian-mem/config.json
Output Format
## Memory System Status
### Projects in Memory
1. project-a (last active: 1 day ago)
2. project-b (last active: 3 days ago)
3. my-project (current)
### Quick Stats
- Total Notes: 156
- Errors Documented: 23
- Decisions Recorded: 15
- Knowledge Items: 45
Troubleshooting
If no data is being captured:
- Verify hooks are installed: check
/plugin list - Check config:
cat ~/.cc-obsidian-mem/config.json - Ensure vault path is correct and writable
- Check background log:
cat /tmp/cc-obsidian-mem-background.log
Memory Validate Skill
Validate your knowledge notes against the current state of the codebase to detect stale content.
When to Use
- Periodic knowledge base maintenance
- After major refactoring
- Before relying on old documentation
- To identify notes that need updating
Usage
/mem-validate project:my-project
/mem-validate project:my-project noteType:decision
/mem-validate project:my-project limit:10
How It Works
-
Extract File References
- Scans note content for file path mentions
- Patterns like
src/utils/helper.ts, code block paths, etc.
-
Check File Existence
- If referenced files are deleted: note is definitely stale
- If some files missing: note is likely stale
-
AI Comparison (for existing files)
- Reads current file content (first 2000 chars)
- Uses AI to compare documented knowledge vs actual code
- Returns staleness verdict with confidence score
Workflow
-
Run Validation
- Call
mem_validatefor the project - Default limit: 20 notes (AI validation is slow)
- Call
-
Present Results
- Group by status: stale, current, unable to validate
- Show confidence scores for stale notes
- List files that have changed
-
Offer Actions
- For stale notes: offer to update via
mem_supersede - For notes without file references: note that manual review may be needed
- For stale notes: offer to update via
Output Format
# Content Validation Results
**Checked**: 15 notes
**Stale**: 3
**Current**: 10
**Unable to validate**: 2
## Stale Notes
These notes may need to be updated or superseded:
### `research/2024-01-15_api-design.md`
- **Confidence**: 85%
- **Reason**: The API endpoint handlers have been refactored to use a different pattern
- **Referenced files**: src/api/handlers.ts, src/middleware/auth.ts
### `decisions/authentication-strategy.md`
- **Confidence**: 92%
- **Reason**: All referenced files have been deleted
## Unable to Validate
- `research/general-tips.md`: No file references found in note content
---
Use `mem_supersede` to update stale notes with current information.
Follow-up Actions
For each stale note, offer:
- Update: Read current files and create superseding note with
mem_supersede - Skip: Leave as-is (user decides later)
- Delete: If content is no longer relevant
Notes
- Validation is AI-powered and may take 30-60 seconds per note
- Uses
claude -pwith haiku model for fast validation - Notes without file references cannot be automatically validated
- High confidence (>80%) suggests the note should definitely be reviewed
MCP servers 1
Sponsors
Details
- Marketplace
- Z-M-Huang/cc-obsidian-mem
- Source
- plugin
- Category
- Community