An AI-powered Chrome extension that helps you solve LeetCode problems without giving away the solution. Get hints, summaries, and conceptual guidance while you learn!
- 📝 Problem Summaries: Get concise, bullet-pointed summaries of LeetCode problems
- 💡 Smart Hints: Request hints that guide your thinking without revealing the solution
- 🎯 Socratic Learning: AI asks questions to help you discover the solution yourself
- ⚡ Typewriter Effect: Beautiful animated responses that appear character-by-character
- 💬 Conversation History: All interactions persist during your session
- 🎨 Clean UI: Modern side panel interface with color-coded message types
- Node.js (v16 or higher)
- Chrome browser (v121 or higher)
- Chrome AI APIs enabled (see setup below)
-
Clone the repository
git clone https://github.com/yourusername/codecompass.git cd codecompass -
Install dependencies
npm install
-
Build the extension
npm run build
-
Load in Chrome
- Open Chrome and navigate to
chrome://extensions - Enable "Developer mode" (toggle in top-right)
- Click "Load unpacked"
- Select the
distfolder from the project directory
- Open Chrome and navigate to
Code Compass uses Chrome's built-in AI capabilities. Enable them by:
- Navigate to
chrome://flags - Search for and enable:
#optimization-guide-on-device-model→ Enabled#prompt-api-for-gemini-nano→ Enabled#summarization-api-for-gemini-nano→ Enabled
- Restart Chrome
- The first time you use the extension, Chrome will download the AI model (~1.5GB)
-
Navigate to a LeetCode problem
https://leetcode.com/problems/two-sum/ -
Click the Code Compass extension icon
- The side panel will open on the right
-
Ask for help
- Type "Summarize" to get a problem summary
- Type "Generate a Hints" to get conceptual hints
- Type custom questions for future features
For UI development:
npm run devView at http://localhost:5173 with mock Chrome APIs
For extension testing:
npm run build -- --watchThen reload the extension in Chrome after changes
- React 18 - UI framework
- Vite - Build tool
- @crxjs/vite-plugin - Chrome extension bundler
- Tailwind CSS - Styling
- DaisyUI - UI components
- Chrome AI APIs - On-device AI (Gemini Nano)
By default, Code Compass only works on LeetCode problem pages. Modify in App.jsx:
const allowedOrigins = ["https://leetcode.com/problems/"];| Command | Description |
|---|---|
npm run dev |
Start Vite dev server (UI development) |
npm run build |
Build production extension |
npm run build -- --watch |
Build in watch mode (recommended for dev) |
npm run preview |
Preview production build |
Solution: Reload the LeetCode page after installing/updating the extension
Solution:
- Enable Chrome AI flags (see Enable Chrome AI APIs section)
- Restart Chrome
- Wait for model download on first use
Solution:
- Run
npm run build - Go to
chrome://extensions - Click the refresh icon on Code Compass
- Reload the LeetCode page
Solution:
- Make sure you're on a LeetCode problem page (
/problems/*) - Check that the extension is enabled
- Try clicking the extension icon again
- Similar Problems: Find related problems to practice
- Custom Prompts: Ask any question about the problem
- Difficulty Analysis: Understand what makes a problem hard
- Pattern Recognition: Learn common problem-solving patterns
- Code Review: Get feedback on your approach (no solutions!)
- Multi-language Support: Summaries in your preferred language
- Dark Mode: Eye-friendly dark theme
- Export Chat: Save conversations for later review
- Built with Chrome's Built-in AI APIs
- Inspired by the need for better learning tools on coding platforms
- Thanks to the LeetCode community for problem-solving inspiration
Made with ❤️ for learners who want to truly understand algorithms