csctf
Chat Shared Conversation To File - Convert ChatGPT, Gemini, Grok, and Claude share links to clean Markdown + HTML transcripts. Preserves code fences with language detection, deterministic filenames, GitHub Pages publishing. Bun-native CLI.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o csctf.zip https://jpskill.com/download/18644.zip && unzip -o csctf.zip && rm csctf.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/18644.zip -OutFile "$d\csctf.zip"; Expand-Archive "$d\csctf.zip" -DestinationPath $d -Force; ri "$d\csctf.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
csctf.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
csctfフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
CSCTF — チャット共有会話からファイルへ
BunネイティブなCLIで、公開されているChatGPT、Gemini、Grok、Claudeの共有リンクを、整形されたMarkdown + HTMLトランスクリプトに変換します。コードフェンスは保持され、ファイル名は安定しており、GitHub Pagesへの公開もオプションで可能です。
これが存在する理由
AI共有リンクのコピー&ペーストは、しばしば以下の問題を抱えています。
- フェンス付きコードブロックの崩壊 — フォーマットと構造が失われる
- 言語ヒントの消失 — 構文ハイライトがなくなる
- ファイル名の乱雑化 — ランダムまたは判読不能な名前
- 手動でのクリーンアップが必要 — 一貫性のないフォーマット
CSCTFは、以下の機能でこれを解決します。
- 安定したスラッグ — 決定論的で衝突防止のファイル名
- 言語を保持するフェンス — コードブロックは構文ヒントを保持
- 正規化された空白 — きれいで一貫性のある出力
- 静的なHTMLツイン — JSなし、ホスティング/アーカイブの準備完了
- ワンコマンドGitHub Pages — 即座に共有可能なマイクロサイト
クイックスタート
# インストール
curl -fsSL https://raw.githubusercontent.com/Dicklesworthstone/chat_shared_conversation_to_file/main/install.sh | bash
# 任意の共有リンクを変換
csctf https://chatgpt.com/share/69343092-91ac-800b-996c-7552461b9b70
csctf https://gemini.google.com/share/66d944b0e6b9
csctf https://grok.com/share/bGVnYWN5_d5329c61-f497-40b7-9472-c555fa71af9c
csctf https://claude.ai/share/549c846d-f6c8-411c-9039-a9a14db376cf
出力:
<conversation_title>.md— コードフェンスが保持されたきれいなMarkdown<conversation_title>.html— スタイル付きの静的HTML(JavaScriptはゼロ)
サポートされているプロバイダ
| プロバイダ | URLパターン | 方式 | 注記 |
|---|---|---|---|
| ChatGPT | chatgpt.com/share/* |
Headless Chromium | 公開共有のみ |
| Gemini | gemini.google.com/share/* |
Headless Chromium | 公開共有のみ |
| Grok | grok.com/share/* |
Headless Chromium | 公開共有のみ |
| Claude | claude.ai/share/* |
あなたのChromeセッション | ログインが必要 |
Claude.ai の特別な扱い
Claude.ai は、標準的なブラウザ自動化をブロックする Cloudflare 保護を使用しています。CSCTF はこれを自動的に処理します。
- あなたの Chrome セッションクッキーを一時的なプロファイルにコピーします
- リモートデバッグが有効な状態で Chrome を起動します
- Chrome DevTools Protocol 経由で接続し、会話を抽出します
- Chrome が実行中の場合、タブを保存し、再起動し、後で復元することを提案します
要件: Chrome がインストールされ、通常の Chrome セッションで claude.ai にログインしていること。
設計原則
| 原則 | 実装 |
|---|---|
| 決定論 | 明示的なスラッグ処理と衝突処理 |
| 最小限のネットワーク | 取得されるのは共有URLのみ(アップデートチェック/公開はオプトイン) |
| 安全性 | 静的HTML(インラインCSS/HLJS)、スクリプトは出力されない |
| 明瞭さ | 色分けされたステップごとのロギング、確認ゲート |
| 原子性 | 一時ファイルへの書き込みとリネームにより、部分的なファイルを防ぐ |
仕組み
ChatGPT, Gemini, Grok (エンドツーエンド)
1. ステルス設定でヘッドレス Playwright Chromium を起動します
(スプーフィングされたナビゲータプロパティ、現実的なヘッダー)
2. 遅延ロードアセットのために2回ナビゲートします (domcontentloaded → networkidle)
3. URLホスト名からプロバイダを検出します
4. リトライ/フォールバックでプロバイダ固有のセレクタを待ちます
5. 各ロールの内部HTML (assistant/user) を抽出し、Shadow DOM をトラバースします
6. ピル/メタデータをクリーンアップし、フェンス付きコードルールで Turndown を実行します
7. 空白と改行を正規化します
8. Markdown を一時ファイルに書き込み、アトミックにリネームします
9. インライン CSS/TOC/HLJS で HTML ツインをレンダリングします
Claude.ai
1. Chrome セッションクッキーを一時的なプロファイルにコピーします
2. リモートデバッグで Chrome を起動します
3. Chrome DevTools Protocol 経由で接続します
4. 会話 HTML を抽出します
5. 同じ Turndown/正規化パイプラインで処理します
6. 一時的なプロファイルをクリーンアップします
処理アルゴリズム
セレクタ戦略
フォールバックチェーンを持つプロバイダ固有のセレクタ:
- ChatGPT:
article [data-message-author-role] - Gemini: カスタムWebコンポーネント (
share-turn-viewer,response-container) - Grok: 柔軟な
data-testidパターン - Claude:
[data-testid="user-message"]およびストリーミングインジケータ
それぞれに、短いタイムアウトで試行される複数のフォールバックがあります。
Turndown のカスタマイズ
- フェンス付きコードブロックを挿入します
class="language-*"経由で言語を検出します- 引用ピルと
data-start/data-end属性を削除します
正規化
- 改行を
\nに変換します - Unicode LS/PS 文字を削除します
- 過剰な空白行を折りたたみます
スラッグアルゴリズム
Title → 小文字化 → 英数字以外 → "_" → トリム → 最大120文字
→ Windows 予約名サフィックス → 衝突サフィックス (_2, _3, ...)
HTML レンダリング
- Markdown-it + highlight.js
- TOC のための見出しスラッグの重複排除
- ライト/ダーク/印刷用のインライン CSS
- JavaScript はゼロ
コマンドリファレンス
csctf <share-url> [options]
出力オプション
| フラグ | デフォルト | 説明 |
|---|---|---|
--outfile <path> |
auto | 出力パスを上書き |
--no-html / --md-only |
off | HTML出力をスキップ |
--html-only |
off | Markdown出力をスキップ |
--quiet |
off | 最小限のロギング |
--timeout-ms <ms> |
60000 |
ナビゲーション + セレクタのタイムアウト |
GitHub Pages への公開
| フラグ | デフォルト | 説明 |
|---|---|---|
--publish-to-gh-pages |
off | GitHub Pages に公開 |
--gh-pages-repo <owner/name> |
my_shared_conversations |
ターゲットリポジトリ |
--gh-pages-branch <branch> |
gh-pages |
ターゲットブランチ |
--gh-pages-dir <dir> |
csctf |
リポジトリ内のサブディレクトリ |
--remember |
off | GH 設定を保存 |
--forget-gh-pages |
off | 保存された設定をクリア |
--dry-run |
off | 公開をシミュレート (インデックスをビルド、プッシュはしない) |
--yes / --no-confirm |
off | PROCEED 確認プロンプトをスキップ |
--gh-install |
off | gh CLI を自動インストール |
その他
| フラグ | 説明 |
|---|---|
--check-updates |
最新のリリース・タグを出力 |
--version |
バージョンを出力して終了 |
出力形式
Markdown 構造
# 会話: <Title>
**ソース:** https://chatgpt.com/share/...
**取得日時:**
(原文はここで切り詰められています) 📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
CSCTF — Chat Shared Conversation To File
A Bun-native CLI that turns public ChatGPT, Gemini, Grok, and Claude share links into clean Markdown + HTML transcripts with preserved code fences, stable filenames, and optional GitHub Pages publishing.
Why This Exists
Copy/pasting AI share links often:
- Breaks fenced code blocks — loses formatting and structure
- Loses language hints — no syntax highlighting
- Produces messy filenames — random or unreadable names
- Requires manual cleanup — inconsistent formatting
CSCTF fixes this with:
- Stable slugs — deterministic, collision-proof filenames
- Language-preserving fences — code blocks retain syntax hints
- Normalized whitespace — clean, consistent output
- Static HTML twin — no JS, ready for hosting/archiving
- One-command GitHub Pages — instant shareable microsite
Quick Start
# Install
curl -fsSL https://raw.githubusercontent.com/Dicklesworthstone/chat_shared_conversation_to_file/main/install.sh | bash
# Convert any share link
csctf https://chatgpt.com/share/69343092-91ac-800b-996c-7552461b9b70
csctf https://gemini.google.com/share/66d944b0e6b9
csctf https://grok.com/share/bGVnYWN5_d5329c61-f497-40b7-9472-c555fa71af9c
csctf https://claude.ai/share/549c846d-f6c8-411c-9039-a9a14db376cf
Output:
<conversation_title>.md— Clean Markdown with preserved code fences<conversation_title>.html— Styled static HTML (zero JavaScript)
Supported Providers
| Provider | URL Pattern | Method | Notes |
|---|---|---|---|
| ChatGPT | chatgpt.com/share/* |
Headless Chromium | Public shares only |
| Gemini | gemini.google.com/share/* |
Headless Chromium | Public shares only |
| Grok | grok.com/share/* |
Headless Chromium | Public shares only |
| Claude | claude.ai/share/* |
Your Chrome session | Requires login |
Claude.ai Special Handling
Claude.ai uses Cloudflare protection that blocks standard browser automation. CSCTF handles this automatically:
- Copies your Chrome session cookies to a temporary profile
- Launches Chrome with remote debugging enabled
- Connects via Chrome DevTools Protocol to extract conversation
- If Chrome is running, offers to save tabs, restart, and restore afterward
Requirements: Chrome installed + logged into claude.ai in your regular Chrome session.
Design Principles
| Principle | Implementation |
|---|---|
| Determinism | Explicit slugging and collision handling |
| Minimal network | Only share URL fetched (update checks/publish opt-in) |
| Safety | Static HTML (inline CSS/HLJS), no scripts emitted |
| Clarity | Colorized step-based logging, confirmation gates |
| Atomicity | Temp+rename writes prevent partial files |
How It Works
ChatGPT, Gemini, Grok (End-to-End)
1. Launch headless Playwright Chromium with stealth config
(spoofed navigator properties, realistic headers)
2. Navigate twice (domcontentloaded → networkidle) for late-loading assets
3. Detect provider from URL hostname
4. Wait for provider-specific selectors with retry/fallback
5. Extract each role's inner HTML (assistant/user), traverse Shadow DOM
6. Clean pills/metadata, run Turndown with fenced-code rule
7. Normalize whitespace and newlines
8. Write Markdown to temp file, rename atomically
9. Render HTML twin with inline CSS/TOC/HLJS
Claude.ai
1. Copy Chrome session cookies to temporary profile
2. Launch Chrome with remote debugging
3. Connect via Chrome DevTools Protocol
4. Extract conversation HTML
5. Process through same Turndown/normalization pipeline
6. Clean up temporary profile
Processing Algorithms
Selector Strategy
Provider-specific selectors with fallback chains:
- ChatGPT:
article [data-message-author-role] - Gemini: Custom web components (
share-turn-viewer,response-container) - Grok: Flexible
data-testidpatterns - Claude:
[data-testid="user-message"]and streaming indicators
Each has multiple fallbacks tried with short timeouts.
Turndown Customization
- Injects fenced code blocks
- Detects language via
class="language-*" - Strips citation pills and
data-start/data-endattributes
Normalization
- Converts newlines to
\n - Removes Unicode LS/PS characters
- Collapses excessive blank lines
Slugging Algorithm
Title → lowercase → non-alphanumerics → "_" → trim → max 120 chars
→ Windows reserved-name suffix → collision suffix (_2, _3, ...)
HTML Rendering
- Markdown-it + highlight.js
- Heading slug de-dupe for TOC
- Inline CSS for light/dark/print
- Zero JavaScript
Command Reference
csctf <share-url> [options]
Output Options
| Flag | Default | Description |
|---|---|---|
--outfile <path> |
auto | Override output path |
--no-html / --md-only |
off | Skip HTML output |
--html-only |
off | Skip Markdown output |
--quiet |
off | Minimal logging |
--timeout-ms <ms> |
60000 |
Navigation + selector timeout |
GitHub Pages Publishing
| Flag | Default | Description |
|---|---|---|
--publish-to-gh-pages |
off | Publish to GitHub Pages |
--gh-pages-repo <owner/name> |
my_shared_conversations |
Target repo |
--gh-pages-branch <branch> |
gh-pages |
Target branch |
--gh-pages-dir <dir> |
csctf |
Subdirectory in repo |
--remember |
off | Save GH settings |
--forget-gh-pages |
off | Clear saved settings |
--dry-run |
off | Simulate publish (build index, no push) |
--yes / --no-confirm |
off | Skip PROCEED confirmation prompt |
--gh-install |
off | Auto-install gh CLI |
Other
| Flag | Description |
|---|---|
--check-updates |
Print latest release tag |
--version |
Print version and exit |
Output Format
Markdown Structure
# Conversation: <Title>
**Source:** https://chatgpt.com/share/...
**Retrieved:** 2026-01-08T15:30:00Z
## User
How do I sort an array in Python?
## Assistant
Here's how to sort an array in Python:
```python
# Sort in place
my_list.sort()
# Return new sorted list
sorted_list = sorted(my_list)
### HTML Features
- **Standalone** — No external dependencies
- **Zero JavaScript** — Safe for any hosting
- **Inline CSS** — Light/dark mode via `prefers-color-scheme`
- **Syntax highlighting** — highlight.js themes inline
- **Table of contents** — Auto-generated from headings
- **Language badges** — Code block language indicators
- **Print-friendly** — Optimized print styles
## Filename Generation
"How to Build a REST API" → how_to_build_a_rest_api.md "Python Tips & Tricks!" → python_tips_tricks.md "File exists already" → file_exists_already_2.md
Rules:
- Lowercase
- Non-alphanumerics → `_`
- Trimmed leading/trailing `_`
- Max 120 characters
- Windows reserved names suffixed
- Collisions: `_2`, `_3`, ...
## GitHub Pages Publishing
### Quick Recipe
```bash
# Publish with defaults
csctf <url> --publish-to-gh-pages --yes
# Creates: <gh-username>/my_shared_conversations repo
# Branch: gh-pages
# Directory: csctf/
Remembered Settings
# First time: save settings
csctf <url> --publish-to-gh-pages --remember --yes
# Subsequent: just use --yes
csctf <url> --yes
# Clear remembered settings
csctf --forget-gh-pages
Custom Configuration
csctf <url> --publish-to-gh-pages \
--gh-pages-repo myuser/my-chats \
--gh-pages-branch main \
--gh-pages-dir exports \
--yes
Requirements
- GitHub CLI (
gh) installed and authenticated - Verify with:
gh auth status
Publish Flow
- Resolve repo/branch/dir (use remembered or defaults)
- Clone (or create via
gh) - Copy MD + HTML files
- Regenerate
manifest.jsonandindex.html - Commit + push
- Print viewer URL
Recipes
Quiet CI Scrape (MD only)
csctf <url> --md-only --quiet --outfile /tmp/chat.md
HTML-only for Embedding
csctf <url> --html-only --outfile site/chat.html
Slow/Large Conversations
csctf <url> --timeout-ms 90000
Custom Browser Cache
PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright csctf <url>
Batch Archive
for url in $URLS; do
csctf "$url" --outfile ~/archive/ --quiet
done
Security & Privacy
Network Behavior
- Only fetches: The share URL itself
- Opt-in: Update checks, GitHub publish flows
- Auth: GitHub CLI (
gh) for publishing—no tokens stored
HTML Safety
- Zero JavaScript in output
- Inline styles only
- Citation pills and data attributes stripped
- highlight.js used statically
Filesystem
- Temp+rename write pattern (atomic)
- Collision-proof naming
- Config:
~/.config/csctf/config.json
Claude.ai Cookies
- Copied to temporary directory only
- Used for single scraping session
- Original Chrome profile never modified
Performance
| Phase | Time |
|---|---|
| First run (Chromium download) | 30-60s |
| Subsequent runs | 5-15s |
| Claude.ai (uses local Chrome) | 5-10s |
Characteristics
- Playwright browsers cached after first run
- 60s default timeout, 3-attempt backoff
- Single page/context, linear processing
- Atomic writes prevent partial outputs
Failure Modes & Remedies
| Symptom | Fix |
|---|---|
| "No messages found" | Link is private or layout changed; verify public share, retry with --timeout-ms 90000 |
| Bot detection / challenge page | Stealth techniques used; retry or verify link in browser |
| Timeout or blank page | Raise --timeout-ms, verify connectivity |
| Publish fails (auth) | Ensure gh auth status passes |
| Publish fails (branch/dir) | Pass --gh-pages-branch / --gh-pages-dir; use --remember |
| Filename collisions | Expected; tool appends _2, _3, ... |
| Claude.ai Cloudflare challenge | Complete verification in Chrome window, press Enter |
| Claude.ai won't load | Ensure logged into claude.ai in Chrome; close Chrome if prompted |
Environment Variables
Runtime
| Variable | Description |
|---|---|
PLAYWRIGHT_BROWSERS_PATH |
Reuse cached Chromium bundle |
Installer
| Variable | Description | Default |
|---|---|---|
VERSION |
Pin release tag | latest |
DEST |
Install directory | ~/.local/bin |
CHECKSUM_URL |
Override checksum location | — |
File Locations
| Path | Purpose |
|---|---|
~/.local/bin/csctf |
Binary |
~/.config/csctf/config.json |
GitHub Pages settings |
~/.cache/ms-playwright/ |
Playwright Chromium cache |
Installation
# One-liner (recommended)
curl -fsSL https://raw.githubusercontent.com/Dicklesworthstone/chat_shared_conversation_to_file/main/install.sh | bash
# Pin version
VERSION=v1.0.0 curl -fsSL .../install.sh | bash
# Custom directory
DEST=/opt/bin curl -fsSL .../install.sh | bash
# Verify checksum
curl -fsSL .../install.sh | bash -s -- --verify
From Source
bun install
bun run build
# Binary at dist/csctf
Comparison
| Feature | Copy/Paste | csctf |
|---|---|---|
| Code blocks preserved | Often broken | Always preserved |
| Language hints | Lost | Detected and kept |
| Filenames | Random/messy | Deterministic slugs |
| HTML output | None | Styled, no-JS twin |
| GitHub Pages | Manual | One command |
| Collision handling | Overwrite | Auto-suffix |
Limitations
- Requires public share links (except Claude.ai which uses your session)
- Provider layouts may change (selectors maintained with fallbacks)
- Markdown/HTML exports require share to be available at scrape time
- Claude.ai requires Chrome installed with active login session
- First run downloads Playwright Chromium (~200MB)
Integration with Flywheel
| Tool | Integration |
|---|---|
| CASS | Archive conversations for session search |
| CM | Extract procedural memory from exported chats |
| Agent Mail | Attach conversation exports to agent messages |
| NTM | Export multi-agent session transcripts |