comP is a VS Code extension that indexes your repository's files, functions and call relationships on your own machine, and hands that index to AI coding agents such as Claude Code, Codex and Cursor. Ask comP at the start of a task, and the agent learns in one step where things live and what depends on what. It is open source, and the index and the work records stay on your machine.
The original goal was simple: make the AI read fewer tokens. Every time I asked Claude Code for a small fix, it ran grep after grep and opened files that had nothing to do with the task before it got anywhere. Paying for that exploration, in money and in waiting, on every request felt like a waste.
So I built a way to index the repository once and, given a description of the task, return only the files and symbols (names of functions and classes) that matter. Token use did go down. The longer I used it, though, the more I noticed a bigger change: the quality of the AI's work had changed.
An agent with a map more often opens the right file first, checks the callers before it changes a function, and picks up from the decisions of the last session. Its view widens from the file in front of it to the whole repository. I think that change is the most valuable thing comP does.
comP runs as an MCP server (MCP is the common protocol AI agents use to call outside tools). Normally you just ask for the work, and the agent calls comP's tools itself.
When the agent describes the task in one sentence to run_pipeline, it gets files ranked by relevance. Files with uncommitted changes come first, and files one dependency step away come along. Fewer detours through the wrong file, a wrong assumption and a restart.
get_impact_graph follows the dependency graph and lists every function and file that depends on a symbol. Called before an edit, it tells the agent which callers and tests to check. I want it to stop the slow decay in quality that builds up change after change.
What the agent looked up with run_pipeline and get_context is recorded across sessions automatically. When the agent saves the request and outcome with session_log, the decision is kept too, and the next session carries on with session_recall. Questions in Japanese work as well.
The index and records live in the repository's .comp/. The daemon does not talk to any outside service, and the extension sends no telemetry. The one exception is @comp in VS Code chat, which sends your request and a compressed copy of attached files to the language model selected in VS Code.
When I asked for multi-root workspace support, the agent caught an existing bug from its first run_pipeline result, before writing any of the new feature. It read the returned daemon/src/main.rs and found that the additional_paths feature was wiping the main index. I think a map is what lets the agent see past the spot it was asked about.
The records survive a restart of the daemon (the background process that manages the index), and a switch from Claude Code to Codex loses nothing. In my experience, the memory features in Claude and ChatGPT are good at conversation summaries and preferences, while code details tend to drop out of those summaries. comP's records are an index of technical decisions in one repository. They remember different things, so I recommend using both.
Press Start in the sidebar and a daemon written in Rust indexes the repository. Saved code and Markdown files are re-indexed on the spot, and a git branch switch rebuilds the whole index.
comP: Setup Agents writes to the configuration files that Claude Code, Codex, Cursor, Cline, Windsurf, Continue, GitHub Copilot, Antigravity, Aider and Gemini CLI actually read, keeping your other MCP servers. There is nothing to paste by hand. In VS Code chat, @comp also compresses attached files before they reach the LLM.
How much comP helps depends heavily on the size of the repository and the kind of work. Here are the measurements I have, with their conditions.
What run_pipeline returned for the multi-root task in comP's own repository (9 files). It is compressed to fit the default budget of 8,000 tokens, about 1.8% of the whole repository. How much an agent would actually read depends on the task, so treat any saving computed from this as an upper bound.
One "get an overview" task in MAGATAMA's repository, measured on the MAGATAMA side: the estimated cost of reading selected source against a comP summary. A single measurement; other projects will not see the same ratio.
With a few dozen files, reading everything is cheap anyway, so there is less to gain (my expectation, not a measurement).
An agent that gets lost while exploring reads the wrong file, builds on a wrong assumption, fails the tests and starts over, and each round trip costs thousands of tokens (a rough estimate). In my own use, those round trips dropped noticeably once comP was in place, and the drop was largest with cheaper models.
MAGATAMA is a separate MCP server that reads comP's index and answers "if I change this file, what do I need to check?". comP draws the map; MAGATAMA uses it to inspect a change before you make it.
Ask comP's run_pipeline and get_context.
MAGATAMA's analyze_change_scope returns the candidates a change may ripple out to, with the dependency path to each as evidence.
Search with MAGATAMA's history lookup and comP's session_recall.
Read the records of MAGATAMA's patrol (which checks changes made while you were away and keeps them for the next session) and comP's session_recall.
comP's get_impact_graph starts from one symbol and lists what depends on it. analyze_change_scope instead takes the files you plan to change, walks the dependencies backwards from every symbol in them, and attaches the path of impact to each candidate as evidence. When a file name is ambiguous, or the index lacks the dependencies to decide, analyze_change_scope answers "unknown (needs checking)" instead of guessing. I like that honesty. Treat the result as a starting point for review, not as proof of every runtime effect.
analyze_change_scope is not in the published PyPI release yet, so for now it is used from a MAGATAMA checkout that includes the feature. Setup steps are in MAGATAMA's README.
The full history is in the CHANGELOG.
Indexing with tree-sitter and an MCP server; indexing for Word, Excel, PowerPoint, PDF and Parquet; BM25 full-text search; automatic compression to a token budget; a rebuilt directory walk for large repositories.
✅ Releasedsession_log and session_recall keep requests and outcomes in .comp/history/ so the next session can find them. Since v0.9.4, comP repairs MCP settings on every start so an extension update never leaves them pointing at a stale path.
Setup Agents writes straight into each agent's real configuration file, merged with your existing MCP servers.
✅ ReleasedCodex support, English/Japanese switching, re-indexing on branch switches, session records shared between agents, automatic recovery of a broken index or record, and exact token counts with tiktoken-rs.
✅ ReleasedTwo features, off by default: automatic recording of Claude Code turns into .comp/history/, and returning the relevant sections of instruction files written for other agents. See Beta features.
Codex's automatic review no longer rejects comP's tools, and stale paths left in Claude Code's registrations are fixed after an update. v0.11.11 supports Antigravity 2.0's settings file (~/.gemini/config/mcp_config.json) and removes the zstd vulnerabilities from the daemon.
With several folders open in VS Code, an agent started in any folder can search all of them. Hidden folders directly under your home directory are refused by default, so a repository's settings file cannot read them. Deleting, moving or renaming a folder now reaches the index, and dependency edges and search results stay correct after re-indexing.
✅ ReleasedInstall it in VS Code, build the index, connect your agents. Three steps. comP needs VS Code 1.91 or later, and the daemon ships for Windows, macOS and Linux.
Search the VS Code Extensions view (Ctrl+Shift+X) for "comP - Code Context Engine" and install it. To install from a released .vsix file instead, run:
code --install-extension comP-0.12.3.vsix
Open the repository you work on and press Start in the comP sidebar. The index is built in the background, and the status bar shows its progress. After the first run, only changed files are parsed again. The index and the work records go into the repository's .comp/, so add .comp/* and !.comp/ignore to .gitignore (committed as is, your work records and conversation text would reach the remote).
Run comP: Setup Agents from the Command Palette and pick your agents. Agents found on this PC are already selected. Restart them afterwards (none of them re-read MCP settings while running). comP writes to:
.mcp.json (optionally also user scope via claude mcp add --scope user)~/.codex/config.toml and .codex/config.toml (the project file only takes effect for trusted projects).vscode/mcp.json.cursor/mcp.json and ~/.cursor/mcp.json~/.codeium/windsurf/mcp_config.json.continue/mcpServers/comp.yaml (project and home)agy CLI, VS Code extension): ~/.gemini/config/mcp_config.json.aider.conf.yml at the workspace root.gemini/settings.json and ~/.gemini/settings.json (only with a paid Gemini API key or a Code Assist Standard / Enterprise license; personal accounts lost access on 2026-06-18)