← 返回 Skills 市场
guobaba1

browser-session-archive

作者 guobaba1 · GitHub ↗ · v1.0.1 · MIT-0
darwinlinux ✓ 安全检测通过
147
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install browser-session-archive
功能描述
Extracts and archives chatgpt.com and claude.ai share links to Markdown using Chrome CDP (e.g., ChatGPT or Claude conversations).
使用说明 (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

安全使用建议
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install browser-session-archive
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /browser-session-archive 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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"`
元数据
Slug browser-session-archive
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

browser-session-archive 是什么?

Extracts and archives chatgpt.com and claude.ai share links to Markdown using Chrome CDP (e.g., ChatGPT or Claude conversations). 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 147 次。

如何安装 browser-session-archive?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install browser-session-archive」即可一键安装,无需额外配置。

browser-session-archive 是免费的吗?

是的,browser-session-archive 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

browser-session-archive 支持哪些平台?

browser-session-archive 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(darwin, linux)。

谁开发了 browser-session-archive?

由 guobaba1(@guobaba1)开发并维护,当前版本 v1.0.1。

💬 留言讨论