Cairnmind

Use Case 03 · Local-First Code Graph & Privacy

Local Multi-Language Code Graph (Tree-sitter + SCIP) & Egress Control

The engineering problem

Cloud code-indexing tools upload entire proprietary repositories and chat transcripts to third-party servers, while basic local grep lacks symbol dependency graphs, blast-radius analysis, and semantic recall.

How Cairnmind enforces a better boundary

  • Tree-sitter analyzes Python, JavaScript, and TypeScript directly, while Cairnmind’s asynchronous SCIP worker indexes Go, Rust, Java, Kotlin, C, C++, C#, PHP, and Ruby into the same local ArcadeDB code graph (defines, imports, calls, references, test_imports).
  • Hybrid RAG + GraphRAG fuses BM25 full-text search, HNSW vector embeddings, definition lookups, and graph traversal locally on your workstation, or runs in zero-LLM deterministic-only mode.
  • Registered secrets and high-entropy tokens are masked before indexing or transcript import. Cairnmind also respects .cairnmindignore and .gitignore automatically.
  • When you optionally connect hosted models or built-in API agents, memory_remote_classes (default ["project"]) automatically holds back private conversation and third-party sources.

Concrete workflow

1. Inspect topology and data-egress boundaries

$ cairnmind setup --json

Reports where storage runs, where each model runs, and whether any memory text leaves your machine.

2. Check multi-language SCIP indexers

$ cairnmind scip status --json

Lists detected repository languages and background SCIP indexer readiness (auto, manual, or off).

3. Measure blast radius before merging changes

$ cairnmind impact my-app --json

Finds stored decisions, constraints, and docs potentially affected by modified symbols and files since HEAD.

4. Optional remote DB or Kubernetes deployment

$ cairnmind setup remote-db --url https://… --password-file ~/.secrets/db

Connects securely over TLS with private 0600 credential files (never passing passwords on CLI arguments).

Mechanically Enforced

What is guaranteed

  • Zero telemetry, zero cloud lock-in, and explicit --allow-remote + HTTPS consent required before any model call leaves loopback.
  • Single-writer database locking prevents concurrent installations from corrupting a shared store.
  • No third-party plugin code is ever loaded inside a Cairnmind process.
Honest Boundaries

Known limits

  • Static analysis covers 12 languages via Tree-sitter + SCIP. Dynamic runtime calls cannot be resolved statically, and other languages stay searchable as text.
  • Hosted coding clients (Codex CLI, Claude Code, external MCP) still send whatever they read to their own model provider.

Related documentation

More use cases