/install fragments
Fragments
Setup Check
- Read
~/.config/fragments.json(Windows:%USERPROFILE%\.config\fragments.json). - If file missing → first install. Detect current platform, read the matching setup guide:
- Claude Code →
references/setup-claude-code.md - OpenCode →
references/setup-opencode.md - OpenClaw →
references/setup-openclaw.md
- Claude Code →
- If file exists → verify MCP is configured. If incomplete → read the matching setup guide.
- All good → proceed to normal usage.
Platform Detection
Detect the current platform by checking for platform-specific markers:
| Platform | Detection Marker |
|---|---|
| Claude Code | ~/.claude/ directory exists |
| OpenCode | ~/.config/opencode/ directory exists |
| OpenClaw | ~/.openclaw/ directory exists |
Modes
memo — Full Lifecycle Management
Create, search, update, delete, and comment on memos via MCP tools.
Workflows:
- Create & dedup →
references/memo-capture.md - Update & delete →
references/memo-capture.md#lifecycle - Comments →
references/memo-comments.md
Write operations require user confirmation before calling.
daily-log — Daily Work Journal
One structured log per user per day. Content follows .plan format
enforced by the Memos server.
Format rules, diff-merge logic, and hook trigger workflow:
→ references/daily-log.md
search — Semantic Search
Server-side full-text retrieval via MCP, optional client-side TF-IDF + LSA rerank for semantic/fuzzy queries.
Pipeline details and tuning parameters:
→ references/search-strategy.md
Retrieval Strategy
Data volume can be large. Always prefer targeted retrieval over bulk listing.
Memos
- Search first:
memos_search_memos(query=...)— use when the user has any intent, keyword, or topic. Returns bounded results. - Get by ID:
memos_get_memo(name=...)— use when you already know the memo name. Expand full content only for shortlisted results. - List as fallback:
memos_list_memos(page_size=10)— use only for explicit "show recent" requests. Always set a smallpage_size. - Client-side rerank: pipe search results through
scripts/fragments_search.pyfor semantic ranking when server-side results need refinement.
Comments
- List comments:
memos_list_memo_comments(name=...)— retrieve all comments on a memo. Comments inherit the parent memo's visibility.
Daily Logs
- Get by date:
memos_get_daily_log(date=YYYY-MM-DD)— single log lookup. Passcreator="users/{id}"to view another user's log (PROTECTED visibility). - List with date range:
memos_list_daily_logs(start_date, end_date, page_size=10)— use only for explicit "show this week/month" requests. Always bound the range.
Tags
memos_list_tags— lightweight, use to discover available tags for filtering.
No read operations require user confirmation.
Write Operations
All write operations require explicit user confirmation before calling. Read operations need no confirmation. Never echo PAT tokens to the conversation.
Memo Writes
| Operation | MCP Tool | When to Use |
|---|---|---|
| Create | memos_create_memo |
New idea, note, snippet |
| Update | memos_update_memo |
Modify content, visibility, pin |
| Delete | memos_delete_memo |
Remove memo (irreversible) |
| Add comment | memos_create_memo_comment |
Append discussion to memo |
Daily Log Writes
memos_save_daily_log(date=..., content=...)— full replacement save. Always include complete content (existing + new lines).
Hook Workflow (Passive Trigger)
When triggered by agent task completion:
- Assess whether this session performed meaningful work. Skip if trivial.
- Call
memos_get_daily_logfor today's date. - Format new entries in
.planstyle. - Diff against existing content. Skip if no new information.
- Long-form content → suggest creating a memo first, reference in daily log.
- Show user the full merged log (existing + new). Wait for confirmation.
- Call
memos_save_daily_logwith complete content (full replacement).
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install fragments - 安装完成后,直接呼叫该 Skill 的名称或使用
/fragments触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
fragments 是什么?
Fragmented work logging and idea capture powered by Memos. Full memo lifecycle: create, search, update, delete, and comment. Daily-log: structured work journ... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 93 次。
如何安装 fragments?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install fragments」即可一键安装,无需额外配置。
fragments 是免费的吗?
是的,fragments 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
fragments 支持哪些平台?
fragments 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 fragments?
由 CarOL(@hx-w)开发并维护,当前版本 v1.0.0。