Should I read this HN thread? Claude TL;DR
Pull every comment on an HN story via Algolia, flatten the tree, hand to claude for a dominant-view + dissent summary. Saves an hour.
Setup
- → claude /login OR export ANTHROPIC_API_KEY=sk-…
Cost per run
<$0.01
The one-liner
$ ID=42583107 # any HN story id
curl -s "https://hn.algolia.com/api/v1/items/$ID" \
| jq -r '.. | .text? // empty' \
| claude -p "These are all comments on an HN story. In 5 bullets: dominant view, strongest dissent, any concrete numbers cited, who got it right historically (if anyone), one open question."What each stage does
- [01] curl
curl -s "https://hn.algolia.com/api/v1/items/$ID"Algolia's `items` endpoint returns the FULL comment tree of a story as nested JSON — children inside children inside children. - [02] jq
jq -r '.. | .text? // empty'The recursive-descent trick: `..` walks every node, `.text?` returns the field if present, `// empty` skips nulls. Result: one comment text per line, tree flattened. - [03] claude
claude -p "In 5 bullets: …"All comments concatenated arrive on stdin. Claude doesn't need the tree structure — just the prose.
Expected output (sample)
- **Dominant view**: most commenters agree the new tokenizer is the real story, not the model size. - **Strongest dissent**: @user42 argues the benchmark is gameable and points to a 2024 leak; gets 38 upvotes. - **Numbers cited**: 3.2x faster inference, 41% lower latency P95, $0.12/1M tokens for the open-source variant. - **Got it right**: @user17 predicted this approach 4 months ago in a now-linked comment. - **Open question**: nobody explains how it handles non-Latin scripts.
Caveats & tips
- Big threads (>1000 comments) may exceed claude's context — slice with `head -c 200000` before piping.
- The Algolia items endpoint is the ONE source that gives you the full tree in a single call — the firebase API requires recursive fetches.