Skip to content

pawanhirumina/chatgpt-context-saver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

⚡ ChatGPT Context Saver

ChatGPT Context Saver

A free Chrome extension for students who don't have ChatGPT Pro — so a usage limit mid-conversation never kills your momentum again.


The Problem

You're a student. You're deep into a study session with ChatGPT — debugging code, drafting an essay, solving a math problem. Then it happens:

"You've reached your usage limit."

You open a new chat. ChatGPT has no idea who you are or what you were just talking about. You have to re-explain everything from scratch. Your entire conversation is gone.

This extension fixes that.


What It Does

ChatGPT Context Saver runs silently in the background while you chat. It automatically saves your entire conversation to your browser's local storage. When the usage limit hits, you click one button to generate a context summary — a ready-to-paste block of text that catches the new chat up instantly.

No account needed. No API keys. No cost. Everything stays on your device.


How to Install

This extension is not on the Chrome Web Store yet, so you load it manually. It takes about 60 seconds.

Step 1 — Download

Download the chatgpt-context-saver.zip file and unzip it. You'll get a folder called chatgpt-context-saver.

Step 2 — Open Chrome Extensions

Type chrome://extensions in your address bar and press Enter.

Step 3 — Enable Developer Mode

Toggle the Developer mode switch in the top-right corner of the page.

Step 4 — Load the Extension

Click Load unpacked, then select the chatgpt-context-saver folder you unzipped.

The extension icon (⚡) will appear in your Chrome toolbar. You're done.


How to Use It

During a normal conversation:

The extension works automatically. It saves your messages every 30 seconds and whenever a new message appears. You don't need to do anything.

When the usage limit hits:

  1. A small banner appears on the ChatGPT page letting you know your conversation was saved.
  2. Click the ⚡ extension icon in your toolbar.
  3. Click Generate Summary.
  4. Click Copy.
  5. Open a new ChatGPT chat and paste the summary as your first message.

ChatGPT will read the context and pick up right where you left off.


The Extension Popup

The popup has three tabs:

Summary tab — This is where you generate and copy your context block. It shows how many messages have been saved and lets you force-save at any time with the "Save Now" button.

Messages tab — A live preview of every message in your current conversation, colour-coded by who said what (you in blue, ChatGPT in green).

History tab — A list of your last 20 saved conversations. Click any one to load it and generate a summary for it — useful if you closed a tab before copying your context.


What the Context Summary Looks Like

When you click Generate Summary, the extension builds a block like this that you paste into a new chat:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  CONVERSATION CONTEXT (Auto-saved)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This is a continuation of a previous chat that hit the usage limit.
Total messages exchanged: 24 (12 from me, 12 from you)

── Original Question ──
How do I implement a binary search tree in Python...

── Topics Discussed ──
1. How do I implement a binary search…
2. Can you show me the insert method…
3. What does the time complexity look…

── Last 10 Messages ──

👤 Me:
Why does my delete method not handle the two-children case?

🤖 ChatGPT:
The issue is that when a node has two children, you need to find
the in-order successor...

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Please continue our conversation with the above context in mind.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Just paste this at the top of your new chat and ChatGPT immediately knows what you were working on.


Privacy

Your conversations never leave your device. The extension saves everything to chrome.storage.local, which is local browser storage — the same place Chrome saves bookmarks and settings. Nothing is sent to any server. There is no backend, no account, and no tracking.


Project Structure

chatgpt-saver/
├── manifest.json     — Extension config and permissions (Manifest V3)
├── content.js        — Runs on ChatGPT pages, reads messages from the DOM
├── background.js     — Service worker, updates the toolbar badge
├── popup.html        — The popup UI layout and styles
├── popup.js          — Popup logic: tabs, summary generation, copy button
└── icons/            — Extension icons (16px, 48px, 128px)

How It Works (Technical)

The content script (content.js) uses a MutationObserver to watch for new messages in the ChatGPT DOM. Messages are identified by the data-message-author-role attribute that ChatGPT adds to each message element. When new messages are detected, they are saved to chrome.storage.local.

The extension also watches the page text for known usage-limit phrases. When one is detected, it immediately saves the conversation, shows a banner on the page, and flashes the toolbar badge orange.

The summary is generated entirely in JavaScript with no AI API — it takes the saved messages, picks out the original question, extracts key topic lines from your messages, and formats the last 10 messages into the paste-ready block.


Limitations

  • Works on chatgpt.com and chat.openai.com only.
  • Saves up to 20 conversations in history. Older ones are removed automatically.
  • The summary does not use AI to condense or rephrase — it uses the actual messages. For very long chats, the last 10 messages are included.
  • Does not sync across devices or browsers.

Planned Improvements

  • Auto-detect the usage limit and open the copy dialog automatically.
  • Optional AI-powered summarization using a user-provided API key.
  • Support for exporting conversations as a .txt or .md file.
  • Firefox support.

Built With

  • Chrome Extensions Manifest V3
  • Vanilla JavaScript (no frameworks, no dependencies)
  • chrome.storage.local for persistence
  • MutationObserver for live DOM watching

Contributing

This project was built by a student, for students. If you want to improve it, fix bugs, or add features, pull requests are welcome.

if you found any bug open an issue or feel free to pull requests


License

MIT — free to use, share, and modify.

About

A free Chrome extension for students who don't have ChatGPT Pro, so a usage limit mid-conversation never kills your momentum again.

Topics

Resources

License

Stars

Watchers

Forks

Contributors