Skip to main content

Change Data Capture for AI-assisted codebases. Keeps context files alive as your code evolves.

Project description

🧠 ContextMesh

The Change Data Capture (CDC) engine for AI Context. Stop feeding your agents stale docs.


If your AI coding agents (Claude Code, Cursor, Devin) are hallucinating import paths or struggling with multi-file refactors, it's because static context files rot.

ContextMesh is an active, ast-aware framework that monitors your codebase and surgically patches CONTEXT.md files as you code, ensuring your AI always has 100% accurate, hierarchical understanding of your repository.

It is not a scraper. It is a real-time CDC engine.


🚀 The 10x Claim (Benchmarks vs Static Scrapers)

We tested ContextMesh against monolithic generation approaches (e.g., Graphifyy) on a massive Django codebase:

  1. 💸 99% Cheaper per Commit: Because ContextMesh uses surgical AST Diff-patching (--from HEAD~1), updating a core feature cost 4,275 tokens ($0.00). Re-running a traditional scraper on a large repo takes ~2,000,000 tokens.
  2. ⚡ Native IDE Speeds: Full scaffold takes several minutes. Evaluating a local save takes ~1.2 seconds.
  3. 🛡️ 100% Elimination of Context Drift: Our contextmesh validate engine parses the entire hierarchy. During testing, it caught 34 semantic drift issues (missing children directories, broken lateral links) that markdown scrapers missed entirely.

🔥 Features

  • Ghost Watcher Daemon: Run contextmesh watch (or use the VSCode extension) and it will debounce filesystem events, automatically patching context files in the background without user intervention.
  • Hierarchical Context Tree: Builds a parent-child mesh of CONTEXT.md files so your AI understands local logic and horizontal dependencies (e.g. auth depends on database).
  • VSCode Extension & MCP Server: Don't like CLI tools? Use the VSCode Extension! It natively bridges to the Engine via the Model Context Protocol (MCP), giving Cursor/Claude Code native access to Health Scores and Auto-Fix capabilities.

🛠️ Usage

CLI Installation

pipx install contextmesh-cli
contextmesh init

1. Scaffold your Project

# Generate the semantic mesh for the first time
contextmesh scaffold .

2. Auto-Maintain (The Ghost Watcher)

# Run this, and never worry about context decay again.
contextmesh watch

3. Native IDE Integration (MCP)

ContextMesh acts as a standard MCP server. You can allow Cursor/Claude to natively invoke health checks and context regeneration via STDIO:

{
  "mcpServers": {
    "contextmesh": {
      "command": "contextmesh",
      "args": ["mcp-serve"]
    }
  }
}

🧠 Architecture

  1. Diff Analyzer: Catches filesystem or git changes.
  2. Salience Classifier: Rejects trivial changes (e.g., changing a string). Only passes structural AST changes.
  3. LLM Patcher: Surgically modifies exactly the portion of the CONTEXT.md that changed.
  4. Cross-Doc Validator: Runs rules over the tree to ensure parents don't hallucinate missing children.

🤝 Next.js / Cloud Dashboard

Coming soon in Phase 4 for enterprise governance and tracking team context-health.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contextmesh_cli-0.1.0.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contextmesh_cli-0.1.0-py3-none-any.whl (48.5 kB view details)

Uploaded Python 3

File details

Details for the file contextmesh_cli-0.1.0.tar.gz.

File metadata

  • Download URL: contextmesh_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 36.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for contextmesh_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7ddac8c9a9510e491297b38bc83e4dbb92348eb728536cf65fa18007b863ae6a
MD5 9e1114b483d464b57c789af5916a83fb
BLAKE2b-256 4caabae10b176b0e01c9fb591019aefc6c2f3697fc65eb641653cba37f16a33e

See more details on using hashes here.

File details

Details for the file contextmesh_cli-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for contextmesh_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca0dcce106a522614529d7f9685e867678238d5b910336e7bcd2da1539c05a12
MD5 05f5beb0f9de2a5d6cf95482595061a8
BLAKE2b-256 86670c0adfdbe5b2ae113abed2a53b21f7fa47ea9940e22b1668bb1830a6860f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page