# CodeGraph: Supercharge AI Coding Agents with Semantic Code Intelligence

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/colbymchenry-codegraph
Generated for open source discovery and AI-assisted research.

CodeGraph is a powerful, pre-indexed code knowledge graph designed to enhance AI coding agents like Claude Code, Cursor, and Codex. It significantly reduces token usage and tool calls, offering a faster and more cost-effective way for agents to understand codebases. This 100% local solution provides semantic code intelligence, improving agent efficiency and accuracy.

GitHub: https://github.com/colbymchenry/codegraph
OSRepos URL: https://osrepos.com/repo/colbymchenry-codegraph

## Summary

CodeGraph is a powerful, pre-indexed code knowledge graph designed to enhance AI coding agents like Claude Code, Cursor, and Codex. It significantly reduces token usage and tool calls, offering a faster and more cost-effective way for agents to understand codebases. This 100% local solution provides semantic code intelligence, improving agent efficiency and accuracy.

## Topics

- TypeScript
- AI Agent
- Code Analysis
- Knowledge Graph
- Developer Tools
- Productivity
- Local-first
- Open Source

## Repository Information

Last analyzed by OSRepos: Mon May 25 2026 20:57:24 GMT+0100 (Western European Summer Time)
Detail views: 16
GitHub clicks: 9

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## Introduction

CodeGraph is a powerful, pre-indexed code knowledge graph designed to supercharge AI coding agents such as Claude Code, Cursor, Codex, OpenCode, and Hermes Agent. By providing semantic code intelligence, CodeGraph allows these agents to understand codebases more efficiently, leading to significantly fewer tokens consumed and fewer tool calls. This 100% local solution processes symbol relationships, call graphs, and code structure, enabling agents to query an instant knowledge graph rather than scanning files.

## Installation

Getting started with CodeGraph is straightforward, with no Node.js required for the bundled runtime.

**For macOS / Linux:**
bash
curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh


**For Windows (PowerShell):**
powershell
irm https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.ps1 | iex


If you already have Node.js, you can use npm:
bash
npx @colbymchenry/codegraph        # zero-install
# or
npm i -g @colbymchenry/codegraph


After installation, initialize your project:
bash
cd your-project
codegraph init -i

This command builds the per-project knowledge graph index and configures any project-local agent surfaces.

## Examples

CodeGraph provides a rich command-line interface for interacting with your codebase's knowledge graph.

**Initialize a project:**
bash
codegraph init -i


**Search for symbols by name:**
bash
codegraph query UserService --kind class --json


**Build context for AI agents based on a task:**
bash
codegraph context "fix login bug" --format markdown --max-nodes 20


**Find test files affected by changes:**
bash
git diff --name-only | codegraph affected --stdin --quiet


## Why Use CodeGraph

CodeGraph dramatically improves the efficiency and cost-effectiveness of AI coding agents. When an agent like Claude Code explores a codebase, it typically spawns "Explore agents" that scan files, consuming tokens with every tool call. CodeGraph replaces this with a pre-indexed knowledge graph, allowing agents to query instantly.

**Key Benefits from Benchmarks:**
Across 7 real-world open-source codebases, CodeGraph delivered an average of:
*   35% cheaper
*   57% fewer tokens
*   46% faster
*   71% fewer tool calls

**Key Features:**
*   **Smart Context Building:** Returns entry points, related symbols, and code snippets in one tool call, eliminating expensive exploration.
*   **Full-Text Search:** Instantly find code by name across your entire codebase.
*   **Impact Analysis:** Trace callers, callees, and the full impact radius of any symbol before making changes.
*   **Always Fresh:** Uses native OS file events for debounced auto-sync, keeping the graph current as you code with zero configuration.
*   **19+ Languages:** Supports a wide array of languages including TypeScript, Python, Go, Rust, Java, C#, and many more.
*   **Framework-aware Routes:** Recognizes web-framework routing files and links URL patterns to their handlers across 14 frameworks.
*   **100% Local:** No data leaves your machine, no API keys, no external services, relying solely on a local SQLite database.

## Links

*   [Official Documentation & Website](https://colbymchenry.github.io/codegraph/)
*   [GitHub Repository](https://github.com/colbymchenry/codegraph)