Skip to main content

Codebase Context

Your coding agent doesn't understand your codebase.

A local MCP server and CLI that indexes your repository using Tree-sitter AST parsing and local embeddings. It returns bounded source files, symbol graphs, and recorded team decisions directly into Claude Code, Codex CLI, Cursor, or OpenCode.

Runs locally via Model Context Protocol (stdio/local JSON-RPC). Indexing and search stay entirely on-device by default.

investigation-simulation.mcp
100% Local MCP · LanceDB + Tree-sitter
TASK:PonyC bugfix #2228: Partial calls in inherited traits

Lane A: Raw Native Grep

21 steps · 7 full files opened
Searching...
Tokens Read:0
Steps / Time:1 / 21 steps · 0m 00s

1. rg -n "partial call|inherited trait" . (48 matches across 14 files)

Agent wanders through broad regex matches before isolating call sites.

Lane B: Codebase Context MCP

12 steps · 2 targeted files edited
-65.8% Tokens
Tokens Read:0 (-65.8%)
Steps / Time:1 / 12 steps · 0m 00s

1. codebase_context.search("partial calls inherited traits", intent="edit")

Targeted AST slice retrievalZero cloud leak · On-device
Simulating agent investigation...
Recorded from ContextBench task #2228 (PonyC trait method inheritance). Single-task trace illustrates token reduction mechanics; benchmark page reports 20-task local retrieval medians.

Setup

Add it to your coding agent

Choose your coding tool and copy the command or config.

Claude Code

CLI command

claude mcp add --scope user codebase-context -- npx -y codebase-context

This adds a user-level server. Claude Code may ask you to approve it for the current project.

Client docs ↗

Surface repository conventions alongside matching code.

Queries return the relevant components, state management rules, and past architectural decisions already established in the repository.

Task

Find where authentication is handled

angular-spotify

Files to inspect

most likely first
01
unauthorized-modal.component.ts

UI shown when authorization fails

1.00
02
store/auth.store.ts

Authentication state and token handling

1.00
03
models/spotify-authorize.ts

Authorization request model

0.95

Conventions used here

Components
Standalone
State
RxJS
Reactivity
Effect

Existing example to follow

card.component.ts

Related past decision

Handle refresh tokens and first-time login together.

From a captured angular-spotify search. File paths and descriptions are shortened to fit.

Local by default

Local indexing is the default

Local indexing and local embeddings are the default. A cloud embedding provider is optional; selecting one sends code chunks to that provider.

Your coding client has its own model and privacy settings, so it may separately send tool results or files to its model provider.

Evidence

Tested against other local tools

The benchmark compares five open-source code-context tools on open-source repository tasks. It reports what files were returned, observed memory, and failed attempts without combining them into one score.

See the full benchmark

Current limits

What this does not prove

Codebase Context helps an agent find project evidence. It cannot guarantee a correct edit. The current benchmark does not prove patch correctness or universal token savings. The indexing measurements are shown only with their limits and are not used to rank tools.

Codebase Context · Patrick Rossello

Usage analytics: page views and project interactions via Vercel and PostHog. No session replay or visitor profiles.