Migrate memory blocks from an existing agent to the current agent. Use when the user wants to copy or share memory from another agent, or during /init when setting up a new agent that should inherit memory from an existing one.
View on GitHubJanuary 24, 2026
Select agents to install to:
npx add-skill https://github.com/letta-ai/letta-code/blob/9659fa32e8340353eed8c2443a50033f2bd427eb/src/skills/builtin/migrating-memory/SKILL.md -a claude-code --skill migrating-memoryInstallation paths:
.claude/skills/migrating-memory/# Migrating Memory This skill helps migrate memory blocks from an existing agent to a new agent, similar to macOS Migration Assistant for AI agents. ## When to Use This Skill - User is setting up a new agent that should inherit memory from an existing one - User wants to share memory blocks across multiple agents - User is replacing an old agent with a new one - User mentions they have an existing agent with useful memory ## Migration Methods ### 1. Manual Copy (Recommended for partial content) If you only need **part** of a source block, or the source is messy and needs cleanup: 1. Use `get-agent-blocks.ts` to view the source block's content 2. Use the `memory` tool to create a new block with just the content you want 3. No scripts needed - you have full control over what gets copied Best for: Extracting sections, cleaning up messy content, selective migration. ### 2. Script Copy (Full block duplication) Creates new blocks with the same content using `copy-block.ts`. After copying: - You own the copy - changes don't sync - Best for: One-time migration, forking an agent ### 3. Share (Linked Blocks) Attaches the same block to multiple agents using `attach-block.ts`. After sharing: - All agents see the same block content - Changes by any agent are visible to all others - Can be read-only (target can read but not modify) - Best for: Shared knowledge bases, synchronized state ## Handling Duplicate Label Errors **You cannot have two blocks with the same label.** If you try to copy/attach a block and you already have one with that label, you'll get a `duplicate key value violates unique constraint` error. **Solutions:** 1. **Use `--label` (copy only):** Rename the block when copying: ```bash npx tsx <SKILL_DIR>/scripts/copy-block.ts --block-id <id> --label project-imported ``` 2. **Use `--override` (copy or attach):** Automatically detach your existing block first: ```bash npx tsx <SKILL_DIR>/scripts/copy-block.ts --block-id <id> --override
Issues Found: