-
-
Outdated lines are marked right in the tutorial. Gemini Nano scanned all 51 lines on-device; only the 13 flagged lines went to the cloud.
-
Click a marked line: the old code, its modern replacement, why it changed, and one-click Copy fix.
-
The web app runs the same hybrid pipeline in any browser: scan on-device, check the shared cache, verify only what's left in the cloud.
-
React 17's ReactDOM.render and hydrate are flagged, the import moves to 'react-dom/client', and still-current lines get a green check.
Inspiration
Most of us learn from tutorials, blog posts and old Stack Overflow answers. The problem is that libraries move on and the tutorials don't. You copy code that looks fine and get errors like firebase is not defined or ReactDOM.render is not a function. The fix is usually small, but nothing on the page tells you the code is old.
I wanted something that points at the outdated line while you're reading, and shows what it should be today.
What it does
Tutorial Time-Machine is a Chrome extension and a web app.
- Open a page with code and the outdated lines get marked π΄; lines that are still fine get π’.
- Click a marked line to see the old code next to the modern version, a short explanation, and a Copy fix button.
- Every result shows where it came from: β‘ On-device, π¦ Cache or βοΈ Cloud, and a savings meter shows how much of the work never left your browser.
- No extension? The web app does the same on four demo tutorials or on code you paste.
How we built it
It's built on Firebase AI Logic's hybrid inference, and the whole idea is to use each kind of AI for what it's good at:
- β‘ Gemini Nano, on your device (
PREFER_ON_DEVICE): reads every code block on the page and points out lines that use a library API that might have changed. Free, private, no network. - π¦ Firestore cache: if anyone already checked a line, the answer comes back instantly with no AI call at all.
- βοΈ Gemini in the cloud (
ONLY_IN_CLOUD, with the Google Search tool): checks only the few flagged lines that aren't cached, and writes the result to the cache for the next reader.
Nano's knowledge is frozen, so it only points. The cloud model decides. Also used: App Check (reCAPTCHA Enterprise on the web, a debug token for the extension), Anonymous Auth, Remote Config (model name, thresholds and budget can change without a redeploy) and Hosting.
Full disclosure: I built this together with Claude Code, an AI coding assistant, which wrote most of the code. My part was steering it: deciding what to build and what mattered, setting up the Firebase project, choosing to stay on the free tier, testing every step in Chrome and reporting what broke, and pushing for fixes until it worked.
Challenges we ran into
- On-device was slow at first. The first version took about 2 minutes to scan one tutorial. Scanning the whole page in one prompt and having Nano answer with just line numbers brought it down to about 16β30 seconds.
- The small model flagged noise, like config values and
console.log. A simple code filter after the model fixed that better than prompt tweaks. - One browser faked having Nano. It returned the prompt back instead of an answer. The app now detects that and uses the cloud instead.
- Free-tier limits. Google Search grounding isn't available on the free tier for the newer Gemini models, and the first model I picked wasn't open to new projects. Thanks to Remote Config, switching models didn't need a redeploy, and when Search isn't available the app still answers but clearly labels it "no Search".
- I leaked a debug token, and caught it. The first deploy accidentally included an App Check debug token. I found it by checking the live site, replaced the token, and added a build check so it can't happen again.
Accomplishments that we're proud of
- The second person to read a tutorial gets every fix from the cache in about a second, with zero cloud calls. The savings meter shows 100% of the work staying in the browser.
- The markers land on exactly the right line on real web pages, even with syntax highlighting.
- Firebase AI Logic's on-device mode works inside a Chrome extension, which isn't covered in Firebase's docs. I tested it step by step before building on it.
- It works on the free tier, and every fallback is visible to the user instead of hidden.
What we learned
- Small on-device models are great at filtering and pointing, not at judging. Let the cloud do the judging.
- On-device speed depends mostly on how much text the model has to write.
- Fallbacks should be visible to the user, not hidden.
- AI coding tools are fast, but someone still has to test everything in a real browser.
What's next for Tutorial Time-Machine
- Write cache entries from a trusted backend so nobody can store a wrong answer.
- Fix multi-line statements as one piece instead of line by line.
- Support more libraries, and publish the extension on the Chrome Web Store.
Cloud verification: flagged lines are checked by Gemini in the cloud through Firebase AI Logic. Google Search grounding is built in: when itβs available, Gemini checks each line against the latest documentation and shows its sources. When grounding is unavailable, the app falls back to Geminiβs own knowledge and labels the result clearly, so the user always knows where an answer came from.
Built With
- chrome
- chrome-prompt-api
- claude-code
- cloud-firestore
- css3
- firebase
- firebase-ai-logic
- firebase-app-check
- firebase-authentication
- firebase-hosting
- firebase-remote-config
- gemini
- gemini-nano
- google-search-grounding
- html5
- javascript
- manifest-v3
- node.js
- recaptcha-enterprise
- typescript
- vite
- vitest