LeetCode Fresh Start

Privacy-first LeetCode backup and boilerplate injection

LeetCode Fresh Start — Privacy-first LeetCode backup and boilerplate injection

Tech Stack

JavaScriptChrome Extension Manifest V3Monaco Editorchrome.storage.localGraphQLContent ScriptsBackground Service Worker

My Role

Designed and built the extension's end-to-end flow — from boilerplate injection and draft archiving to local version history, popup controls, and the main-world bridge used to safely interact with Monaco.

Team

LeetPure
Product & Engineering

Timeline

2026 • Developer Tools

Overview

LeetCode Fresh Start removes the most neglected part of LeetCode workflows: keeping drafts organized while still starting each problem from a clean baseline. The extension detects supported problem pages, injects the official boilerplate for the selected language, and safely archives any unsaved draft so it can be restored later from the popup. Architecturally, the system uses a bridged Chrome extension design. A content script coordinates boilerplate fetching, autosave, storage, and guard logic, while a main-world bridge interacts directly with Monaco to apply edits safely. A lightweight background worker and popup UI complete the workflow, giving users fast access to restore, snapshot, and version-history controls without sending data to third-party servers. The key technical challenge was balancing reliable injection with non-destructive recovery. The solution is a local-first architecture centered on chrome.storage.local, with version history, pinned snapshots, and settings for autosave behavior. The result is a private, practical extension that keeps LeetCode sessions tidy without sacrificing previous work.

What I Built

  • Boilerplate injection for supported LeetCode problem pages
  • Local-only auto-save and version history stored in chrome.storage.local
  • Draft archiving and restore flow from the popup UI
  • Main-world bridge for safe Monaco editor interaction
  • Settings for auto-save intervals and version retention
  • Compatibility limited to https://leetcode.com/problems/*

Key Highlights

Privacy-First Storage

All drafts, snapshots, and version history stay local in the browser.

Boilerplate Injection

Automatically starts each problem from the official LeetCode template.

Version Control

Keeps snapshots, pinned versions, and restore points for every problem.

Interactive Playground

LeetCode Extension Playground

Simulate how the extension auto-saves drafts locally and injects clean boilerplate while preserving history with zero telemetry.

leetcode.com/problems/two-sum
Saved to chrome.storage
// Two Sum: My optimized Map-based solution
function twoSum(nums, target) {
  const map = new Map();
  for (let i = 0; i < nums.length; i++) {
    const complement = target - nums[i];
    if (map.has(complement)) {
      return [map.get(complement), i];
    }
    map.set(nums[i], i);
  }
  return [];
}

* Type in the editor above, then click "Fresh Start". Your previous code will be archived securely, and clean C++ template code will take its place.

LeetPure Extension

Local Storage Sandbox (v1.0.2)

Auto-Save to BrowserEnabled
Telemetry Sync zero tracking
Local Backups (1)

Initial Working Draft

15:42:10

chrome.storage.local acts as your zero-telemetry local database.
Overview of core features including boilerplate injection and local auto-save
Detailed breakdown of the extension's workflow from opening a problem to version control
LeetCode Fresh Start interactive demo showcasing real-time auto-save and boilerplate injection
Interactive demonstration of the extension's version control and draft restoration capabilities
Continuous auto-save feature ensuring every keystroke is captured securely in local storage
Architectural overview highlighting the isolated brain and main context bridge for zero telemetry
Call to action prompting users to install the extension and start fresh

Interested?

Want to explore LeetCode Fresh Start?

An open-source Chrome extension that automatically backs up your LeetCode editor state as you type and restores the official boilerplate whenever you revisit a problem, so you can start fresh without losing your work. Used daily by the author.