Skip to content

Persistence feature (persistence: true) not working on Windows #400

@sam-data-guy-iam

Description

@sam-data-guy-iam

Hi I am trying to implement the local persistent index (.codebase-memory/graph.db.zst) for committing to the repository. I am unable to repreoduce this on Windows, I am unsure whether it is Mac only or if there are settings that are needed to make sure it works properly.

Persistence feature (persistence: true) not working on Windows

Environment

  • OS: Windows 11
  • Shell: PowerShell
  • Version: codebase-memory-mcp v0.7.0
  • Installation: Binary from GitHub releases (codebase-memory-mcp.exe)
  • Storage: Repo-local via CBM_CACHE_DIR=".codebase-memory"

Expected Behavior

According to the index_repository tool schema, setting persistence: true should:

Write compressed artifact to .codebase-memory/graph.db.zst for team sharing. Teammates can bootstrap from the artifact instead of full re-indexing.

The response should show artifact_present: true after indexing.

Actual Behavior

  • artifact_present: false in all responses
  • No .codebase-memory/graph.db.zst file created
  • Only the standard .db file is created (path-based naming)

Reproduction Steps

1. Set environment variables

$env:CBM_CACHE_DIR = ".\.codebase-memory"
$env:CBM_PERSIST_EXPORTS = "true"

2. Index with persistence enabled

$repoPath = (Get-Location).Path.Replace('\', '/')
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"index_repository","arguments":{"repo_path":"'$repoPath'","paths":["src","tests"],"include_patterns":["*.py","*.yaml","*.yml","*.json","*.md",".env*"],"persistence":true}}}' | codebase-memory-mcp

3. Check response

{
  "project": "C-Users-username-path-to-repo",
  "status": "indexed",
  "nodes": 11557,
  "edges": 20708,
  "artifact_present": false  // ❌ Expected true
}

4. Check files created

Get-ChildItem -Path ".\.codebase-memory" -Filter "*.zst"
# Returns: No files found

Only these files exist:

  • C-Users-username-path-to-repo.db (32 MB) - Standard database
  • _config.db (12 KB) - Config database
  • No .zst artifact file

What We Tried

  1. With CBM_PERSIST_EXPORTS=true - No effect
  2. With persistence: true parameter - No .zst file created
  3. Different storage locations - Same result in both repo-local and AppData
  4. Multiple indexing attempts - Consistent behavior across all attempts

Suspected Root Cause

The persistence/artifact feature may be:

  1. Platform-specific - Only implemented for Linux/Mac (uses Unix-specific compression tools?)
  2. Path-related - Windows path format (C:\...) might break the artifact naming/creation logic
  3. Missing dependency - Windows binary might be missing zstd compression support

Impact

Without portable artifacts:

  • Teams cannot share pre-built knowledge graphs
  • Each developer must re-index (~8 seconds per repo)
  • Path-based database naming prevents committing databases to git
  • Workaround: Accept local re-indexing or coordinate on standardized absolute paths

Additional Context

The tool successfully creates and queries the knowledge graph (11,557 nodes, 20,708 edges). Only the persistence/artifact export feature is affected.

Would appreciate clarification on:

  1. Is this feature expected to work on Windows?
  2. Are there additional dependencies needed for Windows?
  3. Is there a workaround or alternative approach for team sharing?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwindowsWindows-specific issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions