DEV Community

Cover image for Submission: Hacktoberfest Open-Source AI Challenge Week 1 (Touch Grass)
Shriraj Patil
Shriraj Patil

Posted on

Submission: Hacktoberfest Open-Source AI Challenge Week 1 (Touch Grass)

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

What I Built

Cross Context is an open-source browser extension that lets you migrate an entire AI conversation β€” code, errors, architectural decisions, everything β€” from one LLM to another in a single click. Claude β†’ ChatGPT β†’ Gemini β†’ Grok β†’ Perplexity, any direction.

No cloud servers. No accounts. No data leaves your browser.

Why "Touch Grass"?

Every developer knows the drill: you're deep in a debugging session with Claude, you hit a rate limit, and suddenly you're spending 30 minutes manually copy-pasting code snippets into ChatGPT, re-explaining your architecture, and fixing Markdown formatting that broke during transfer. That's 30 minutes of screen time that shouldn't exist.

Cross Context kills that friction. Scrape β†’ pick a target β†’ transfer. Five seconds. Then close your laptop and go outside.

The screen should be the shortest part of the experience. That's the whole point.

Who is it for?

  • Developers who pair-program with AI and refuse to restart from scratch when they hit a wall
  • Researchers who compare model responses using identical ground-truth context
  • Privacy-first builders who won't send conversation history through third-party sync clouds

Demo

πŸ”— Live Prototype: cross-context.vercel.app

The 3-step handoff:

  1. Scrape β€” Open any active chat on a supported platform. Click Cross Context β†’ Scrape Context (or AI Handoff for Gemini-enhanced distillation).
  2. Target β€” Pick your destination: ChatGPT, Claude, Gemini, Grok, or Perplexity.
  3. Transfer β€” Cross Context opens the target, attaches a clean context.md file via the HTML5 DataTransfer API, types a companion prompt in your developer voice, and restores full continuity. Zero copy-pasting.

Cross Context Logo


Code

GitHub logo Shriraj888 / Cross-Context

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

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…

MIT Licensed. The entire codebase is a Chrome MV3 extension β€” no bundler, no framework, no build step:

File Role
background.js Service worker: state management, image proxy, Gemini pipeline, cross-tab injection coordinator
content/content.js Monolithic content script: platform-specific DOM scrapers, dual-mode injector, Shadow DOM overlay
utils/formatter.js Markdown assembly and message-boundary truncation
popup/ Obsidian Dark + Electric Cyan UI with radar scanner, context cards, and settings modal

How I Built It

The core stack is vanilla JavaScript on Chrome Manifest V3 β€” zero cloud dependencies, everything runs in the browser sandbox.

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

Four engineering problems had to be solved:

1. Zero-Thrashing DOM Scraping

AI chat UIs use dynamic CSS-in-JS classes, virtualized message lists, and interface chrome (copy buttons, thumbs-up widgets, citation pills) that pollute extracted text. Naive innerText calls trigger layout reflows and freeze the browser on long threads.

Cross Context injects a scoped stylesheet (.cc-scraping-active) that hides non-content elements in a single CSS pass before any DOM read. One reflow, clean extraction, immediate teardown. Each platform gets a tiered fallback selector chain so the extension survives frontend deploys:

Platform Primary Selector Fallback
Claude [data-testid="user-message"] .font-user-message, div[class*="ChatMessage"]
ChatGPT [data-message-author-role] article, div.text-base
Gemini user-query, model-response message-content
Grok div[data-testid*="message"] div[class*="bubble"], article
Perplexity div[class*="query-wrapper"] div.markdown, div[class*="prose"]

2. Context Engineering β€” Score, Deduplicate, Truncate

A raw 50-turn chat wastes tokens on greetings, superseded code, and conversational noise. Cross Context runs a local pipeline:

  • Priority Scoring β€” Code blocks get +2.5, architecture decisions +2.0, stack traces +2.0. Greetings get βˆ’2.0. Messages scoring β‰₯ 6.0 are kept.
  • Jaccard Deduplication β€” When J(A, B) > 0.45 or one code block is a substring of another, the older iteration is pruned. Only the latest, most complete version survives.
  • Boundary-Safe Truncation β€” Enforces an 80,000-char safety budget by trimming on whole message boundaries β€” never splits a code fence mid-token.

3. Two-Pass AI Distillation (Optional, via Gemini API)

When toggled, the extension runs two sequential Gemini calls:

  • Pass 1 β€” Structured Extraction: Schema-enforced JSON pulling technical_stack, architecture_decisions, errors_and_issues, pending_tasks, files_mentioned, and important_code.
  • Pass 2 β€” Grounded Synthesis: Takes the structured facts + raw transcript and produces a first-person handoff brief ("I was implementing token rotation in client.js...") with the full verbatim transcript appended underneath for ground-truth verification.

Two passes prevent hallucination: Pass 1 constrains facts, Pass 2 can only cite what Pass 1 extracted.

4. Dual-Mode Injection via HTML5 DataTransfer

Pasting 30K characters into a chat box degrades model reasoning. Instead, Cross Context generates an in-memory File object (context-con_01.md) and dispatches synthetic drag-and-drop events directly to the target's file uploader:

const dt = new DataTransfer();
dt.items.add(new File([markdown], fileName, { type: 'text/markdown' }));
// dispatch dragenter β†’ dragover β†’ drop on the target's drop zone
Enter fullscreen mode Exit fullscreen mode

If file drop fails (platform doesn't support it), the injector falls back to native setter override + React synthetic event dispatching to insert text directly into the SPA's input element.


Why Does Open Innovation Matter?

Cross Context could not exist as a closed-source product. Here's why:

1. Breaking walled gardens requires transparency. Every AI vendor profits from keeping your conversation memory locked in their silo. An open-source context bridge is the only kind users can trust not to become another silo. The code is auditable; the extension does what it says.

2. Privacy demands zero-cloud. Developers discuss internal architectures, API keys, and proprietary codebases during AI sessions. A closed sync tool would pipe that through someone else's servers. Cross Context runs entirely in your browser sandbox β€” no telemetry, no analytics, no external calls (except the optional Gemini API, which you configure with your own key).

3. Open-weight models need open plumbing. Cross Context already bridges to Gemini, which powers Gemma-family models. The same context-engineering pipeline β€” priority scoring, deduplication, boundary-safe truncation β€” works identically when handing off to Gemma, Llama, or Mistral running locally via Ollama. A closed API can't let you swap the model underneath; open tools can.

4. Screen time is a design choice. The 30-minute copy-paste ritual exists because vendors don't interoperate. Open innovation removes that friction by design, not by permission. Less friction means faster answers, which means you close the laptop sooner and go touch grass.


My Agent Session

This submission was refined and documented with agentic assistance. The session captures architectural trade-offs, DOM scraper edge-case handling, and the context-engineering iteration process.


Prize Categories

  • Best Use of Gemma β€” Cross Context's context-engineering pipeline (scoring, deduplication, truncation) produces model-ready handoff briefs optimized for open-weight models like Gemma. The same context.md format works for local inference via Ollama, making Gemma a first-class handoff target.
  • Best Use of GitHub Copilot β€” GitHub Copilot was used throughout development for rapid prototyping of DOM scrapers, selector fallback chains, and the DataTransfer injection logic.

Top comments (0)