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.
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.