colbymchenry/codegraph
codegraph
Pre-indexed code knowledge graph for Claude Code, Codex, Gemini, Cursor, OpenCode, AntiGravity, Kiro, and Hermes Agent — fewer tokens, fewer tool calls, 100% local.
Một repo trên github tạo ra một bản đồ code để AI Agent có thể dựa vào đó để có một cái nhìn tổng quan về code base. Truy cập nhanh và chính xác những phần code cần để sử dụng, không tìm kiếm lan man gây tốn token.
Codegraph làm việc với AI Agent thông qua MCP.
Có nhiều trường hợp AI Agent vẫn tự động dò code thay vì sử dụng codegraph. Để khắc phục mình thêm một phần vào guidelines của AI Agent.
Guidelines
## Code exploration
- ALWAYS prefer using the **codegraph** MCP tools (`codegraph_context`, `codegraph_search`, `codegraph_trace`, `codegraph_explore`, `codegraph_node`) to understand, navigate, and trace code whenever codegraph is available for the project (i.e. `.codegraph/` is indexed).
- Reach for raw Read/Grep/Glob exploration only to confirm a specific detail codegraph didn't cover, or when codegraph is not available for the current project.
Cách sử dụng cơ bản.
# 1. Install the CLI (one-time)
**No Node.js required** — one command grabs the right build for your OS:
```bash
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.ps1 | iex
```
# 2. Wire up your agent(s) (one-time)
In a **new terminal**, run the installer to connect CodeGraph to the agents you use:
```bash
codegraph install
```
# 3. Work (each project)
```bash
cd your-project
codegraph init -i
```
```bash
codegraph status
```
# 4. Uninstall
```bash
codegraph uninstall
```
Chú ý khác
Bạn không cần chạy codegraph sync thủ công trong phiên làm việc của agent. Khi AI Agent khởi chạy codegraph serve --mcp, chúng sẽ phối hợp để giữ cho index luôn đồng bộ với code - và không bao giờ đưa ra câu trả lời sai cho AI Agent.