|
| 1 | +# Basic Memory Plugin for Claude Code |
| 2 | + |
| 3 | +This plugin provides skills, commands, and hooks for working with [Basic Memory](https://basicmemory.io) - a local-first knowledge management system built on the Model Context Protocol (MCP). |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +You need the Basic Memory MCP server running. Install it via: |
| 8 | + |
| 9 | +```bash |
| 10 | +# Install basic-memory |
| 11 | +pip install basic-memory |
| 12 | + |
| 13 | +# Or with pipx |
| 14 | +pipx install basic-memory |
| 15 | +``` |
| 16 | + |
| 17 | +Then add it to your Claude Code MCP configuration. |
| 18 | + |
| 19 | +## Installation |
| 20 | + |
| 21 | +### Add the Marketplace |
| 22 | + |
| 23 | +``` |
| 24 | +/plugin marketplace add basicmachines-co/basic-memory/claude-code-plugin |
| 25 | +``` |
| 26 | + |
| 27 | +### Install the Plugin |
| 28 | + |
| 29 | +``` |
| 30 | +/plugin install basic-memory@basicmachines |
| 31 | +``` |
| 32 | + |
| 33 | +### Or via Repository Settings |
| 34 | + |
| 35 | +Add to your `.claude/settings.json`: |
| 36 | + |
| 37 | +```json |
| 38 | +{ |
| 39 | + "plugins": { |
| 40 | + "extraKnownMarketplaces": { |
| 41 | + "basicmachines": { |
| 42 | + "source": { |
| 43 | + "source": "github", |
| 44 | + "repo": "basicmachines-co/basic-memory", |
| 45 | + "path": "claude-code-plugin" |
| 46 | + } |
| 47 | + } |
| 48 | + }, |
| 49 | + "installed": ["basic-memory@basicmachines"] |
| 50 | + } |
| 51 | +} |
| 52 | +``` |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +## Slash Commands |
| 57 | + |
| 58 | +User-invoked commands for explicit interaction with Basic Memory. |
| 59 | + |
| 60 | +### `/remember [title] [folder]` |
| 61 | + |
| 62 | +Capture insights, decisions, or learnings from the current conversation. |
| 63 | + |
| 64 | +``` |
| 65 | +/remember "FastAPI Async Pattern" |
| 66 | +/remember "Auth Decision" decisions |
| 67 | +``` |
| 68 | + |
| 69 | +Creates a structured note with: |
| 70 | +- Context from the conversation |
| 71 | +- Observations with `[decision]`, `[insight]`, `[pattern]` categories |
| 72 | +- Relations linking to related concepts |
| 73 | + |
| 74 | +### `/continue [topic]` |
| 75 | + |
| 76 | +Resume previous work by building context from Basic Memory. |
| 77 | + |
| 78 | +``` |
| 79 | +/continue postgres migration |
| 80 | +/continue SPEC-24 |
| 81 | +/continue |
| 82 | +``` |
| 83 | + |
| 84 | +If no topic is provided, shows recent activity and asks what to dive into. |
| 85 | + |
| 86 | +### `/context <memory://url> [depth] [timeframe]` |
| 87 | + |
| 88 | +Build context from a specific memory:// URL. |
| 89 | + |
| 90 | +``` |
| 91 | +/context memory://SPEC-24 |
| 92 | +/context memory://architecture/* 3 2weeks |
| 93 | +``` |
| 94 | + |
| 95 | +### `/recent [timeframe] [project]` |
| 96 | + |
| 97 | +Show recent activity in Basic Memory. |
| 98 | + |
| 99 | +``` |
| 100 | +/recent |
| 101 | +/recent 1week |
| 102 | +/recent today specs |
| 103 | +``` |
| 104 | + |
| 105 | +### `/organize [action] [project]` |
| 106 | + |
| 107 | +Organize and maintain your knowledge graph. |
| 108 | + |
| 109 | +``` |
| 110 | +/organize # Quick health check |
| 111 | +/organize orphans # Find unlinked notes |
| 112 | +/organize duplicates # Find similar notes |
| 113 | +/organize relations "Note" # Suggest links for a note |
| 114 | +/organize tags # Review tag consistency |
| 115 | +``` |
| 116 | + |
| 117 | +Actions: |
| 118 | +- `health` - Overview of knowledge base status (default) |
| 119 | +- `orphans` - Find notes with no relations |
| 120 | +- `duplicates` - Find overlapping notes |
| 121 | +- `relations` - Suggest connections |
| 122 | +- `tags` - Review tag consistency |
| 123 | + |
| 124 | +### `/research <topic> [folder]` |
| 125 | + |
| 126 | +Research a topic and save a structured report to Basic Memory. |
| 127 | + |
| 128 | +``` |
| 129 | +/research MCP protocol |
| 130 | +/research "database migrations" |
| 131 | +/research "auth options" decisions |
| 132 | +``` |
| 133 | + |
| 134 | +Produces a report with: |
| 135 | +- Summary and key findings |
| 136 | +- Analysis and recommendations |
| 137 | +- Sources and related notes |
| 138 | +- Saved to `research/` folder by default |
| 139 | + |
| 140 | +--- |
| 141 | + |
| 142 | +## Skills |
| 143 | + |
| 144 | +Model-invoked capabilities that Claude uses automatically based on context. |
| 145 | + |
| 146 | +### knowledge-capture |
| 147 | + |
| 148 | +Automatically captures insights, decisions, and learnings into structured notes. |
| 149 | + |
| 150 | +**Triggers when:** |
| 151 | +- Important decisions are made |
| 152 | +- Technical insights are discovered |
| 153 | +- Problems are solved |
| 154 | +- Design trade-offs are discussed |
| 155 | + |
| 156 | +### continue-conversation |
| 157 | + |
| 158 | +Resumes previous work by building context from the knowledge graph. |
| 159 | + |
| 160 | +**Triggers when:** |
| 161 | +- Starting a new session |
| 162 | +- User mentions previous work ("continue with...", "back to...") |
| 163 | +- Need context about ongoing projects |
| 164 | + |
| 165 | +### spec-driven-development |
| 166 | + |
| 167 | +Guides implementation based on specifications stored in Basic Memory. |
| 168 | + |
| 169 | +**Triggers when:** |
| 170 | +- Implementing a feature defined by a spec |
| 171 | +- Creating new specifications |
| 172 | +- Reviewing implementation against criteria |
| 173 | + |
| 174 | +### edit-note |
| 175 | + |
| 176 | +Interactively edit notes using MCP tools in a conversational workflow. |
| 177 | + |
| 178 | +**Triggers when:** |
| 179 | +- User wants to edit, update, or modify a note |
| 180 | +- User asks to change specific content in a note |
| 181 | +- User wants to add observations or relations |
| 182 | + |
| 183 | +**How it works:** |
| 184 | +1. Fetches the note via MCP |
| 185 | +2. Shows current content |
| 186 | +3. Applies edits using `edit_note` operations (append, prepend, find_replace, replace_section) |
| 187 | +4. Shows the updated result |
| 188 | + |
| 189 | +**Best for:** Cloud users or when you want conversational editing. |
| 190 | + |
| 191 | +### edit-note-local |
| 192 | + |
| 193 | +Edit notes directly as local markdown files with automatic sync. |
| 194 | + |
| 195 | +**Triggers when:** |
| 196 | +- User has local Basic Memory installation |
| 197 | +- User wants to make substantial file edits |
| 198 | +- User prefers working with full file content |
| 199 | + |
| 200 | +**How it works:** |
| 201 | +1. Finds the note's file path via MCP |
| 202 | +2. Uses Claude Code's Read/Edit/Write tools on the actual file |
| 203 | +3. Basic Memory's `sync --watch` picks up changes automatically |
| 204 | + |
| 205 | +**Best for:** Local users who want full file access and git integration. |
| 206 | + |
| 207 | +### knowledge-organize |
| 208 | + |
| 209 | +Help organize, link, and maintain the knowledge graph. |
| 210 | + |
| 211 | +**Triggers when:** |
| 212 | +- User wants to organize their notes |
| 213 | +- User asks about orphan or unlinked notes |
| 214 | +- User wants to find connections between notes |
| 215 | +- User mentions duplicates or similar notes |
| 216 | +- User asks for help with folder organization |
| 217 | + |
| 218 | +**Capabilities:** |
| 219 | +- **Find orphan notes** - Identify notes with no relations |
| 220 | +- **Suggest relations** - Propose meaningful links between notes |
| 221 | +- **Identify duplicates** - Find notes covering similar topics |
| 222 | +- **Folder organization** - Review and suggest folder structure |
| 223 | +- **Tag consistency** - Normalize and improve tagging |
| 224 | +- **Create index notes** - Generate hub notes linking related topics |
| 225 | +- **Enrich sparse notes** - Suggest observations and structure |
| 226 | + |
| 227 | +**Best for:** Periodic knowledge base maintenance and improving discoverability. |
| 228 | + |
| 229 | +### research |
| 230 | + |
| 231 | +Research topics thoroughly and produce structured reports saved to Basic Memory. |
| 232 | + |
| 233 | +**Triggers when:** |
| 234 | +- User asks to research or investigate something |
| 235 | +- User wants to understand a concept or technology |
| 236 | +- User needs context before making a decision |
| 237 | +- Phrases like "research", "look into", "explore", "investigate" |
| 238 | + |
| 239 | +**What it produces:** |
| 240 | +- Structured report with summary, findings, and analysis |
| 241 | +- Recommendations when applicable |
| 242 | +- Links to sources and related notes |
| 243 | +- Saved to `research/` folder |
| 244 | + |
| 245 | +**Best for:** Building knowledge base through investigation and documentation. |
| 246 | + |
| 247 | +--- |
| 248 | + |
| 249 | +## Hooks |
| 250 | + |
| 251 | +Automated behaviors that enhance the Basic Memory workflow. |
| 252 | + |
| 253 | +### PostToolUse: write_note |
| 254 | + |
| 255 | +Confirms when notes are saved to Basic Memory. |
| 256 | + |
| 257 | +### Stop |
| 258 | + |
| 259 | +After significant conversations, suggests using `/remember` to capture valuable insights (only when genuinely useful). |
| 260 | + |
| 261 | +--- |
| 262 | + |
| 263 | +## MCP Tools Used |
| 264 | + |
| 265 | +This plugin leverages Basic Memory's MCP tools: |
| 266 | + |
| 267 | +| Tool | Purpose | |
| 268 | +|------|---------| |
| 269 | +| `write_note` | Create/update markdown notes | |
| 270 | +| `read_note` | Read notes by title or permalink | |
| 271 | +| `search_notes` | Full-text search across content | |
| 272 | +| `build_context` | Navigate knowledge graph via memory:// URLs | |
| 273 | +| `recent_activity` | Get recently updated information | |
| 274 | +| `edit_note` | Incrementally update notes | |
| 275 | + |
| 276 | +--- |
| 277 | + |
| 278 | +## Plugin Structure |
| 279 | + |
| 280 | +``` |
| 281 | +claude-code-plugin/ |
| 282 | +├── .claude-plugin/ |
| 283 | +│ ├── plugin.json # Plugin manifest |
| 284 | +│ └── marketplace.json # Self-hosted marketplace |
| 285 | +├── commands/ |
| 286 | +│ ├── remember.md # /remember command |
| 287 | +│ ├── continue.md # /continue command |
| 288 | +│ ├── context.md # /context command |
| 289 | +│ ├── recent.md # /recent command |
| 290 | +│ ├── organize.md # /organize command |
| 291 | +│ └── research.md # /research command |
| 292 | +├── skills/ |
| 293 | +│ ├── knowledge-capture/ |
| 294 | +│ ├── continue-conversation/ |
| 295 | +│ ├── spec-driven-development/ |
| 296 | +│ ├── edit-note/ |
| 297 | +│ ├── edit-note-local/ |
| 298 | +│ ├── knowledge-organize/ |
| 299 | +│ └── research/ |
| 300 | +├── hooks/ |
| 301 | +│ └── hooks.json # Hook definitions |
| 302 | +├── README.md # Quick start guide |
| 303 | +└── PLUGIN.md # Full documentation |
| 304 | +``` |
| 305 | + |
| 306 | +--- |
| 307 | + |
| 308 | +## Related |
| 309 | + |
| 310 | +- [Basic Memory Documentation](https://docs.basicmemory.io) |
| 311 | +- [Basic Memory GitHub](https://github.com/basicmachines-co/basic-memory) |
| 312 | +- [Model Context Protocol](https://modelcontextprotocol.io) |
| 313 | +- [Claude Code Plugins](https://code.claude.com/docs/en/plugins) |
0 commit comments