$ show colbymchenry/codegraph
CodeGraph is a local-first, cross-language code intelligence engine designed to give AI coding agents structured knowledge of a codebase: symbols, references, call graphs, import graphs, inheritance, routes, and framework-specific dynamic dispatch. It indexes source with tree-sitter WASM grammars (or an optional native Rust kernel for speed), stores the resulting graph in SQLite with FTS5, then resolves cross-file references and synthesizes edges for indirect patterns like web frameworks, DI containers, callbacks, and event dispatch. The primary interfaces are a CLI (codegraph), an MCP server exposing tools for agents, an embeddable programmatic API, and a Svelte web viewer.
The LLM identified 6 files worth highlighting for reuse:
Provides a reusable createYielder utility that periodically yields to the Node.js event loop during long synchronous work, preventing watchdog timeouts and keeping daemons responsive. Generic and easily extracted into any long-running batch processing or indexing pipeline.
A tight, self-contained LRU cache implementation using Map insertion order for guaranteed eviction. Suitable for any Node/TypeScript project needing bounded in-memory caching without pulling in a dependency.
Implements safe, bounded reading of source files with stat-and-read TOCTOU protection and an oversize stamp to avoid re-reading huge files. Directly reusable in any code analysis or data ingestion tool that must avoid OOM on pathological inputs.
Language-aware comment stripper that removes comments without fully parsing the source, enabling accurate regex-based discovery of framework routes and registries. Reusable for any tool needing comment-free source text across many languages with correct string/comment boundary handling.
A safe worker termination utility for Node.js Worker threads that avoids Windows V8 concurrent-marker crashes by coordinating termination with the worker's first message. Generic for any Node multi-threaded application needing reliable worker cleanup.
Detects parent process death on POSIX (via PPID reparenting) and Windows (via liveness polling), enabling daemons and long-lived servers to shut down when their parent disappears. Reusable for any local server, daemon, or CLI subprocess supervision pattern.