VS Code extension for repository understanding inside the editor.
This project combines three workflows into a single extension:
- AI chat for repo-level questions
- code threads attached directly to source code
- usage-insight style answers such as impact, ownership, and churn
When a developer joins a new repo, changes code owned by another team, or tries to understand a large codebase, the usual workflow is fragmented:
- open code
- search Slack or docs
- ask a teammate
- manually trace dependencies
This extension is meant to bring that workflow into VS Code.
The current version focuses on:
Explainmode for structure and file/function summarizationCodemode for impact and repository-risk style questions- inline code threads for asking and answering questions on selected code
- editor-native
Add Threadactions inside the code view
The main sidebar view is AI Chat.
It supports:
- persistent chat history
- edit and delete for user messages
- timestamped history
ExplainandCodemodes
Entire StructureFileFunction
Function reads the active file and shows a picker of available functions. For Python files, there is a fallback parser for def and async def if symbol discovery is not available.
Impacted filesTop-churn filesOwner of code
Notes:
Top-churn filesandOwner of codeare currently demo-style responses with improved UI rendering.Impacted filesis wired as a chat action and is the current placeholder for deeper dependency analysis.
Threads can be created from:
- selected code
- the
Code Threadsview - inline
Add Threadactions shown in the editor
Thread capabilities:
- create a thread on selected code
- ask the first question
- add answers
- resolve and reopen threads
- delete threads
- jump from the sidebar thread list back to the exact code range
The extension includes:
- a
Code Threadssidebar - native VS Code comment threads in the editor
- an inline
Add ThreadCodeLens that follows the current line/visible code area
The extension contains an internal usage layer bridge for questions like:
- ownership
- churn
- impact
- dependency-style queries
Right now the system is in a hybrid state:
- some responses are hardcoded/demo responses for UI and interaction testing
- the architecture already includes a
UsageTrackerServiceso a real backend can replace those demo responses later
src/extension.ts- extension activation
- command registration
- webview providers
- inline thread provider registration
src/chat/ChatViewProvider.ts- webview-to-extension message bridge
src/chat/getWebviewHtml.ts- chat webview shell
media/main.js- chat UI behavior
media/styles.css- chat styling
src/core/ChatService.ts- chat history
- canned/demo response routing
- provider dispatch
src/core/UsageTrackerService.ts- usage-style query routing hook
src/core/providers/MockProvider.ts- local mock response provider
src/core/providers/OpenAICompatibleProvider.ts- OpenAI-compatible chat provider
src/threads/commentController.ts- VS Code native comment thread integration
src/threads/sidebarProvider.tsCode Threadswebview provider
src/threads/threadStore.ts- thread persistence
src/threads/inlineThreadLensProvider.ts- inline
Add ThreadCodeLens
- inline
src/threads/types.ts- thread-related types
media/threadSidebar.html- thread sidebar UI
Download the project from GitHub:
git clone https://github.com/aaron02nj/code-compass.git
cd code-compassIf you prefer SSH:
git clone git@github.com:aaron02nj/code-compass.git
cd code-compassOpen the cloned folder in VS Code.
If your machine already has Node.js and npm installed, you can use those directly.
If you are using a local portable Node installation, point your shell at that local bin directory first.
<project-root>/.local/<node-install>/binIf your shell does not already know node or npm, run:
export PATH="<project-root>/.local/<node-install>/bin:$PATH"npm installnpm run compilePress F5 in VS Code using the Run Extension launch config.
This opens an Extension Development Host window. In that new window:
- open the
Repo Chaticon in the Activity Bar - start with
AI Chat - open
Code Threadsfrom inside chat or from the view container
In AI Chat:
- choose
ExplainorCode - click one of the suggestion buttons or type your own question
Examples:
Summarize the entire structure.Summarize this file.Explain function make_video in this file.What files will be impacted if I modify this file?Show top 10 files by churn in this repository.Who is the best person to ask about this file?
Option 1:
- select code
- right click
- choose
Repo Chat: New Code Thread
Option 2:
- click inline
Add Threadabove the current code line
Option 3:
- open
Code Threads - select code in the editor
- click
+ New Thread
From the Code Threads sidebar:
- click
Answer - write the response
- press
Enteror clickSubmit Answer
From the native editor thread:
- use the VS Code thread reply UI
In the Code Threads sidebar:
- click
Mark resolved - if that was accidental, click
Mark unresolved
Available settings:
repoContextChat.providerrepoContextChat.apiBaseUrlrepoContextChat.apiKeyrepoContextChat.modelrepoContextChat.usageBackendUrlrepoContextChat.usageReporepoContextChat.enableUsageRoutingrepoContextChat.threadAuthor
- some usage insights are still hardcoded for demo and UI validation
- impact analysis is not yet backed by a full dependency graph engine
- thread answer generation is not yet connected to the same AI backend as chat
- the current inline
Add Threadexperience is implemented as a CodeLens, which is the most stable editor-native approximation of a floating hover button
- Replace hardcoded churn and ownership answers with real usage backend calls.
- Connect thread answers to the AI chat engine or a dedicated thread-answer backend.
- Add real dependency graph analysis for
Impacted files. - Package the extension as
.vsixfor distribution. - Publish the repo and add screenshots/demo GIFs for onboarding.