letta-ai/letta-code/managing-shared-memory
- community
Checking that the SKILL.md file is still in the repository.
Create and manage shared memory — git-tracked repositories hosted on Letta Cloud that are attached to one or more agents and projected into their filesystems. Use when the user wants to share memory or files across agents, store context outside your own MemFS, attach or detach shared memory, or inspect its file history.
Install
npx vskill@latest install letta-ai/letta-code/managing-shared-memorySKILL.md
Managing Shared Memory
Shared memory is memory created independently of any single agent, designed to be dynamically attached to or detached from multiple agents. Each unit of shared memory is a shared memory repository: a git repository hosted on Letta Cloud, owned by your organization rather than by one agent, reachable from any environment (sandboxes, remote machines, sessions).
Shared memory works like your MemFS: attached repositories are real git checkouts on disk, and you read, edit, and commit with ordinary git. The harness pushes clean committed changes after each turn. Each repository has its own projection root (next to your memory directory, not inside it) and its own remote origin, and other agents may be writing to it too.
Create a shared memory repository when:
- You have context an agent should be able to access that doesn't belong in its own MemFS (input files, datasets, docs, working artifacts)
- Multiple agents need to read or write the same context
- You want a versioned file store that survives across environments and sessions
Working with Files (the normal path)
Attached shared memory is mounted next to your memory directory, one git checkout per repository:
Edit files with your normal file tools, then commit with git. The mount's origin and credentials are already configured:
The harness pushes clean commits from read/write attached repositories after the turn. If a push collides with another agent's work, it pulls with rebase and retries once. Dirty files and conflicts are not changed automatically; the harness adds a reminder to the next turn instead.
To pick up other agents' changes:
If a push is rejected (another agent pushed first), git pull --rebase then push again.
History is ordinary git history:
Managing Repositories (create / attach / detach)
Use the letta shared-memory subcommand. It uses your harness auth (works even when LETTA_API_KEY is not in the shell env) and inherits the agent id from AGENT_ID, so --agent is only needed when targeting another agent.
Troubleshooting
- Prompt lists a repository but `$MEMORY_DIR/../<name>` is missing — the repository was attached without materializing the mount. Run
letta shared-memory sync. - `sync` reports "mount path already exists and is not a git repository" — a plain directory (usually created by hand before the mount existed) is occupying the mount path. Inspect it, salvage anything worth keeping, move or delete it, then re-run
letta shared-memory sync. - Never hand-clone the repository to another location (e.g. /tmp) to work around a broken mount — fix the mount with
letta shared-memory syncso every session and other agents see the same checkout. - Permission denied under another agent's directory — shared repositories mount per-agent. Only your own mount (under your agent directory) is accessible; another agent's mount of the same repository is walled off by the cross-agent guard. Run
letta shared-memory syncto get your own mount. - Shared-memory conflict reminder — resolve the conflict in the named repository, finish the rebase or commit, and leave the repository clean. The harness retries the push after a future turn.
Notes and Limits
- Shared memory is not part of your system prompt. Writing to it does not change your in-context memory — for that, edit your memory blocks or MemFS files.
- Attaching is asynchronous on the server;
letta shared-memory attachwaits for the attachment to be visible before cloning. - SDK/API equivalent for programmatic callers:
@letta-ai/letta-agent-sdkexposes these operations asclient.repositories(withfilesandversionshelpers), and shared memory can be attached for a session's lifetime viaresources: [{ type: "repository", repositoryId }]on cloud sessions. The REST resource is/v1/repositories.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/skills/builtin/managing-shared-memory/SKILL.md
Popularity
- Repository stars
- 3,109
- Repository forks
- 369
- 7-day trend score
- 40
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/letta-ai/letta-code/managing-shared-memory)