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.
Lane A: Raw Native Grep
21 steps · 7 full files opened1. rg -n "partial call|inherited trait" . (48 matches across 14 files)
Lane B: Codebase Context MCP
12 steps · 2 targeted files edited1. codebase_context.search("partial calls inherited traits", intent="edit")
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-contextThis 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
Files to inspect
most likely firstunauthorized-modal.component.tsUI shown when authorization fails
store/auth.store.tsAuthentication state and token handling
models/spotify-authorize.tsAuthorization request model
Conventions used here
- Components
- Standalone
- State
- RxJS
- Reactivity
- Effect
Existing example to follow
card.component.tsRelated past decision
Handle refresh tokens and first-time login together.
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 benchmarkCurrent 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.