Skip to content

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

Closed

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!

Activity

  1. added
    bugSomething isn't working
    windowsWindows-specific issues
    on Jun 6, 2026
  2. DeusData commented on Jun 6, 2026

    @DeusData
    Owner

    Thanks — good instinct checking whether it's macOS-only. The compressed artifact is written to <repo>/.codebase-memory/graph.db.zst (relative to the indexed repo, independent of CBM_CACHE_DIR), and the export path logs a specific error on each failure mode. To pin down the Windows behavior, could you share:

    1. The full index_repository response JSON for the persistence: true call — especially status and artifact_present.
    2. Whether the <repo>\.codebase-memory\ directory is created at all, and whether graph.db.zst (or a stray cbm_artifact_tmp.db) appears.
    3. Verbose stderr during that index — paste any artifact.export / artifact.* warning or error line.
    4. Confirm persistence: true was passed in the index_repository arguments (not just present in the tool schema).

    The exporter logs artifact.export err=… at each step (temp-DB open, VACUUM INTO, read), so (3) should point straight at the Windows-specific failure.

  3. armandn commented on Jun 17, 2026

    @armandn

    I'm having the same issue on windows.

    index_repository response:

    {"project":"[Redacted]","status":"indexed","excluded":{"dirs":[".claude",".git",".idea","coverage","dist","logs","node_modules","tests"],"count":8,"truncated":false},"nodes":1866,"edges":5340,"adr_present":true,"artifact_present":false}
    

    .codebase-memory exists but contains only ADR.md.

    Could not see any errors,

    I tried running CLI with codebase-memory-mcp cli index_repository '{"repo_path": "D:\\...", "persistence":true}' but I keep getting repo_path is required

  4. mvanhorn commented on Jun 17, 2026

    @mvanhorn
    Contributor

    Implemented in #486 - fix: Surface a real error when persistence artifact export silently fails on Win.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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