Persistent memory system for Claude Code CLI using Obsidian-compatible markdown
npm install claude-memory-mcpA persistent memory system for Claude Code CLI that stores memories in an Obsidian-compatible markdown vault.
THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Use at your own risk. The authors are not responsible for any data loss, corruption, or other issues that may arise from using this software.
``bash`
npx claude-memory-mcp init
`bash`
npx claude-memory-mcp init
This creates:
- .claude-memory/ - The vault directory.mcp.json
- - MCP server configurationCLAUDE.md
- - Instructions for Claude
`bash`
npx claude-memory-mcp bootstrap
Interactive prompts to populate your vault with project info, tech stack, and decisions.
`bash`
npx claude-memory-mcp doctor
The init command automatically creates the correct .mcp.json for your platform.
Windows (requires cmd wrapper):
`json`
{
"mcpServers": {
"memory": {
"command": "cmd",
"args": ["/c", "npx", "-y", "claude-memory-mcp", "serve", "--vault", ".claude-memory"]
}
}
}
macOS/Linux:
`json`
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "claude-memory-mcp", "serve", "--vault", ".claude-memory"]
}
}
}
- 21 MCP tools for Claude to read/write memories
- Obsidian-compatible markdown with YAML front matter
- 8 memory types: decision, pattern, standard, concept, error, troubleshooting, question, session
- Automatic context loading at session start
- Wikilinks for cross-referencing memories
- Supersession tracking for architectural decisions
| Type | Purpose |
|------|---------|
| decision | Architectural Decision Records (ADRs) |
| pattern | Reusable code patterns |
| standard | Coding standards and conventions |
| concept | Domain concepts and explanations |
| error | Error solutions and fixes |
| troubleshooting | Debugging guides |
| question | Open questions to investigate |
| session | Session summaries |
The .claude-memory vault is fully compatible with Obsidian:
1. Open Obsidian
2. Click "Open folder as vault"
3. Select the .claude-memory folder in your project
4. Enable "Properties view" in Settings > Editor to see YAML front matter as a table
The vault structure:
``
.claude-memory/
├── memories/
│ ├── decisions/
│ ├── patterns/
│ ├── standards/
│ ├── concepts/
│ ├── errors/
│ ├── troubleshootings/
│ ├── questions/
│ └── sessions/
├── _templates/
└── _archive/
Test the memory system with these prompts in Claude Code:
Saving memories:
- "Save a decision: We're using PostgreSQL for the database because of ACID compliance"
- "Save a pattern for retry logic with exponential backoff"
- "Save a coding standard: All functions must have JSDoc comments"
- "I just fixed a bug where JSON.parse failed on undefined input - save this error"
Retrieving memories:
- "What decisions have we made?"
- "Show me all saved patterns"
- "Search memories for 'database'"
- "What's the context for this project?"
Session management:
- "Start a new session"
- "End session with summary: implemented user authentication"
Maintenance:
- "Show vault status"
- "Archive the old session memories"
1. Verify .mcp.json exists in your project root`
2. Check the configuration:
json`
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "claude-memory-mcp", "serve", "--vault", ".claude-memory"]
}
}
}
.mcp.json
3. Restart Claude Code after changes to
Run npx claude-memory-mcp init in your project directory to create the vault.
- Make sure you opened the .claude-memory folder directly as a vault.claude-memory/memories/
- Check that files exist in subdirectories
- Refresh the file explorer in Obsidian (click away and back)
Tech tags must be lowercase alphanumeric with hyphens only. Use:
- react, typescript, postgresql (comma-separated)dotnet-core
- (hyphens, not spaces)
Run npx claude-memory-mcp doctor to see specific issues. Common fixes:summary
- Missing required fields: Edit the memory file to add , type, or idtype
- Invalid enum values: Check that , status, confidence` use valid values
Run your terminal as Administrator, or check that the project folder isn't read-only.
MIT License - See LICENSE for details.