Clone
Package your agent's full context for transfer to a new vault.
What gets cloned: Everything in the agent folder : MEMORY.md, MEMORY-INDEX.md, memory/, and CLONE.md once generated. Also includes onebrain.yml and the OneBrain plugin.
What does NOT get cloned: your notes, projects, areas, knowledge, resources, archive, and logs.
Usage: /clone
Files Included in Clone Package
05-agent/MEMORY.md05-agent/MEMORY-INDEX.md← include MEMORY-INDEX05-agent/memory/← all memory files (was: context/ + memory/ separately; now merged)onebrain.yml← include onebrain.yml (has recap config).claude/plugins/onebrain/
Session Log Handling
When cloning, preserve recapped: and topics: fields on all session logs.
Do NOT strip these fields — the new vault should not reprocess already-recapped logs.
Archive Folder Option
AskUserQuestion: "Include [archive_folder]/[agent_folder]/memory/ (deleted memory files)?"
Options: include / skip
include: copy06-archive/05-agent/memory/into clone package (full history)skip: omit archive folder (clean fresh-feeling vault)
Step 1: Regenerate CLONE.md
Write [agent_folder]/CLONE.md (overwrite if it exists):
markdown--- tags: [agent-clone] updated: YYYY-MM-DD --- # Agent Clone Manifest ## Identity - Source: [agent_folder]/MEMORY.md - Agent name: [read from [agent_folder]/MEMORY.md `## Identity & Personality` section — value of **Agent:** field] - Last updated: [TODAY'S DATE] ## Index [If [agent_folder]/MEMORY-INDEX.md exists, include a note that MEMORY-INDEX.md is present. Otherwise write: (none)] ## Memory Notes [For each .md file in agent_folder/memory/ (skip .gitkeep and non-.md files), list: - filename : first line of file body (after frontmatter). If no .md files exist, write: (none yet)]
Step 2: Display Clone Summary
Show the user what will be cloned:
──────────────────────────────────────────────────────────────
📦 Ready to Clone
──────────────────────────────────────────────────────────────
✅ [agent_folder]/MEMORY.md identity and personality
✅ [agent_folder]/MEMORY-INDEX.md memory index
✅ [agent_folder]/CLONE.md this manifest
✅ [agent_folder]/memory/ {N} files
✅ onebrain.yml vault configuration
✅ .claude/plugins/onebrain/ OneBrain plugin
❌ notes, projects, areas, knowledge, resources, archive, logs
Step 3: Ask Clone Method
Ask:
How would you like to clone?
- Folder copy : I'll create
agent-clone-YYYY-MM-DD/in your vault root with all files ready to copy- Display paths : I'll list the file paths so you can copy them manually
Step 4a: Folder Copy
If the user chose option 1:
- Determine output folder:
agent-clone-YYYY-MM-DD/ - If that folder already exists, append a counter:
agent-clone-YYYY-MM-DD-02/,-03/, etc. Keep incrementing until you find a name that does not exist. - Create the output folder
- Copy the following into the output folder, preserving all subfolders and files:
- Entire
[agent_folder]/to[output_folder]/[agent_folder]/(including CLONE.md, MEMORY.md, MEMORY-INDEX.md, memory/) onebrain.ymlto[output_folder]/onebrain.yml.claude/plugins/onebrain/to[output_folder]/.claude/plugins/onebrain/- If archive included:
[archive_folder]/[agent_folder]/memory/to[output_folder]/[archive_folder]/[agent_folder]/memory/
- Entire
- Confirm:
✅ Agent context ready at
{output_folder}/. Copy its contents to your new vault root to restore context. Prerequisite: new vault must have OneBrain installed before importing. → To import: place[agent_folder]/at the vault root — MEMORY.md is inside.
Step 4b: Display Paths
If the user chose option 2:
Print a markdown code block listing every file's relative path:
[agent_folder]/MEMORY.md [agent_folder]/MEMORY-INDEX.md [agent_folder]/CLONE.md [agent_folder]/memory/[each file] onebrain.yml .claude/plugins/onebrain/
Then say:
Copy the listed files/folders to your new vault root. Your new vault needs to have OneBrain installed for the agent to work.
Step 5: Write Log Entry
Follow ../_shared/audit-log-format.md (canonical frontmatter, append-per-day algorithm, run-section heading, failure mode) with:
- Filename:
YYYY-MM-DD-clone.md— one file per day. Applies to both Step 4a (Folder Copy) and Step 4b (Display Paths). - Tags:
[audit-log, clone] - Skill:
/clone - Per-skill discriminators in frontmatter:
method: folder-copy | display-paths,include_archive: true | false
Per-skill body template (canonical ## Run HH:MM heading; metadata in first bullet):
markdown## Run HH:MM - Method: folder-copy - Source vault: /path/to/source/vault - Destination: /path/to/destination/ - Files copied: N - Memory bundle: included (12 files)
For Step 4b (Display Paths), set Method: to display-paths, Destination: to (paths displayed only — no copy performed), and Files copied: to 0.
Known Gotchas
-
search.collectioninonebrain.ymlis vault-specific. When cloning to a new vault, thesearch.collectionvalue (or a legacy top-levelqmd_collection) will point to the old vault's collection. The user must set up the search index for the new vault (via theonebrainCLI or the web service) to create a collection for the new vault and updateonebrain.ymlaccordingly. -
Cloned memory/ files reference project paths from the old vault. Project-type memory files may contain file paths (e.g., repo locations) that differ in the new environment. Run
/memory-reviewafter cloning to audit and update any path-specific facts.


