← Back to Skills Marketplace
guobaba1

browser-session-archive

by guobaba1 · GitHub ↗ · v1.0.1 · MIT-0
darwinlinux ✓ Security Clean
147
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install browser-session-archive
Description
Extracts and archives chatgpt.com and claude.ai share links to Markdown using Chrome CDP (e.g., ChatGPT or Claude conversations).
README (SKILL.md)

Browser Session Archive

Extracts and archives chatgpt.com and claude.ai share links to Markdown using Chrome DevTools Protocol.

Triggers

User message contains:

  1. Keywords: 提取 chatgpt, 提取 claude, 提取文档, 提取 chatgpt 对话, 提取 claude 对话, 归档 chatgpt 对话, 归档 claude 对话, 保存 chatgpt 对话, 保存 claude 对话, extract chatgpt, extract claude, archive chatgpt, archive claude, save chatgpt, save claude
  2. Links:
    • https://chatgpt.com/share/{share-id}
    • https://claude.ai/share/{share-id}

Usage

Quick Start

# Copy script to PATH
cp {baseDir}/scripts/extract.sh /usr/local/bin/
chmod +x /usr/local/bin/extract.sh

# Run
extract.sh "https://chatgpt.com/share/xxx"
extract.sh "https://claude.ai/share/xxx"

Step by Step

# 1. Capture HTML
cd {baseDir}/scripts
CHROME_DEBUG_PORT=9222 TARGET_URL="https://chatgpt.com/share/xxx" \
  node capture-cdp.js

# 2. Convert to Markdown (use output path from step 1)
node convert-markdown.js --metadata "~/LookBack/$(date +%Y-%m-%d)/ChatGPT/.metadata.json"

Environment Variables

Variable Description Default
CHROME_DEBUG_PORT Chrome debugging port 9222
TARGET_URL Share link URL (required)
OUTPUT_DIR Output directory ~/LookBack/{date}/{ChatGPT|Claude}

Output Structure

~/LookBack/{YYYY-MM-DD}/
├── ChatGPT/
│   ├── {title}-{timestamp}.md              # Markdown file
│   ├── {title}-{timestamp}-captured.html   # HTML snapshot
│   └── .metadata.json                       # Metadata
└── Claude/
    └── ...

Prerequisites

  1. Chrome Debug Mode: Start Chrome with --remote-debugging-port=9222

    # macOS
    open -a "Google Chrome" --args --remote-debugging-port=9222
    
    # Linux
    google-chrome --remote-debugging-port=9222
    
  2. Install Dependencies:

    npm install -g ws
    

Error Handling

Error Cause Solution
Connection refused Chrome debug port not open Start Chrome with --remote-debugging-port
Timeout Page loading slow Increase wait time or refresh manually
Target not found Invalid link Verify the share link is correct

Scripts

Script Description
capture-cdp.js CDP capture script, extracts HTML
convert-markdown.js HTML to Markdown converter
extract.sh One-click entry script

References

Usage Guidance
This skill appears to do what it says — it uses the Chrome DevTools Protocol locally to fetch page HTML and convert it to Markdown. Before installing or running it: 1) Do not expose Chrome's --remote-debugging-port to untrusted networks; keep it bound to localhost. 2) Prefer running Chrome in a dedicated profile or a fresh browser instance (not your main profile) to avoid unintentionally capturing authenticated sessions or sensitive tabs. 3) You can skip a global 'npm install -g ws' by running npm install in the script directory (package.json already lists ws). 4) 'bun' is declared but not required by the code; only Node.js is needed to run the scripts. 5) Review output files in the chosen OUTPUT_DIR and remove any captures you don't want stored. If you want greater assurance, inspect the three included scripts yourself or run them in an isolated environment.
Capability Assessment
Purpose & Capability
The name/description (archive ChatGPT/Claude share pages) aligns with the included scripts: capture-cdp.js connects to a local Chrome DevTools Protocol endpoint and saves HTML, and convert-markdown.js transforms HTML to Markdown. Small mismatch: the skill declares 'bun' as a required binary but all scripts run under node; bun is optional/unsupported in the code. The metadata/instructions ask you to install the 'ws' npm module globally even though a package.json with a local dependency is present (redundant, but explainable).
Instruction Scope
Runtime instructions are narrowly scoped to: connect to a local Chrome debug port, open or create a page for the TARGET_URL, capture document HTML, and convert to Markdown. The scripts only read/write local files under the chosen OUTPUT_DIR. Important security note included in SKILL.md: CDP access can read any page loaded in that Chrome profile (including authenticated content), which is inherent to this approach and not hidden in the instructions.
Install Mechanism
No network downloads of arbitrary archives are performed. The package includes local JS scripts and a package.json with 'ws' in dependencies. The skill asks the user to run 'npm install -g ws' as a prerequisite (global install is unnecessary but low-risk). There is no remote URL download or extraction of external code.
Credentials
The skill requests no secret credentials or config paths. It does require access to a local Chrome remote-debugging port (default 9222) and will read the pages open in that browser session. Because CDP exposes page content and resources, running this against a Chrome instance where you are logged into services will allow the script to capture authenticated content — this is a legitimate capability for an archiver but a privacy/security consideration the user must weigh.
Persistence & Privilege
The skill does not request permanent/always-enabled privileges, does not modify other skills or system-wide settings, and runs only when invoked. It writes output to a user-controlled directory. 'always: false' and normal model invocation are used.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install browser-session-archive
  3. After installation, invoke the skill by name or use /browser-session-archive
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
1. Added more trigger keywords to SKILL. 2. Added a "silent mode" for the browser in capture-cdp.js. 3. Fixed formatting loss issues in convert-markdown.js.
v1.0.0
Initial release of browser-session-archive. - This skill extracts and archives chat conversations from web-based AI assistants (such as ChatGPT or Claude) using your existing browser session. - It leverages browser automation techniques (e.g., CDP/WebSocket) to access active sessions without requiring manual login, and converts conversations into structured Markdown files. - Useful for knowledge management, conversation backup, prompt analysis, and dataset collection. - After installation, users simply need to: Navigate to the `scripts` directory Run `npm install` Run `extract.sh "link"`
Metadata
Slug browser-session-archive
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is browser-session-archive?

Extracts and archives chatgpt.com and claude.ai share links to Markdown using Chrome CDP (e.g., ChatGPT or Claude conversations). It is an AI Agent Skill for Claude Code / OpenClaw, with 147 downloads so far.

How do I install browser-session-archive?

Run "/install browser-session-archive" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is browser-session-archive free?

Yes, browser-session-archive is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does browser-session-archive support?

browser-session-archive is cross-platform and runs anywhere OpenClaw / Claude Code is available (darwin, linux).

Who created browser-session-archive?

It is built and maintained by guobaba1 (@guobaba1); the current version is v1.0.1.

💬 Comments