memory-worktree
Skill19 starsChanged 3 months agoMITView on GitHub
Verify, customize, or opt out of moflo's AUTOMATIC durable-learning sharing across git worktrees / Conductor workspaces on one machine. As of the worktree-auto-sharing change this is on by default — learnings converge across a repo's worktrees with no setup. Use when the user asks "is memory shared across my worktrees?", "where are my worktree learnings stored?", "turn off worktree memory sharing", "share learnings across my separate clones", or "point my worktrees at a custom store". For a team or cross-machine (git-tracked) sharing, use /memory-team instead.
In this repository30 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- src/CLAUDE.mdCLAUDE.md
- communeSkill
- connector-builderSkill
- distillSkill
- divineSkill
- eldarSkill
- flflSkill
- flo-simplifySkill
- floSkill
- floSkill
- guidanceSkill
- healerSkill
- luminariumSkill
- meditateSkill
- memory-optimizationSkill
- memory-patternsSkill
- memory-teamSkill
- optimize-learningsSkill
- perf-auditSkill
- publishSkill
- quickenSkill
- reasoningbank-intelligenceSkill
- reset-epicSkill
- spell-builderSkill
- spell-scheduleSkill
- test-gapsSkill
- vector-searchSkill
- verifySkill
- wardSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 49
Run the safety/status check and surface it verbatim:
- Very specific: line 69
If the user wants it off, set the toggle in the project-root moflo.yaml (preserve other memory: keys):
- Very specific: line 82
put the shared store somewhere other than .git/moflo/ (e.g.
- Very specific: line 120
Don't: use mkdir -p / rm / cp in shell steps — Windows lacks them on PATH.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/memory-worktree — Durable Sharing Across Worktrees (Automatic)
Working across git worktrees is a core moflo competency, so durable-learning sharing across the
worktrees of a repo is now automatic and on by default. When a checkout is part of a repo with
worktrees in play, moflo derives a shared durable store at <git-common-dir>/moflo/durable.db and
converges the learnings + knowledge namespaces across every worktree at session start — no config.
A plain single checkout writes nothing and behaves exactly as before.
This skill is for the three things you might still want: verify it's working, customize where it stores (or extend it to non-worktree clones), or opt out.
Only the durable slice travels. Structural + ephemeral data stays local per checkout and rebuilds itself — the same safety model the auto path is built on (a dedicated
durable.db, never a fullmoflo.db). See [[memory-team]] for the git-tracked, cross-machine variant.
Arguments: $ARGUMENTS — --off to opt out, --path <store> to set a custom shared store.
When to use
- "Is memory / are learnings shared across my worktrees?" → verify (Step 1).
- "Where are my worktree learnings stored?" → it's
<git-common-dir>/moflo/durable.db; verify to confirm. - "Turn off / disable worktree memory sharing" → opt out (Step 2).
- "Share learnings across my separate clones / a custom location" → customize (Step 3).
For a team, or your own laptop+desktop over git, that's /memory-team, not this.
Procedure
Step 0 — Memory first (gate requirement)
mcp__moflo__memory_search { query: "durable_path worktree sharing auto git common dir learnings", namespace: "guidance" }Step 1 — Verify (default action)
Run the safety/status check and surface it verbatim:
npx flo doctor -c shared-db 2>&1- "Automatic worktree learning sharing active (
<path>)" → it's working; the path is the shared store. - "No shared full moflo.db detected…" → auto sharing is NOT active here. Most likely this checkout has no sibling worktrees yet (auto only turns on once worktrees exist). Confirm with the user; if they expected sharing across separate clones (not worktrees), go to Step 3 — auto can't converge those.
- A
warn→ a full-DB misconfig is present; follow the check'sfixline.
To see that learnings actually converged, from a second worktree:
npx flo memory list --namespace learnings 2>&1 | headStep 2 — Opt out (--off)
If the user wants it off, set the toggle in the project-root moflo.yaml (preserve other memory: keys):
memory:
worktree_sharing: falseExplain: this stops the auto flush/seed at session start. Anything already converged into a worktree's local DB stays; nothing new propagates. Takes effect next session.
Step 3 — Customize the store (--path, or non-worktree clones)
Setting an explicit memory.durable_path overrides the auto derivation — use it to:
- put the shared store somewhere other than
.git/moflo/(e.g. a synced/backed-up location), or - converge checkouts that are separate clones, not git worktrees (auto only covers worktrees, since only worktrees share a git common dir).
memory:
durable_path: ~/.moflo-shared/<repo-name>-learnings.dbThe path must live outside any single checkout and must not be named moflo.db. Create the parent
dir with a Node primitive (cross-platform — never mkdir -p):
node -e "const p=require('path'),fs=require('fs');fs.mkdirSync(p.dirname(process.argv[1]),{recursive:true})" "<chosen-store-path>"Then re-run npx flo doctor -c shared-db to confirm it reports the durable-only store as safe.
Output
End with a single-block summary of what state you left it in, e.g.:
Worktree Memory Sharing
────────────────────────
Mode: automatic (default) | custom durable_path | disabled
Store: <git-common-dir>/moflo/durable.db (or the custom/none path)
Config: memory.worktree_sharing / memory.durable_path
Verify: npx flo doctor -c shared-db
Scope: learnings + knowledge only (structural stays local)Rules
- Don't re-implement the sync or path derivation — it's
resolveDurablePath/syncDurableAtSessionStartinsrc/cli/services/durable-sync.ts; this skill only reads config, sets the two keys, and verifies. - Never set
durable_pathto a file namedmoflo.dbor the local.moflo/moflo.db— that's the HNSW-index-divergence hazardflo doctor -c shared-dbguards against. - Don't use
mkdir -p/rm/cpin shell steps — Windows lacks them on PATH. Use Nodefs. - Cross-machine or team? Wrong skill. Redirect to
/memory-team.
See Also
/memory-team— git-tracked JSONL sharing for teams and one person across machinesflo doctor -c shared-db— reports auto-sharing status and catches full-DB misconfigdocs/blog/memory-sharing.html— the design rationale (durable vs structural vs ephemeral)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

