Back to Projects

CodeSensei

TypeScriptVSCode API
Architecture: ExtensionPlatform: VSCode Extension

CodeSensei is an AI-powered VS Code extension that serves as a smart coding companion, helping developers understand and improve their code through three core modes: Explain (beginner-friendly code explanations), Roast (fun and insightful code critique), and Bug Detection (identifying bugs and bad practices). The extension features a modern tab-based webview UI with markdown rendering and syntax highlighting, a copy button for code snippets, streaming-style responses for natural interaction, and a gamified XP and Level system that rewards developers for analyzing their code. It processes code through the Groq API for fast AI inference.

Architecture

System Design

The extension registers a webview panel within VSCode that provides a custom tab-based UI. When the user selects code and triggers an action (via right-click context menu or the panel), the selected code is sent from the editor to the extension logic layer, which constructs a prompt and sends it to the Groq API. The streamed response is rendered in the webview panel with markdown formatting and syntax highlighting. An XP tracking system persists progress across sessions using VSCode's global state storage.

Engineering Insights

Decisions & Learnings

Problem

Developers frequently need to understand unfamiliar code, identify potential bugs, or get feedback on their coding patterns, but switching to external tools breaks the development flow.

Solution

Provide tools and commands that streamline common development tasks directly inside VSCode. CodeSensei brings AI-powered code analysis into the editor with an engaging, gamified interface that encourages regular use.

Architecture Decisions

Use the VSCode Extension API with a webview panel for rich UI rendering instead of simple output channels. Chose the Groq API for fast inference speeds suitable for real-time developer interactions. Implemented streaming responses for a natural conversational experience.

Technical Challenges

Ensuring seamless integration with VSCode's command palette and event system while maintaining a responsive webview UI. Managing the communication bridge between the extension host and the webview panel required careful message passing. Implementing persistent XP tracking across sessions without external storage was solved using VSCode's global state API.