Overview
What is Codegenome?
Codegenome scans source files in your workspace, extracts symbols (functions, classes, modules) and relationships (imports, calls, inheritance), and stores the result as a directed knowledge graph. That graph powers:
- CLI workflows — analyze, export, watch, and query from the terminal
- Terminal UI (TUI) — explore architecture interactively
- MCP server — expose graph intelligence to Cursor, Copilot, Claude, and other agents
- Exports — JSON, HTML, Markdown, GraphML, Cypher, Obsidian vaults
How it works
- Scan — walk the workspace (respecting
.gitignore) - Parse — tree-sitter ASTs for Python, JavaScript, TypeScript, Go, Rust, and more
- Build — incrementally merge nodes and edges into a graph store
- Persist — snapshot timeline data in SQLite under
.genome/watcher.db - Serve — MCP tools answer structural questions for agents
When to use it
- Onboarding — trace modules and entry points instead of reading every file
- Refactoring — find god nodes, circular dependencies, and dead code
- Agent guardrails — give LLMs accurate import/call context via MCP
- CI / headless — build and export graphs without an IDE
Two ways to invoke the CLI
The project provides a modern Click subcommand CLI (recommended):
codegenome analyze . codegenome export --format json --path . codegenome mcp-start
It also ships a legacy flag-based CLI for power users and automation:
python -m codegenome --workspace . --build --watch --mcp
See Legacy flag CLI for the full flag list. Do not mix subcommands with legacy flags in one invocation.