不要硬背!开发时遇到问题,翻开这一页查就行。
附录 A. MCP 工具速查表
Memory Search 系列
| 工具 |
参数 |
说明 |
search |
query(必填), type, date_from, date_to, project, limit |
搜索记忆索引,返回轻量列表 |
timeline |
observation_id 或 query |
查看某条 Observation 前后的事件链 |
get_observations |
ids[](必填) |
按 ID 批量获取完整 Observation |
list_projects |
无 |
列出所有记录过的项目名称 |
Smart Explore 系列
| 工具 |
参数 |
说明 |
smart_search |
query(必填), path(必填), file_pattern |
基于 AST 的语义代码搜索 |
smart_outline |
filepath(必填) |
返回文件的函数/类/接口骨架 |
smart_unfold |
filepath(必填), entity_name(必填), line_start(必填) |
精准展开一个函数的完整代码 |
Knowledge Agent 系列
| 工具 |
参数 |
说明 |
build_corpus |
corpus_name(必填, snake_case), query_tags[](必填) |
构建专题知识胶囊 |
prime_corpus |
corpus_name(必填) |
激活知识胶囊到当前上下文 |
query_corpus |
corpus_name(必填), question(必填) |
向知识胶囊提问 |
附录 B. 配置模板
~/.claude-mem/settings.json(推荐配置)
{
"CLAUDE_MEM_MODE": "code--zh",
"WORKER_PORT": 37777,
"LOG_LEVEL": "info",
"CONTEXT_OBSERVATION_LIMIT": 50,
"CONTEXT_SESSION_LIMIT": 10
}
claude_desktop_config.json(MCP 配置)
{
"mcpServers": {
"mcp-search": {
"command": "node",
"args": [
"/Users/YOUR_USERNAME/.claude/plugins/marketplaces/thedotmack/plugin/scripts/mcp-server.cjs"
]
}
}
}
.claude-mem.json(项目级配置,可选)
{
"version": "2.0.0",
"project_name": "my-blog",
"smart_explore": {
"ignored_directories": ["node_modules", "dist", ".git", ".next"],
"parsers": {
"typescript": "tree-sitter-typescript"
}
},
"make_plan": {
"require_verbatim_snippets": true,
"allow_skipping_tests": false
}
}
附录 C. Observation 类型速查
| 类型 |
含义 |
搜索语法 |
decision |
架构/设计决策 |
type:decision |
bugfix |
Bug 修复 |
type:bugfix |
feature |
新功能实现 |
type:feature |
refactor |
代码重构 |
type:refactor |
discovery |
新发现/新知识 |
type:discovery |
change |
通用变更 |
type:change |
附录 D. Token 经济学对照表
| 操作 |
不用 Claude-Mem |
用 Claude-Mem |
节省率 |
| 理解一个 500 行文件 |
read_file: ~8,000 tk |
smart_outline: ~350 tk |
95% |
| 搜索一个历史 Bug |
grep 全仓库: ~15,000 tk |
search: ~150 tk |
99% |
| 注入 10 个会话的上下文 |
全塞: ~100,000 tk |
三层检索: ~2,600 tk |
97% |
| 总结 3 个月项目历史 |
手动翻记录: 无穷 |
prime_corpus: ~600 tk |
∞ |
附录 E. 排障快速检查
# 1. Worker 是否运行?
curl http://localhost:37777/api/health
# 2. 数据库是否存在?
ls -la ~/.claude-mem/claude-mem.db
# 3. Hook 是否注册?
ls ~/.claude/plugins/marketplaces/thedotmack/plugin/hooks/
# 4. 配置是否正确?
cat ~/.claude-mem/settings.json
# 5. 日志有什么错误?
tail -20 ~/.claude-mem/logs/worker.log
(全文完)