A Claude Code Skill that saves X (Twitter) long-form articles as clean, well-formatted Markdown files.
- Uses
gallery-dlto fetch the full article HTML and images from an X/Twitter URL - Converts the HTML to clean Markdown with proper headings, paragraphs, and structure
- Optionally uploads images to Cloudflare R2 and embeds them in the Markdown
- Saves the final
.mdfile locally for reading in Obsidian or any Markdown viewer
- Claude Code installed
- Python 3 with
gallery-dl,beautifulsoup4,boto3installed - X/Twitter cookies exported as
twitter_cookies.txt(use the Chrome extension "Get cookies.txt LOCALLY") - (Optional) Cloudflare R2 bucket for image hosting
Add this skill to your Claude Code:
claude install-skill https://github.com/Wangdefou/twitter-article-to-markdownOr manually copy SKILL.md to your Claude Code skills directory.
Just tell Claude Code:
"Save this Twitter article: https://x.com/username/status/123456789"
Or use any of the trigger phrases:
- "Save Twitter long article" (保存推特长文)
- "Twitter article to Markdown" (推特文章转Markdown)
- "Save X long article" (保存X长文)
On first use, the skill will guide you through:
- Setting your local paths (gallery-dl, cookies, output directories)
- (Optional) Configuring Cloudflare R2 for image hosting
# Article Title
Original link: https://x.com/username/status/123456789
Article content...
---
MIT