Skip to content

Commit 0d2de67

Browse files
committed
doc(persist-claude-mem): add README
Explains volume naming, symlink behavior, backup on collision, and host isolation from the claude-mem MCP server process.
1 parent 4620fe9 commit 0d2de67

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

src/persist-claude-mem/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Persist claude-mem knowledge base (persist-claude-mem)
2+
3+
Mounts a named Docker volume at `~/.claude-mem` so the [claude-mem](https://github.com/NicolasMassart/claude-mem) knowledge base survives container rebuilds without conflicting with the host claude-mem MCP server process.
4+
5+
## Example Usage
6+
7+
```json
8+
"features": {
9+
"ghcr.io/ckagerer/devcontainer-features/persist-claude-mem:0": {}
10+
}
11+
```
12+
13+
## How It Works
14+
15+
During build, the feature mounts a named Docker volume at `/.persist-claude-mem`. On first container start, `postCreateCommand` runs an init script that symlinks `~/.claude-mem -> /.persist-claude-mem`.
16+
17+
Volume name pattern:
18+
19+
```
20+
devcontainer-<workspaceFolderBasename>-persist-claude-mem-<devcontainerId>
21+
```
22+
23+
Each workspace gets its own volume, so knowledge bases from different projects stay isolated.
24+
25+
If `~/.claude-mem` already exists as a real directory when the container starts, the init script backs it up with a timestamp (`~/.claude-mem.pre-persist.<epoch>`) before creating the symlink.
26+
27+
## Notes
28+
29+
### Host isolation
30+
31+
The volume mounts at `/.persist-claude-mem`, not directly at `~/.claude-mem`. This keeps the container's knowledge base on a separate filesystem path from the host's `~/.claude-mem`, so the host claude-mem MCP server process never reads from or writes to the container volume.

0 commit comments

Comments
 (0)