A teaching-first AI code coach that helps developers understand their code rather than just making it work. Code Coach provides in-editor explanations, error analysis, and code quality reviews with a focus on learning and comprehension.
Features
Code Explanations: Get line-by-line explanations of your Python code
Error Analysis: Understand what errors mean, why they occur, and how to fix them
Code Reviews: Learn about code quality, style improvements, and best practices
Proactive Learning: Detects when you're stuck and offers contextual help
Privacy-First: Anonymous telemetry with explicit user consent
Requirements
VS Code 1.90.0 or higher
Python files (initial scope)
Code Coach API access (API key required)
Installation
Install the extension from the VS Code Marketplace
Configure your API key in VS Code settings (codeCoach.apiKey)
Set your experience level (codeCoach.userLevel)
Start learning!
Usage
Explain Code
Select Python code in the editor
Right-click and choose "Code Coach: Explain Selected Code"
View the explanation in the Code Coach panel
Review Code Quality
Select Python code you want to review
Use Command Palette: "Code Coach: Review Selected Code"
See suggestions for improvements with explanations
Understand Errors
When you have Python errors, click the lightbulb icon
Choose "Code Coach: Explain This Error"
Learn what the error means and how to fix it
Configuration
Setting
Description
Default
codeCoach.apiBaseUrl
API service endpoint
https://api.codecoach.dev
codeCoach.apiKey
Authentication key
(empty)
codeCoach.userLevel
Experience level for tailored explanations
beginner
codeCoach.telemetryEnabled
Enable anonymous usage analytics
true
codeCoach.proactiveSuggestions
Enable confusion detection and suggestions
true
Development
Prerequisites
Node.js 18+
npm or yarn
VS Code
Setup
# Clone the repository
git clone <repository-url>
cd code-coach-vscode
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Run tests
npm test
# Build webview assets
npm run build:webview
Testing
The extension uses both unit tests and property-based tests:
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run with coverage
npm test -- --coverage
Building
# Compile for production
npm run vscode:prepublish
# Package extension
npm run package
Architecture
The extension follows a modular architecture:
Extension Host (src/extension.ts): Main entry point and lifecycle management
API Client (src/api/): HTTP communication with backend service
Webview Panel (src/panel/): UI for displaying explanations and reviews
Command Handlers (src/commands/): VS Code command implementations