CarbonPrompt is a Chrome (MV3) extension that estimates the carbon emissions of your AI prompts on chatgpt.com and visualizes session usage, a dashboard, and simple predictions.
- Node.js 18+ and npm installed
- Google Chrome (or Microsoft Edge)
- Install dependencies:
npm install- Build the extension bundle:
npm run buildThis creates the dist/ folder with:
manifest.jsonand icons (copied via Vite static copy)popup.html(extension UI)background.js(service worker)contentScript.js(injected into chatgpt.com)
- Open Chrome and go to:
chrome://extensions - Enable “Developer mode” (top-right toggle)
- Click “Load unpacked” and select the
dist/folder - Pin the extension icon if desired (Extensions menu → pin CarbonPrompt)
- Navigate to
https://chatgpt.com/ - Start typing a prompt — you should see an on-page estimate overlay
- Submit a prompt (click Send or press Enter) — the Session tab in the popup should accumulate CO₂
- Open the popup to view:
- Session bar (now uses 8g domain; target marker at 5g)
- Dashboard (sample data only)
- Predict tab (simple forecast and tips)
After making code changes:
npm run buildThen return to chrome://extensions and click “Reload” on CarbonPrompt.
- No overlay or accumulation:
- Hard refresh ChatGPT (
Ctrl+F5) - Ensure you’re on
https://chatgpt.com/(notopenai.com). If needed, add host permissions for other domains inmanifest.json.
- Hard refresh ChatGPT (
- Popup shows 0g after closing:
- Session total is persisted; reopen the popup and it will read
sessionTotalfrom storage.
- Session total is persisted; reopen the popup and it will read
- Inspect logs:
- Page console (ChatGPT tab) for
CarbonPrompt:updateDailyEmissionsmessages chrome://extensions→ CarbonPrompt → “Service worker” → “Inspect views” for background/service logs
- Page console (ChatGPT tab) for
In Microsoft Edge, visit edge://extensions, enable “Developer mode”, then “Load unpacked” → choose dist/.
- Build uses Vite with React and TypeScript; output is in
dist/pervite.config.ts - Storage keys:
dailyEmissions,totalEmissions,sessionTotal,tokens,model - Content script detects submits via click and Enter with a double-count guard