CodeContext is a VS Code extension that explains the original reasoning behind code selections and lines directly in your editor. Unlike LLM explanation tools that look at the code and guess what it does, CodeContext queries local git history (blame, logs) and links commit messages to PRs and external project tickets (GitHub, GitLab, Jira) to construct a grounded, verifiable decision history.
Features
Inline Gutter Indicators: Shows a lightbulb (💡) next to lines with recorded decision context in history.
Rich Hover Tooltips: Hover over lines to view the author, date, latest commit message, and any linked issues or pull requests.
Decision Timeline Panel: A chronological side panel listing all historical commits that touched your currently selected line range or function block.
AI Summary Layer: Condenses multiple related historical changes into a concise paragraph using Claude (gated behind user API key, grounded strictly to commits & tickets).
No-Record Fallback: Tells you honestly when "No recorded reason found" instead of guessing or hallucinating.
100% Offline by Default: Works without any API keys, tokens, or network requests using local Git commands.
Getting Started
Open a Git Repository: Open any Git-tracked project in VS Code.
Move Cursor: Select or hover a line of code. The Decision Timeline side panel will automatically refresh to show the commits that touched this block.
Trigger AI Explanation: Right-click inside a block and click CodeContext: Why is this here? or press the hover link.
Configuration Settings
You can configure CodeContext via VS Code Settings (Ctrl+, or Cmd+,):
Setting
Type
Description
codecontext.anthropicApiKey
string
Anthropic Claude API key (for optional historical text summarization).
codecontext.githubToken
string
GitHub API Token (for fetching PR titles and descriptions).
codecontext.gitlabToken
string
GitLab Private Token.
codecontext.jiraBaseUrl
string
Base URL for your Jira instance (e.g. company.atlassian.net).
codecontext.jiraToken
string
Jira Token (formatted as email:token or PAT).
codecontext.minCommitsForSummary
number
Minimum number of historical commits required to trigger Claude summarization (Default: 2).