Skip to content

About

A local-first LLM context bridge for seamless cross-platform AI conversation transfer.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

48 Commits

Folders and files

Repository files navigation

Cross Context Logo

Cross Context

The Universal Context Bridge & Portability Layer for Large Language Models

License: MIT Version Manifest Version Zero Cloud

ChatGPT Claude Gemini Grok Perplexity


πŸ“– What is Cross Context?

Cross Context is an open-source browser extension that eliminates AI vendor lock-in and context fragmentation. When you hit rate limits, context window caps, or want to leverage a different model's strengths, Cross Context captures your active session state and transfers it seamlessly into your target AI platform.

Everything runs 100% locally in your browser sandbox without remote servers, subscription fees, or data collection.


✨ Key Features

  • πŸ”„ Cross-LLM Continuity: Instantly migrate conversations between Claude, ChatGPT, Gemini, Grok, and Perplexity.
  • πŸ“„ File-Based Context Injection: Generates in-memory context.md files attached directly to target uploaders via the HTML5 DataTransfer API, avoiding bloated chat prompts.
  • 🧠 Optional AI Distillation: Two-pass Gemini synthesis extracts technical facts, active bugs, and architectural decisions, appending the verbatim transcript underneath.
  • ⚑ Zero-Thrashing Scraping: Parses single-page chat UIs with scoped CSS hiding rules that prevent browser layout thrashing and UI jitter.
  • 🏷️ Sequential Context IDs: Uniquely tags each snapshot (con_01, con_02) to prevent target models from confusing project histories.
  • βœ‚οΈ Boundary-Safe Truncation: Respects safe transfer budgets by trimming older turns on whole message boundaries, preventing split code fences.
  • 🧩 Multi-Session Merger: Select multiple saved context snapshots and synthesize them into a unified project briefing.
  • πŸ›‘οΈ Privacy-First & Secure: Strict host permissions, no third-party tracking, and built-in SSRF guards against malicious internal IP URLs.

πŸš€ Quick Start

1. Installation

  1. Clone the repository:
    git clone https://github.com/Shriraj888/Cross-Context.git
    cd Cross-Context
  2. Open Extensions page: Navigate to chrome://extensions/ in Chrome, Brave, Edge, or Opera.
  3. Enable Developer Mode: Toggle the Developer mode switch in the top-right corner.
  4. Load Unpacked: Click Load unpacked in the top-left corner and select the cloned Cross-Context directory.

🎯 How to Use

 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
 β”‚ 1. Scrape State β”‚  ──>  β”‚ 2. Pick Target  β”‚  ──>  β”‚ 3. Auto-Restore β”‚
 β”‚   (Claude / AI) β”‚       β”‚ (e.g. ChatGPT)  β”‚       β”‚  (File Attached)β”‚
 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. Open an Active Chat: Open any ongoing conversation on Claude, ChatGPT, Gemini, Grok, or Perplexity.
  2. Capture Context: Click the Cross Context toolbar icon and select Scrape Context (or AI Handoff if Gemini API is configured).
  3. Select Target Platform: Choose your destination AI from the target buttons.
  4. Click Transfer: Cross Context opens the destination tab, attaches context-con_01.md, types the companion handoff prompt, and restores continuity with zero copy-pasting.

βš™οΈ Configuration (Optional AI Synthesis)

To enable Gemini-powered distillation alongside verbatim transcripts:

  1. Click the Settings (βš™οΈ) icon in the popup header.
  2. Enter your Google AI Studio Gemini API Key.
  3. Select your model: gemini-3.5-flash (recommended default) or gemini-3.6-flash.
  4. Click Save Settings.

πŸ—οΈ Architecture Overview

Cross Context is designed around Chrome MV3's native separation of concerns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ UI Layer: Popup (popup.html, popup.js, popup.css)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚ chrome.runtime.sendMessage
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Background Layer: Service Worker (background.js)       β”‚
β”‚ β€’ Storage Controller  β€’ Image Proxy  β€’ Gemini Pipeline β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚ chrome.scripting
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Content Layer: Single-File Dispatcher (content.js)     β”‚
β”‚ β€’ DOM Scrapers  β€’ Dual-Mode Injector  β€’ Shadow Overlay β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

For complete technical architectural details and sequence diagrams, see docs/architecture.md.


πŸ“‚ Project Structure

Cross-Context/
β”œβ”€β”€ manifest.json              # Extension metadata and MV3 permission declarations
β”œβ”€β”€ background.js              # Service worker managing state, proxy fetches, and AI pipeline
β”œβ”€β”€ LICENSE                    # MIT License
β”œβ”€β”€ README.md                  # Project overview and quick start guide
β”œβ”€β”€ CONTRIBUTING.md            # Contributor workflows and selector maintenance guidelines
β”œβ”€β”€ CHANGELOG.md               # Version release history
β”œβ”€β”€ icons/                     # Extension branding and toolbar icons
β”‚   β”œβ”€β”€ icon16.png
β”‚   β”œβ”€β”€ icon48.png
β”‚   β”œβ”€β”€ icon128.png
β”‚   └── logo.png
β”œβ”€β”€ content/                   # Scripts running in target LLM page contexts
β”‚   └── content.js             # Monolithic content script (scrapers, injectors, preview overlay)
β”œβ”€β”€ popup/                     # Obsidian & electric cyan user interface
β”‚   β”œβ”€β”€ popup.html             # Popup DOM structure
β”‚   β”œβ”€β”€ popup.css              # Custom styling, toast animations, and radar scanner
β”‚   └── popup.js               # Event controllers, context cards, and settings modal
β”œβ”€β”€ utils/                     # Modular helpers
β”‚   β”œβ”€β”€ formatter.js           # Markdown prompt assembly and message-boundary truncation
β”‚   └── storage.js             # Async storage wrappers for runtime messaging
└── docs/                      # Technical deep-dive documentation
    β”œβ”€β”€ architecture.md        # Detailed 3-layer architecture & Mermaid diagrams
    β”œβ”€β”€ context-engineering.md # Scoring heuristics, Jaccard dedup & token safety
    β”œβ”€β”€ ai-enhancement-pipeline.md # Two-pass Gemini distillation & schema specifications
    β”œβ”€β”€ scraping-engine.md     # Platform selectors, DOM resilience & media extraction
    β”œβ”€β”€ injection-engine.md    # File drop DataTransfer simulation & fallback text injection
    β”œβ”€β”€ troubleshooting.md    # Common errors, model fixes, and debugging FAQ
    └── api-reference.md       # Internal runtime message contracts and storage schemas

πŸ“š Technical Documentation

Explore deep dives on each subsystem:

Document Description
πŸ›οΈ Architecture High-level model, message routing, and security boundaries
🧠 Context Engineering Priority scoring, Jaccard deduplication, and boundary-safe truncation
⚑ AI Enhancement Pipeline Two-pass Gemini extraction, model lifecycle, and transcript preservation
πŸ•·οΈ Scraping Engine Platform selector matrices, zero-thrashing CSS, and media proxying
πŸ’‰ Injection Engine HTML5 DataTransfer file drop mode, SPA state sync, and Shadow DOM
πŸ› οΈ Troubleshooting & FAQ Solutions for selector shifts, HTTP 404s, rate limits, and storage quotas
πŸ“¨ Internal API Reference Complete runtime message contracts, data schemas, and storage keys

πŸ—ΊοΈ Roadmap

  • Local Vector Store: WASM-powered SQLite-VSS for semantic context search across past chats.
  • Visual Context Timeline: Interactive dependency tree showing how code decisions evolved.
  • Cross-Device Sync: Optional client-side end-to-end encrypted backup.
  • Agentic Handoffs: Structured schema exports for autonomous coding agents (Claude Code, Antigravity, Cursor).

🀝 Contributing

Contributions, selector updates, and bug fixes are very welcome! Please review the Contributing Guide for details on code style, platform testing, and pull request conventions.


πŸ“„ License

Distributed under the MIT License. See LICENSE for details.


πŸ‘₯ Author

Created and maintained by Shriraj888.

About

A local-first LLM context bridge for seamless cross-platform AI conversation transfer.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages