Skip to content

Repository files navigation

Context Capsule - Browser Extension

Portable Context Packet for seamless AI conversation transfer across tools and platforms.


🎯 Overview

Context Capsule captures entire AI conversationsβ€”messages, context, decisions, and referenced filesβ€”into a single portable .capsule.json file. Drag and drop this file into any compatible AI tool to instantly continue your conversation without re-explaining anything.

✨ Key Features

Feature Description
Multi-Platform Works with ChatGPT, Claude, Gemini, and Perplexity
Auto-Capture Automatically watches for new messages as you chat
Portable Format Single .capsule.json file containing everything
No Account Required All data stays in your browser
Privacy First No external calls, no telemetry, fully local
Smart Extraction Multiple selector strategies with automatic fallback
Export Options JSON, Markdown, Text, and clipboard formats
Tag & Search Organize capsules with custom tags
Keyboard Shortcut Ctrl+Shift+S (or Cmd+Shift+S on Mac) to instantly save

πŸ“¦ Installation

Chrome Web Store (Recommended)

  1. Visit the Chrome Web Store
  2. Click "Add to Chrome"
  3. Grant necessary permissions
  4. Start capturing conversations!

Manual Installation (Development)

  1. Download the extension files
  2. Open chrome://extensions (or edge://extensions for Edge)
  3. Enable Developer mode (toggle in top right)
  4. Click Load unpacked
  5. Select the browser-extension folder

πŸš€ How to Use

Quick Start

Save a Conversation

  1. Open any supported AI platform (ChatGPT, Claude, Gemini, Perplexity)
  2. Chat normally
  3. Press Ctrl+Shift+S (or Cmd+Shift+S on Mac)
  4. Your conversation is saved automatically!

Export & Share

  1. Click the extension icon in your toolbar
  2. Find your saved capsule in the list
  3. Click the ↓ export button
  4. Share the .capsule.json file with anyone

View Capsule Contents

  1. Click "Open Viewer" in the popup footer
  2. Drag & drop any .capsule.json file
  3. Review messages, decisions, and context
  4. Export in different formats (Markdown, PDF, etc.)

Advanced Features

Organize with Tags

  1. Click the ✎ edit button on any capsule
  2. Add custom tags (e.g., "project-X", "research", "bug-fix")
  3. Filter and find capsules quickly

Export Formats

  • JSON: Full capsule data for developers
  • Markdown: Beautiful formatted conversation
  • Text: Plain text with dividers for easy pasting
  • File: Copy to clipboard as file

Convert Text to Capsule

  1. Open the viewer page
  2. Paste any conversation transcript
  3. Click "Convert & Preview"
  4. Automatically structured into capsule format

πŸ”’ Privacy & Security

Data Storage

  • Local Only: All capsules stored in chrome.storage.local (5MB limit)
  • No Sync: No cloud backup, no external servers
  • No Tracking: No analytics, no telemetry
  • User Control: You decide when to export or delete

Sensitive Data Protection

The extension includes optional redaction of:

  • API keys and tokens
  • Passwords and credentials
  • Credit card numbers
  • Email addresses (optional)
  • JWT tokens and secrets

Note: Always review capsule content before sharing. The redaction feature is helpful but not perfect.

Permissions Explained

Permission Purpose
activeTab Read conversation content from current tab
storage Save capsules locally in your browser
tabs Detect supported AI platforms

🌐 Platform Support

Platform Status Notes
ChatGPT βœ… Full Support chat.openai.com, chatgpt.com
Claude βœ… Full Support claude.ai
Gemini βœ… Full Support gemini.google.com
Perplexity βœ… Full Support perplexity.ai, www.perplexity.ai

Why These Platforms? These are the most popular AI chat interfaces with accessible DOM structure. More platforms coming soon!


πŸ“ File Format

A .capsule.json file contains:

{
  "_format": "context-capsule",
  "_specVersion": "1.0.0",
  "manifest": {
    "version": "1.0.0",
    "capsuleId": "uuid-v4",
    "createdAt": "2026-01-15T10:30:00Z",
    "createdBy": {
      "tool": "ChatGPT",
      "version": "extension-1.2.0"
    },
    "title": "Conversation about API design",
    "description": "Auto-generated description",
    "tags": ["api", "design", "important"],
    "targetAiSpec": "ccif-1.0"
  },
  "conversation": {
    "threadId": "thread-uuid",
    "title": "API design discussion",
    "messages": [
      {
        "id": "msg-001",
        "role": "user",
        "content": "How should we design the API?",
        "timestamp": "2026-01-15T10:30:00Z"
      },
      {
        "id": "msg-002",
        "role": "assistant",
        "content": "Here's a recommended approach...",
        "timestamp": "2026-01-15T10:30:15Z"
      }
    ]
  },
  "context": {
    "capturedAt": "2026-01-15T10:30:00Z",
    "platform": "ChatGPT",
    "sourceUrl": "https://chat.openai.com/..."
  }
}

πŸ› οΈ Technical Details

Architecture

  • Content Script: Injected into AI pages to extract messages
  • Background Service Worker: Handles storage and export
  • Floating UI: Context-aware buttons in message bars
  • Viewer: Standalone page for viewing/exporting capsules

Selector Strategy

The extension uses multiple extraction strategies with automatic fallback:

  1. Attribute-based: Uses data-message-author-role (most reliable)
  2. Class-based: Detects role-specific CSS classes
  3. Container-based: Analyzes conversation DOM structure
  4. Content-based: Smart heuristics as last resort

This ensures capture continues working even when platforms update their UI.

Performance

  • Debounced Capture: Prevents excessive storage writes
  • Memory Management: Automatic cleanup of observers and timers
  • Storage Optimization: Automatic pruning of old capsules (keeps 50 most recent)
  • Quota Monitoring: Warns at 90% of 5MB chrome.storage limit

πŸ”§ Troubleshooting

Capture Not Working?

  1. Reload the chat page - Content scripts need the page to reload
  2. Check platform status - Extension shows green dot when supported
  3. Wait 2-3 seconds - Auto-capture needs time to detect messages
  4. Try keyboard shortcut - Ctrl+Shift+S forces manual capture

Storage Full?

  1. Export important capsules first
  2. Click "Clear All" to reset storage
  3. Archive old capsules externally
  4. Extension auto-keeps 50 most recent

Platform UI Changed?

The extension uses smart selector fallback. If primary selectors break:

  1. Fallback strategies activate automatically
  2. Extension still captures messages
  3. Consider reporting the issue so we can update selectors

Floating Button Missing?

  1. Check if page is supported
  2. Reload the page
  3. Disable other extensions that might conflict
  4. Check browser console for errors

πŸ“ Version History

v1.2.0 (Current)

  • βœ… Production-ready with comprehensive error handling
  • βœ… Storage quota monitoring and automatic cleanup
  • βœ… Smart selector fallback for platform UI changes
  • βœ… Rate limiting and security hardening
  • βœ… Input validation and XSS prevention
  • βœ… Memory leak fixes and performance optimization
  • βœ… Schema validation for capsule files
  • βœ… Enhanced export formats (Markdown, text, JSON)

v1.1.0

  • βœ… Added Perplexity support
  • βœ… Implemented tagging system
  • βœ… Added keyboard shortcut
  • βœ… Floating UI improvements

v1.0.0

  • βœ… Initial release
  • βœ… Multi-platform support
  • βœ… Basic capture and export

🀝 Contributing

Bug Reports

Please include:

  • Browser version and OS
  • Steps to reproduce
  • Screenshot or console logs (if applicable)
  • Platform (ChatGPT/Claude/Gemini/Perplexity)

Feature Requests

We welcome suggestions for:

  • New platform support
  • Export format ideas
  • UX improvements

πŸ“„ License

MIT License - See LICENSE file for details


πŸ™ Acknowledgments

Built for the AI community to enable seamless context transfer across tools and platforms.

Made with ❀️ for AI users everywhere


πŸ“ž Support

  • GitHub Issues: Report bugs and request features
  • Documentation: See /docs folder for detailed guides
  • Community: Join discussions in GitHub Discussions

Context Capsule - Because your AI conversations deserve to be portable.

About

A Chrome extension that captures AI conversations from ChatGPT, Claude, Gemini & Perplexity into portable .capsule.json files for seamless context transfer.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages