Claude Memory Bridge

A Chrome extension that detects specific memory markers in Claude AI chats and bridges them to external storage via webhooks or serverless functions.

https://github.com/davidbmar/claude-memory-bridge  ·  public  ·  shipped

What it is

A browser-based utility that solves Claude's lack of persistent cross-session memory. It injects a content script into claude.ai to monitor page text for specific delimiters ('🧠 PERSISTENT MEMORY:'). When detected, it extracts the data and uses the extension's background service worker to bypass CORS restrictions, sending the payload to a configurable webhook URL or an AWS Lambda/S3 integration.

Features

Quickstart

git clone https://github.com/davidbmar/claude-memory-bridge.git
cd claude-memory-bridge/chrome-extension
# Open Chrome -> chrome://extensions -> Enable Developer Mode
# Click 'Load unpacked' and select the chrome-extension directory
# Edit content.js line 36 to set your desired webhookUrl
# Reload the extension and visit claude.ai

Architecture

flowchart TD
    User[User] -->|Types Prompt| Claude[Claude AI Web App]
    Claude -->|Renders Response with Delimiters| DOM[Page DOM]
    ContentScript[Content Script] -->|Polls every 2s| DOM
    ContentScript -->|Detects Pattern| Extract[Extract Memory Data]
    Extract -->|chrome.runtime.sendMessage| Background[Background Service Worker]
    Background -->|POST JSON| Webhook[External Webhook / API]
    Background -.->|Optional| Lambda[AWS Lambda]
    Lambda -->|Store| S3[(Amazon S3)]

How it's built

Built as a Manifest V3 Chrome Extension using vanilla JavaScript. It consists of a content script for DOM monitoring, a background service worker for network requests, and a popup for basic configuration. The backend integration is provided as a Node.js AWS Lambda function for storing data in S3.

How it runs

sequenceDiagram
    participant CS as Content Script
    participant DOM as Page DOM
    participant BG as Background Worker
    participant API as External Webhook

    Note over CS, DOM: Polling Loop (2s interval)
    CS->>DOM: Read document.body.textContent
    alt Contains '🧠 PERSISTENT MEMORY:'
        CS->>CS: Extract substring between delimiters
        CS->>BG: sendMessage({action: 'sendWebhook', data})
        activate BG
        BG->>API: POST JSON payload
        API-->>BG: 200 OK
        BG-->>CS: sendResponse({success: true})
        deactivate BG
        CS->>DOM: Update indicator to 'SENT!' (Blue)
    else No Match
        CS->>DOM: Keep indicator 'WORKING!' (Red)
    end

How to apply & reuse

1. Clone the repository. 2. Load the 'chrome-extension' folder as an unpacked extension in Chrome. 3. Configure the target webhook URL in 'content.js'. 4. Ensure your Claude prompts output text wrapped in the expected memory delimiters.

At a glance

CapabilitiesDOM Text MonitoringCross-Origin RequestsChrome Extension MessagingServerless Integration
Componentsmanifest.jsoncontent.jsbackground.jspopup.htmlpopup.jsserverless-integration/api/memory.js
TechJavaScriptChrome Extensions API (Manifest V3)AWS SDKHTML/CSS
Depends onChrome BrowserAccess to claude.ai
Integrates withWebhook.siteCustom REST APIsAWS LambdaAmazon S3
PatternsContent Script InjectionService Worker ProxyPollingMessage Passing
Reuse tagschrome-extensionai-memorywebhook-bridgeclaude-aiaws-lambda

Repo hygiene

✓ all on main — nothing unmerged.