# CodeStory

> Local, graph-backed code intelligence engine for coding agents that pre-indexes repositories into a knowledge graph to reduce tokens, tool calls, and guesswork.

CodeStory is an open-source codebase grounding engine written in Rust that pre-indexes a local repository into a knowledge graph enriched with semantic context. It is designed to be paired with coding agents such as Codex, Cursor, Claude Code, and GitHub Copilot, running entirely on-device with no data leaving the machine.

## What It Is

CodeStory gives coding agents a read-only, deterministic map of a repository — files, symbols, call paths, snippets, and bounded answer packets with source citations — so agents can plan, review, and edit from concrete evidence rather than guessing from partial file reads. The project describes itself as "local code intelligence for coding agents" and is licensed under Apache-2.0.

## How It Works

CodeStory pre-indexes a checkout into a graph structure using tree-sitter for static analysis and semantic search. When an agent session starts, it checks CodeStory's status, grounds the checkout, and then queries the graph instead of re-reading raw source files. Key surfaces exposed to agents include:

- **Symbol and call-path lookup** — find where a feature is defined and who calls it
- **Ownership and impact queries** — identify which files and tests are affected by a change
- **Subsystem explanations** — describe how a subsystem works with citations and explicit uncertainty flags
- **Bounded answer packets** — structured responses that flag gaps when coverage is incomplete

## Evaluation Evidence

The README documents a language-expansion holdout benchmark across 18 pinned public OSS tasks. According to the project's own recorded suite totals, using CodeStory versus not using it produced: context tokens reduced by 43% (9.69M → 5.51M), repeat-task wall time reduced by 45% (7,943s → 4,343s), tool calls reduced by 87% (475 → 60), and direct source reads reduced by 100% (417 → 0). The README notes this holdout "does not prove equal quality for every language, every repo size, or your private checkout."

## Supported Hosts and Setup Path

CodeStory ships host-specific guides for four coding agent environments:

- **Codex** — listed as the recommended first install
- **Cursor**
- **Claude Code**
- **GitHub Copilot**

Setup involves installing a plugin or adapter once, approving hooks when the host prompts, opening the target repository, and starting a fresh agent session. Normal use requires no CLI commands; a CLI reference exists for repair and debug scenarios.

## Update: v0.13.0

The latest release is v0.13.0, published on 2026-06-30, with the repository last pushed on the same date. The project was created in February 2026 and has been actively developed since, with the primary language being Rust (2024 edition). GitHub topics on the repository include `ai-agents`, `code-graph`, `code-intelligence`, `code-search`, `knowledge-graph`, `llm-context`, `semantic-search`, `static-analysis`, and `tree-sitter`.

## Features
- Graph-backed local code intelligence
- Pre-indexes repository into a knowledge graph
- Symbol and call-path lookup
- Source citations with explicit uncertainty flags
- Bounded answer packets for agents
- 100% local — no data leaves the machine
- Read-only repository map for coding agents
- Subsystem explanation with gap flagging
- Static analysis via tree-sitter
- Semantic search over codebase
- CLI reference for repair and debug
- Host-specific guides for Codex, Cursor, Claude Code, and GitHub Copilot

## Integrations
Codex, Cursor, Claude Code, GitHub Copilot

## Platforms
CLI, API

## Pricing
Open Source

## Version
v0.13.0

## Links
- Website: https://github.com/TheGreenCedar/CodeStory
- Documentation: https://github.com/TheGreenCedar/CodeStory/blob/main/docs/users/README.md
- Repository: https://github.com/TheGreenCedar/CodeStory
- EveryDev.ai: https://www.everydev.ai/tools/codestory
