Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>CodeContext — Why Is This Code Like This?New to Visual Studio Code? Get it now.
CodeContext — Why Is This Code Like This?

CodeContext — Why Is This Code Like This?

Preeyaj Safary

|
1 install
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CodeContext — "Why Is This Code Like This?"

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

  1. Open a Git Repository: Open any Git-tracked project in VS Code.
  2. 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.
  3. 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).
codecontext.cacheLocation string Cache folder location (Default: .codecontext-cache).

Commands

  • CodeContext: Why is this here? (codecontext.explainSelection): Explains the current code selection.
  • CodeContext: Show Decision Timeline (codecontext.openTimeline): Reveals the Decision Timeline panel.
  • CodeContext: Re-index Current File (codecontext.reindexFile): Manually indexes and updates the local SQLite cache for the active editor file.

Design Aesthetics

Enjoy a premium dark-themed timeline sidebar featuring custom CSS gradients, SVG iconography, smooth transitions, and clickable GitHub/GitLab/Jira issue links.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft