GPT Stats is a lightweight Chrome extension that tracks ChatGPT usage effortlessly. It automatically measures the time you spend, counts your prompts, and displays useful usage statistics, all in a clean and minimal popup interface.
All data is stored locally in your browser using chrome.storage.local, ensuring full control, offline compatibility, and compliance with modern extension security standards.
Whether you're curious about your productivity, want to better understand your usage habits and environmental impact, or just love data, GPT Stats gives you clear insights without compromising performance or privacy.
- Track the time spent on ChatGPT.
- Count the number of prompts sent.
- Provide a visual dashboard using
Chart.js. - Estimate water consumption based on usage patterns.
- Persist usage data across browser sessions.
- Ensure everything works offline, locally, with no external dependencies.
| FILE | DESCRIPTION |
|---|---|
assets |
Contains the resources required for the repository. |
manifest.json |
Chrome manifest file (V3) that declares extension metadata. |
background.js |
Background service worker, manages session timing. |
popup |
Contains the popup interface: popup.html, popup.css, and popup.js. |
scripts |
Placeholder for extra logic or utility functions. |
libs |
Contains local dependencies. |
images |
Folder containing icons or UI images. |
README.md |
The README file you are currently reading 😉. |
- Clone this repository:
- Open your preferred Terminal.
- Navigate to the directory where you want to clone the repository.
- Run the following command:
git clone https://github.com/fchavonet/chrome_extension-gpt_stats.git
- Open a Chromium-based browser (Brave, Edge, Google Chrome...) and navigate to:
chrome://extensions/
-
Enable Developer Mode (top-right corner).
-
Click on "Load unpacked" and select the project folder.
-
The extension should now appear in your extensions menu.
You can pin it to your browser toolbar via your extensions menu.
-
Open ChatGPT in your browser.
-
The extension will automatically start tracking your usage time.
-
Each prompt you send is counted in real time.
(⚠️ Make sure you're logged into your OpenAI account for prompt tracking to work!⚠️ ) -
Click the extension icon to open the popup and view your usage statistics.
-
All data is stored locally and will persist across browser restarts.
-
If you just want to test the extension without waiting, you can inject some mock data using the script below.
Click here to see the code.
(function simulateUsageHistory() {
const now = new Date();
const dailyUsage = {};
const dailyPromptCount = {};
for (let i = 0; i < 185; i++) {
const date = new Date();
date.setDate(now.getDate() - i);
const yyyy = date.getFullYear();
const mm = String(date.getMonth() + 1).padStart(2, "0");
const dd = String(date.getDate()).padStart(2, "0");
const key = `${yyyy}-${mm}-${dd}`;
const seconds = Math.floor(Math.random() * (90 - 5 + 1) + 5) * 60;
dailyUsage[key] = seconds;
dailyPromptCount[key] = Math.floor(Math.random() * 30) + 1;
}
const totalPrompt = Object.values(dailyPromptCount).reduce((a, b) => a + b, 0);
chrome.storage.local.set({
dailyUsage: dailyUsage,
dailyPromptCount: dailyPromptCount,
promptUsage: totalPrompt
}, () => {
console.log("✅ Simulated 6 months of usage data successfully injected.");
});
})();
Right-click the opened extension → Inspect → open the Console tab, then paste and run the code.
You can also install the Chrome extension directly from the Chrome Web Store by clicking here.
- Implement CSV export of usage data.
- Improve or redesign the mobile layout.
- Add additional usage metrics.
- Explore Firefox support.
- A big thank you to my friends Pierre and Yoann, always available to test and provide feedback on my projects.
Fabien CHAVONET
- GitHub: @fchavonet