Show Forum: ContextMesh – A local Git-CDC tool to keep your .cursorrules & context files 100% in sync (100% local, linter included)

Hey everyone,

If you’ve spent any time working on a fast-moving codebase with Cursor, you’ve probably hit the “Context Wall.”

At first, Cursor writes perfect code. But as your codebase evolves—renaming utility methods, refactoring endpoints, or changing schemas—your `.cursorrules` and `CONTEXT.md` files silently rot. The next time you ask Cursor to implement a feature, it reads your stale context, hallucinates old class signatures, and writes broken code.

Standard scrapers try to fix this by blindly regenerating the entire repository into a monolithic markdown file. It’s slow, monolithic, and burns through thousands of LLM tokens on every single save.

So, I built **ContextMesh** (an open-source project).

It’s a lightweight, local-first Python CLI that acts as a real-time **Change Data Capture (CDC)** engine for your AI context files:

* **Surgical CDC Engine**: It hooks into your git staging area. It uses a lightweight local salience classifier to detect structurally significant changes (like a new class or function signature) and uses a fast LLM call to surgically patch only the affected `CONTEXT.md` files. This reduces context LLM costs by 99% ($0.005 vs $1.50 per commit).

* **Context Linter (`contextmesh lint`)**: Pre-commit hook that audits your context files against your actual codebase. If you rename a class or function in your source code, the linter will instantly catch and flag the stale references in your context files before your AI reads them.

* **Zero-Server Offline visualizer**: No port-hogging background servers. Running `contextmesh visualize` generates a standalone, glassmorphic HTML report (`.contextsync/visualizer.html`) that opens instantly in your browser to show your active context tree.

* **MCP Server Included**: Exposes hierarchical directories and codebase health metrics straight to your Cursor Composer/Chat via the Model Context Protocol.

### The Benchmarks

We ran this on a large Django codebase:

* **Token Cost (Single Commit)**: ~800 tokens ($0.005) vs ~200,000 ($1.50) using monolithic scrapers.

* **Latency**: ~1.2 seconds in background git hooks vs 45+ seconds.

* **Drift Detection**: Caught 100% of stale function and class references in markdown context.

### Try it in 60 seconds

pip install contextmesh-cli

contextmesh init

contextmesh scaffold

contextmesh lint

contextmesh visualize

GitHub: https://github.com/Katukam-Anuroop/ContextMesh PyPI: https://pypi.org/project/contextmesh-cli/

This is my first open-source project! I would love for you to run the visualizer or linter on your project and give me your brutal feedback. If you like it, a star on GitHub would mean the world! :star: