Code Coach
Code Coach is a VS Code extension that turns the errors you hit while coding into a gentle, private coaching loop: it notices your mistakes as they happen, explains them in plain language right next to the line, and tracks your progress over time so patterns become visible instead of invisible.
It's built for learners — students, bootcamp grads, anyone picking up a new language — who want feedback that's kinder and more explanatory than a raw compiler message, without sending their code anywhere by default.
Features
- Inline mistake hints — when the language server reports an error, Code Coach shows a short, friendly explanation right after the line (💡), instead of just the raw diagnostic.
- Optional AI-powered rewording — upgrade those hints from a curated rule-based library to a live, context-aware explanation generated by an LLM. Fully opt-in; see AI-Powered Hints below.
- Mistake dashboard — a sidebar panel (Activity Bar → Code Coach) visualizing which errors you hit, how often, and in which files/languages over the past week.
- Mute hints you've outgrown — dismiss a hint type directly from its tooltip, or manage everything you've muted via Code Coach: Manage Muted Hints.
- Local-only logging — every logged mistake (type, file, line, language, timestamp) is written to a
.jsonl file in your VS Code global storage. Nothing leaves your machine unless you explicitly enable an AI provider below.
AI-Powered Hints (optional)
By default, Code Coach's hints come from a small built-in library of common mistakes (src/hints.ts) — free, instant, and fully offline. If you want more specific, natural-language explanations tailored to the exact error message you hit, you can opt into having that message reworded by an LLM.
This is controlled by the codeCoach.hintProvider setting:
| Value |
What happens |
Cost |
"off" (default) |
Built-in rule-based hints only. No network calls. |
Free |
"claude" |
The raw error message is sent to the Claude API and reworded into a short, encouraging hint. |
Pay-per-use on your own Anthropic account (see below) |
"local" |
The raw error message is sent to a model running locally via Ollama. |
Free — runs entirely on your machine |
If a provider is enabled but unreachable, misconfigured, or times out (6s), Code Coach silently falls back to the built-in hint — you'll never be left without one.
Option A — Claude API (bring your own key)
This uses Anthropic's Claude API directly from your machine. You'll need your own API key from console.anthropic.com — this is a separate product from a claude.ai subscription (Free/Pro/Max) and is billed per-token on your own account. It is not free, but it is cheap: with claude-haiku-4-5 (the model Code Coach uses), a single hint costs roughly $0.0003–0.0005 — about 2,000–3,000 hints per dollar.
Setup:
- Create an API key at console.anthropic.com.
- In VS Code, open the Command Palette and run Code Coach: Set Claude API Key, then paste your key into the input box.
- Your key is stored using VS Code's built-in
SecretStorage (encrypted at rest, local to your machine). It is never written to settings files and never leaves your device except in requests to the Anthropic API.
- Set
codeCoach.hintProvider to "claude" in your settings.
- To remove your key at any time, run Code Coach: Clear Claude API Key.
Option B — Local model via Ollama (free)
This runs an open-source model on your own machine — no account, no key, no per-use cost. Requires more disk space and a one-time model download.
- Install Ollama (macOS:
brew install ollama).
- Start it:
brew services start ollama (or ollama serve).
- Pull a model:
ollama pull llama3.2 (default; ~2 GB download, one-time).
- Set
codeCoach.hintProvider to "local" in your settings.
That's it — no key, no command to run. If you'd rather use a different model or a remote Ollama instance, see the settings below.
Extension Settings
| Setting |
Default |
Description |
codeCoach.hintProvider |
"off" |
How hints are generated: "off" (built-in), "claude" (Claude API), or "local" (Ollama). |
codeCoach.localHintEndpoint |
"http://localhost:11434/api/generate" |
Endpoint for the local model server. Only used when codeCoach.hintProvider is "local". |
codeCoach.localHintModel |
"llama3.2" |
Model name requested from the local model server. Only used when codeCoach.hintProvider is "local". |
Commands
| Command |
Description |
Code Coach: Refresh Stats |
Manually refresh the mistakes dashboard. |
Code Coach: Manage Muted Hints |
View and re-enable previously muted hint types. |
Code Coach: Set Claude API Key |
Store your Anthropic API key for the "claude" hint provider. |
Code Coach: Clear Claude API Key |
Remove a previously stored Anthropic API key. |
Requirements
- VS Code 1.129 or later.
- A language extension that provides diagnostics for the language you're working in (e.g. the Dart extension for Dart, built-in support for TypeScript/JavaScript/Python).
- For
codeCoach.hintProvider: "claude": an Anthropic API key.
- For
codeCoach.hintProvider: "local": Ollama installed and running, with your chosen model pulled.
Known Issues
- AI-powered hints (
"claude" / "local") add latency (up to a few seconds) before the hint appears, since Code Coach waits for the rewording to complete rather than showing a placeholder first.
- The local provider currently supports Ollama's
/api/generate endpoint specifically; other local-model servers aren't supported yet.
Release Notes
Unreleased
- Added optional AI-powered hint rewording via Claude API (bring-your-own-key) or a local Ollama model.
0.0.1
- Initial release: rule-based inline hints, mistake logging, stats dashboard, mute management.