cf memory
Manage the AI memory system — search, list, daemon, rebuild index
Manage the persistent AI memory system. Store, search, and recall project knowledge across Claude Code sessions. See Memory System for architecture details.
Subcommands
| Command | Description |
|---|---|
cf memory status | Show current tier, document count, daemon state |
cf memory search <query> | Search memories from the terminal |
cf memory list | List memories in current project |
cf memory list --projects | List all project databases with size and metadata |
cf memory rm | Remove a project database |
cf memory init | Interactive setup wizard (or config menu on re-run) |
cf memory config | Configure memory system settings |
cf memory start-daemon | Start the Tier 2 daemon |
cf memory stop-daemon | Stop the Tier 2 daemon |
cf memory rebuild | Re-index all memories from markdown files |
cf memory mcp | Print MCP server config for Claude Code and other clients |
init
Interactive setup wizard. On first run, walks through each setting. On re-run (database exists), opens the config menu instead — same as cf memory config.
Wizard steps:
- Search tier — auto, full (Tier 1), lite (Tier 2), or markdown (Tier 3)
- Embedding provider — Transformers.js or Ollama
- Auto-capture — auto-save session context on compaction
- Auto-start daemon — start daemon when MCP server connects
- Daemon timeout — idle timeout in minutes
- Install deps & import — installs SQLite deps and imports existing memories
- MCP setup — adds
coding-friend-memoryto.mcp.json
Each setting asks whether to save to global or local config.
Prerequisite for Tier 1: C++ compiler (Xcode CLT on macOS, build-essential on Linux).
cf memory init
# 🧠 Memory Setup
# Step 1/5: Search tier
# ? Memory search tier: full
# ...
# Memory initialized!
config
Interactive menu to modify memory settings. Same settings as the init wizard. Also accessible via cf config > Memory settings.
cf memory config
# 🧠 Memory Config
# ? Memory settings:
# Tier [global] (auto)
# Auto-capture [local] (true)
# Embedding [global] (ollama/nomic-embed-text)
# ...
# Done
search
Searches memories from the terminal using Tier 3 substring matching. For full hybrid search (keyword + semantic), use the memory_search MCP tool inside Claude Code.
cf memory search "authentication flow"
# [0.85] JWT Authentication Pattern
# id: features/jwt-auth | type: fact | matched: title, content
list
Without flags, lists individual memories in the current project. With --projects, lists all project databases sorted by size.
cf memory list --projects
# 5.7 MB 47 memories 912d2bfd5ad5 2026-03-16
# /Users/you/project-a/docs/memory
#
# 213.1 KB 0 memories 0a1d7ea4a615 n/a
# /Users/you/project-b/docs/memory
#
# Total: 5 project(s), 6.5 MB
rm
Removes project database(s). Markdown source files in docs/memory/ are not affected — only the SQLite index. Rebuild anytime with cf memory rebuild.
cf memory rm --project-id 912d2bfd5ad5 # Remove specific project
cf memory rm --all # Remove all databases
cf memory rm --prune # Remove orphaned projects
All commands ask for confirmation before deleting.
start-daemon / stop-daemon
Manages the Tier 2 daemon — a background server that keeps a MiniSearch index in RAM for fuzzy matching and BM25 ranking. Not needed if Tier 1 (SQLite) is enabled.
cf memory start-daemon
# Daemon started (PID 12345)
cf memory stop-daemon
The daemon runs detached and auto-rebuilds on file changes. By default, the daemon runs indefinitely until explicitly stopped with cf memory stop-daemon. If you configure an idle timeout and the daemon stops, the MCP server respawns it automatically on the next request (with up to 3 retry attempts before falling back to Tier 3).
rebuild
Re-reads all markdown files and rebuilds the search index from scratch. Run after manually editing memory files, switching embedding models, or pulling changes from git.
cf memory rebuild
# Rebuilt: 42 memories indexed.
status
Shows current tier, document count, daemon state, and MCP configuration.
cf memory status
# Tier: Tier 1 (SQLite + Hybrid)
# Memories: 42
# Daemon: stopped
# MCP: configured (local .mcp.json)
# Auto-capture: on
Configuration
In .coding-friend/config.json. Memory files are stored in {docsDir}/memory/ (default: docs/memory/).
{
"memory": {
"tier": "auto",
"daemon": { "idleTimeout": 0 },
"autoCapture": false,
"autoStart": false,
"embedding": {
"provider": "transformers",
"model": "Xenova/all-MiniLM-L6-v2"
}
}
}
| Option | Default | Description |
|---|---|---|
tier | "auto" | "auto", "full" (Tier 1), "lite" (Tier 2), "markdown" (Tier 3) |
daemon.idleTimeout | 0 (no timeout) | Minutes before daemon auto-stops (0 = run forever) |
autoCapture | false | Auto-save session summaries on context compaction |
autoStart | false | Auto-start daemon when MCP server connects |
embedding.provider | "transformers" | "transformers" or "ollama" |
embedding.model | "Xenova/all-MiniLM-L6-v2" | Embedding model name |
embedding.ollamaUrl | "http://localhost:11434" | Ollama server URL |