From memclaw
Creates, opens, and manages project workspaces in LiveDocs for cross-session memory, long-term tracking like diets or investments, and saving key outputs.
npx claudepluginhub felo-inc/memclawThis skill uses the workspace's default tool permissions.
The agent's external brain for projects. Once activated, the agent continuously syncs artifacts and knowledge into the corresponding LiveDoc, so that anyone (including future sessions or teammates) can load that workspace and instantly recover full context.
Captures insights as markdown files, searches prior learnings, and promotes patterns to CLAUDE.md using tiered backends (local, qmd, agent-fs) for knowledge across projects.
Provides persistent Obsidian vault memory for coding agents. Auto-orients sessions with TODOs and project overviews, supports lookup of notes/patterns, and writes discoveries using commands like init, lookup, note.
Share bugs, ideas, or general feedback.
The agent's external brain for projects. Once activated, the agent continuously syncs artifacts and knowledge into the corresponding LiveDoc, so that anyone (including future sessions or teammates) can load that workspace and instantly recover full context.
| Concept | Description |
|---|---|
| Workspace | One project = one LiveDoc |
| Active Workspace | Current session state; all operations auto-sync to this workspace |
| README | The agent's memory of the project; actively maintained by the agent |
| Artifacts | Important outputs; the agent asks before saving |
| Registry | ~/.memclaw/workspaces.json, mapping project names to LiveDoc IDs and project summaries |
Registry format:
{
"workspaces": {
"Health Management": {
"id": "nkYv32xA2dEHNpyT4xdZkq",
"summary": "Triggers when user talks about diet, exercise, weight, calories, health tracking"
}
}
}
Registry maintenance rules:
id and summarysummary field syncs from the README summary field. If the API returns a summary, use it; otherwise generate a one-line project description in the user's language.Project existence verification (important):
$SCRIPT list --keyword.In all commands below, $SCRIPT means:
node memclaw/scripts/run.mjs
Path resolution: this script path is relative to the installed skill directory. If memclaw/scripts/run.mjs cannot be found, try absolute paths:
node ~/.openclaw/skills/memclaw/scripts/run.mjsnode ~/.claude/skills/memclaw/memclaw/scripts/run.mjsThe script automatically loads ~/.memclaw/env for the API key. No manual source is required.
| Command | Description |
|---|---|
create | Create a new LiveDoc (required: --name) |
list | List all LiveDocs |
update <short_id> | Update a LiveDoc |
delete <short_id> | Delete a LiveDoc |
resources <short_id> | List resources in a LiveDoc |
resource <short_id> <resource_id> | Get details for a single resource |
add-doc <short_id> | Create a text document resource (required: --content) |
add-urls <short_id> | Add URL resources (required: --urls, comma-separated, max 10) |
upload <short_id> | Upload a file resource (required: --file, optional: --convert) |
remove-resource <short_id> <resource_id> | Delete a resource |
update-resource <short_id> <resource_id> | Update resource title, snippet, or thumbnail |
update-resource-content <short_id> <resource_id> | Update Markdown content of an ai_doc resource (required: --content) |
retrieve <short_id> | Semantic search (required: --query, optional: --resource-ids) |
route <short_id> | Route relevant resources by query (required: --query) |
content <short_id> <resource_id> | Get text content of a resource (cached locally) |
download <short_id> <resource_id> | Download the source file to local disk |
ppt-retrieve <short_id> | PPT page deep retrieval (required: --resource-id, --page-number, --query) |
get-readme <short_id> | Get README (returns summary + content) |
update-readme <short_id> | Create or replace README (required: --content or --summary, at least one) |
append-readme <short_id> | Append content to README (required: --content) |
delete-readme <short_id> | Delete README |
User pastes the GitHub install link → run installation → after completion, automatically enter login flow (0a).
Trigger conditions (any one is enough):
{"status":401,"code":"UNAUTHORIZED","message":"Invalid API Key"}Flow:
"Please click this link to log in / register a Felo account: https://felo.ai/settings/api-keys After that, paste the Key here and I will finish the setup for you automatically."
export FELO_API_KEY="<user's key>"
Or persist it into ~/.memclaw/env (depending on platform).$SCRIPT list
First-use introduction (show only on first install, not on re-authorization):
After showing the intro below, you must also write a reminder into MEMORY.md so the agent remembers MemClaw in future conversations:
## MemClaw Skill
I have the MemClaw external-brain skill installed. When the user talks about a topic that may relate to an existing project, the plugin auto-injects the project list. I must load the corresponding project before answering. Never rely on my own memory for project-related questions.
Present a first-use introduction to the user (in the user's language) covering these points:
~/.memclaw/workspaces.json and fuzzy-match by project name. If not found locally, immediately try $SCRIPT list --keyword.is_shared property) → run $SCRIPT get-readme SHORT_ID → present the README as the project briefing to the user → append the link https://felo.ai/livedoc/SHORT_ID?from=claw. If the README is empty or missing, fall back to $SCRIPT resources SHORT_ID and show the resource list. If is_shared is true, add a reminder: "(read-only — shared project)".
$SCRIPT content SHORT_ID RESOURCE_ID.There are two paths:
Path A — user explicitly asks to create one:
$SCRIPT create --name "<project name>" --description "<workspace description>"
add-doc to create a data document (content = Markdown table header)Path B — the agent notices a repeatedly recurring topic: When the user repeatedly talks about the same topic across multiple conversations but there is still no corresponding workspace:
add-docWhen creating a project, never interrogate the user with a long setup questionnaire. Goals, rules, and preferences should emerge naturally as the project is used.
The README contains the Document Directory (see Section 4). That directory is the single source of truth telling you what documents exist and what they are for. Whenever you are about to write data, always look there first.
Decision flow before writing data:
update-resource-content to append the dataadd-doc to create a new document, then update the README's Document DirectoryImportant: same-type data should use a single document. Do not split it by date or by number of writes. Only split if the user explicitly asks for it.
Common write commands:
| Action | Command |
|---|---|
| Create new document | $SCRIPT add-doc SHORT_ID --title "<title>" --content "<content>" |
| Append to existing document | $SCRIPT update-resource-content SHORT_ID RESOURCE_ID --content "<full updated text>" |
| Add web links | $SCRIPT add-urls SHORT_ID --urls "<urls>" |
| Upload local file | $SCRIPT upload SHORT_ID --file /path/to/file --convert |
Note: update-resource-content is a full overwrite operation, so you must first read the existing content via $SCRIPT content SHORT_ID RESOURCE_ID, merge in the new data, then overwrite the full updated text.
About saving artifacts (ask before saving):
If ACTIVE_WORKSPACE.is_shared (shared read-only) is true, skip this entirely — do not ask, and do not try to save.
After producing an important long-form result (for example a detailed research report, data analysis, or long copywriting draft), ask the user once: "Do you want me to save this into the project?" Only ask for important final outputs. Do not ask for intermediate drafts or short casual replies.
If ACTIVE_WORKSPACE.is_shared is true, skip this entire section — do not read or write the README.
The README is the agent's core memory of the project. It has two jobs: telling the agent what the project is for, and telling it where to find the data. The agent maintains this proactively; you do not need user permission.
README has two API fields:
summary: a one-line project description (max 2000 chars). The plugin syncs this into the registry for fuzzy topic matching.content: the full README body (Markdown).README structure — it must contain the following sections (use the user's language for section headers and content):
# [Project Name]
## Goal
[Project background, core objectives, user's personal preferences]
## Rules
[How the agent should work in this project, how to handle user data]
## Write Rules
[Specify which data types go into which document. User's explicit instructions override these rules]
- [Data type A] → write to "Document Name" (Resource ID: xxx)
- [Data type B] → write to "Document Name" (Resource ID: xxx)
- Data not covered by write rules → ask user whether to create a new document
- When changing data structure or storage strategy, always update write rules and document directory in sync
## Document Directory
| Document | Purpose | Resource ID |
|----------|---------|-------------|
| Diet Log | Daily meals and calories | res_abc123 |
| Gold Analysis | Gold market analysis and insights | res_def456 |
The Document Directory is critical. Every time the agent needs to read or write data, it should consult this table first. Resource ID lets the agent use $SCRIPT content SHORT_ID RESOURCE_ID directly without doing extra list lookups.
README should NOT contain:
Example — README for a health-management project (illustrative structure only; generate content in the user's language):
# Health Management
## Goal
User wants to improve fatty liver through healthy weight loss, maintaining a 500-1000kcal calorie deficit daily.
User casually mentions what they ate, I estimate calories and record. Doesn't like using apps, finds them tedious. Weekly summary of performance.
## Rules
- User sends meal data → I estimate calories → silently append to diet log document
- User sends exercise data → record exercise data → append to the same diet log document
- User asks "how was this week" → I read the diet log → summarize and conclude
- Write method: first use content to read existing document → append new row to table → use update-resource-content to overwrite full text
## Write Rules
- Diet data (what was eaten, calories) → write to "Diet Log" (Resource ID: res_abc123)
- Exercise data (exercise calories, stairs climbed, etc.) → write to "Diet Log" (Resource ID: res_abc123)
- User's questions and analysis requests → do not write to any document, answer directly
- User expresses new preferences or rule changes → update README
- Forbidden to create a second data document, all records write only to the above document
## Document Directory
| Document | Purpose | Resource ID |
|----------|---------|-------------|
| Diet Log | Daily meals, exercise, and calorie deficit | res_abc123 |
When you MUST update the README:
When you should NOT update the README:
Update method: read first → merge the change into the correct section → overwrite the full README. Never blindly append to the end.
$SCRIPT get-readme SHORT_ID to read the current stateGoal / Rules / Write Rules / Document Directory)Last updated: YYYY-MM-DD$SCRIPT update-readme SHORT_ID --summary "<one-line description>" --content "<full updated content>" to overwrite the full updated contentInitialize from scratch (when the README is completely empty):
Use update-readme together with --summary to write the full skeleton in one go. Fill Goal with the information you currently have; Rules and Document Directory can start empty.
Use resources + content to directly fetch project knowledge and source material.
content caches extracted content internally under ~/.memclaw/cache/{livedocid}/{resource_id}_{ts}.md. It still returns the full extracted text content directly, so you do not need to manage the cache yourself.
$SCRIPT resources SHORT_ID
$SCRIPT content SHORT_ID RESOURCE_ID
Read the full content returned, extract what matters, and answer the user naturally. Never dump robotic lists of what you found.
When the user says "refresh this" or you suspect the workspace may have been changed externally by someone else, re-fetch everything below:
$SCRIPT get-readme SHORT_ID
$SCRIPT resources SHORT_ID
Update your internal understanding of the project state. Then tell the user: "Workspace refreshed." If something actually changed, summarize the important differences briefly (for example, a new file appeared).
Use $SCRIPT resources SHORT_ID to show the resources in the workspace, grouped by type. Newer artifacts should appear first.
ACTIVE_WORKSPACE = { name: "project-x", short_id: "abc123", is_shared: false }
is_shared flag comes from the LiveDoc object returned by list or create. If is_shared = true, the project is read-only: skip all write operations (including create/update docs, upload, update README). Read operations are still allowed. If the user insists on writing, reply: "This project is shared read-only. I can view it, but I cannot modify it."| Error | What to do |
|---|---|
| Key missing / API returns 401 UNAUTHORIZED | Trigger the login flow (see Section 0a). |
| LiveDoc ID is invalid / cannot be found | Suggest reconnecting it or creating a new one. |
| Local registry not found | Proactively create an empty ~/.memclaw/workspaces.json file: { "workspaces": {} }. |
| Multiple fuzzy matches and not sure which one | Show all candidates and ask the user to pick. |
Keep notifications short and standardized. One line is enough — no long operational reports.
| What happened | Required notification |
|---|---|
| Loaded workspace | Confirm loaded, include project name + link https://felo.ai/livedoc/SHORT_ID?from=claw |
| Created workspace | Confirm created, include project name + link |
| Switched workspace | Confirm switched, include project name + link |
| Wrote into a document or created a new document | Confirm recorded, include link |
| Saved an important artifact after asking | Confirm saved with document title + link |
| Proactively updated the README | Confirm project memory updated + link |
| Just queried data / chatted | Do not say you queried documents — just give the answer directly |
Do not stack multiple operational messages like a menu. If you both wrote a document and updated the README directory, merge them into one short confirmation with the link.
Besides core workspace management, you can also call Felo's advanced APIs at any time to generate content for the current project. Three critical preconditions:
FELO_API_KEY is already available in the environment. Always send the header: Authorization: Bearer $FELO_API_KEYlivedoc_short_id, you must pass the current ACTIVE_WORKSPACE.short_id. This makes the generated result automatically land inside the current project's LiveDoc.PPT generation is a special async polling flow. Follow it carefully to avoid hanging:
GET /v2/ppt-themesPOST /v2/ppts (required: query and livedoc_short_id), then record the returned task IDGET /v2/tasks/{task_id}/historical. When a success status appears, extract ppt_url from the response and deliver it to the user.short_id consistently in operations