/install hn-extract
HackerNews Extract
Extract a HackerNews post (article + comments) into single clean Markdown for quick reading or LLM input.
see Examples
What it does
- Accepts an HackerNews id or url
- Download the linked article HTML, cleans and formats it.
- Fetches the Hacknews post metadata and comments.
- Outputs a readable combined markdown file with original article, threaded comments, and key metadata.
Requirements
uvinstalled and in PATH.
Install
No install beyond having uv.
Dependencies will be installed automatically by uv into to a dedicated venv when run this script.
Usage Workflow (Mandatory for Agents)
When an agent is asked to extract a HackerNews post:
- Run the script with an output path:
uv run --script ${baseDir}/hn-extract.py \x3Cinput> -o /tmp/hn-\x3Cid>.md. - Send ONE combined message: Upload the file and ask the question in the same tool call. Use the
messagetool (action=send,filePath="/tmp/hn-\x3Cid>.md",message="Extraction complete. Do you want me to summarize it?"). - Do not output the full text or a summary directly in the chat unless specifically requested.
Usage
# run as uv script
uv run --script ${baseDir}/hn-extract.py \x3Chn-id|hn-url|path/to/item.json> [-o path/to/output.md]
# Examples
uv run --script ${baseDir}/hn-extract.py 46861313 -o /tmp/output.md
uv run --script ${baseDir}/hn-extract.py "https://news.ycombinator.com/item?id=46861313"
- Omit
-oto print to stdout. - Directories for
-oare created automatically.
Notes
- Retries are enabled for HTTP fetches.
- Comments are indented by thread depth.
- Sites requires authentication or blocks scraping may still fail.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install hn-extract - After installation, invoke the skill by name or use
/hn-extract - Provide required inputs per the skill's parameter spec and get structured output
What is HackerNews Extract?
Extract a HackerNews post (article + comments) into single clean Markdown for quick reading or LLM input. It is an AI Agent Skill for Claude Code / OpenClaw, with 2730 downloads so far.
How do I install HackerNews Extract?
Run "/install hn-extract" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is HackerNews Extract free?
Yes, HackerNews Extract is completely free (open-source). You can download, install and use it at no cost.
Which platforms does HackerNews Extract support?
HackerNews Extract is cross-platform and runs anywhere OpenClaw / Claude Code is available (darwin, linux, win32).
Who created HackerNews Extract?
It is built and maintained by guoqiao (@guoqiao); the current version is v0.1.5.