Claude Code Web Session Archiver

Archive a full Claude Code Web session into one self-contained HTML file: auto-scroll, expand collapsed blocks, download screenshots, optional fast mode and code-strip. Bilingual UI (EN/RU) auto-selected from the browser locale.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
Contento-R
今日安裝
1
安裝總數
3
評價
0 0 0
版本
1.1.2
建立日期
2026-05-21
更新日期
2026-05-21
尺寸
31.2 KB
授權條款
MIT
腳本執行於

Save the **entire** Claude Code Web session — including the history the cloud has already compacted — as a single self-contained HTML file with all screenshots embedded as `data:` URLs.

The script adds a small, draggable green panel to `claude.ai/code` and `claude.com/code` with three controls:

- **⬇ Archive** — walks the whole session, captures every message in chronological order, downloads screenshots, and saves one portable HTML file you can open offline in any browser.
- **⚡ Fast** — toggle. Switches to an aggressive timing profile (scroll wait 650 → 160 ms, expand wait 120 → 25 ms) and parallelizes screenshot downloads from 4 to 8 concurrent requests. Recommended on fast machines and good networks.
- **📝 No code** — toggle. Excludes code blocks Claude writes (tool calls, diffs, file viewers, `

` fences) so only the conversation between you and the agent is exported. Detection uses computed `font-family` on the live DOM, so it works regardless of how the upstream UI wraps its code containers.

The panel is draggable by the `⋮⋮` grip on its left edge; the position is remembered in `localStorage` between visits. UI strings (English / Russian) are auto-selected from the browser locale.

## Why

Claude Code Web compacts long sessions — older turns disappear from the live thread and survive only as a summary. This script walks the live DOM while everything is still rendered, so you can save the full transcript (plus screenshots) before the next compaction.

## How it works

1. Jumps to the top of the chat, then auto-scrolls down step by step so the virtualizer renders every message.
2. Expands every `
` and `aria-expanded="false"` disclosure block in view (skipped for code disclosures when *No code* is on). 3. De-duplicates captured messages by content and reassembles them in chronological order. 4. Downloads every screenshot via `fetch` (with a `GM_xmlhttpRequest` fallback for cross-origin CDNs) and inlines each one as a `data:` URL. 5. Builds one HTML file with a dark theme, sticky header (title / timestamp / source / version) and triggers a browser download. The output file is completely self-contained: no remote requests, no missing images, opens in any browser, works fully offline. ## Privacy Everything happens locally in your browser. The script makes **no** network calls beyond fetching the screenshots already shown in the chat (from `claude.ai`, `claude.com`, `anthropic.com`, `cloudfront.net`, `amazonaws.com`). No analytics, no telemetry, no third-party endpoints. ## Configuration The behaviour knobs live at the top of the script in `CFG_NORMAL` and `CFG_FAST`: | Key | Normal | Fast | | ------------------ | -----: | ---: | | `scrollStepRatio` | 0.6 | 0.9 | | `scrollWaitMs` | 650 | 160 | | `expandWaitMs` | 120 | 25 | | `stableLimit` | 4 | 3 | | `maxSteps` | 4000 | 4000 | | `minTextLen` | 8 | 8 | | `imgTimeoutMs` | 20000 | 20000| | `concurrency` | 4 | 8 | Edit them in the installed script — your userscript manager applies changes immediately. ## Compatibility Tampermonkey on Chrome, Edge, Firefox, Safari, Opera. Violentmonkey on Chromium / Firefox. Greasemonkey on Firefox. ## Source / contributing Source, issues and PRs: https://github.com/Contento-R/claude-code-web-archiver ## Credits Based on **"Claude Code Web to Markdown"** by **Aiuanyu** (MIT) — https://greasyfork.org/scripts/560005. This fork adds full-session auto-capture, screenshot embedding, a self-contained HTML export, fast / no-code modes and a draggable panel. ## License MIT.