Read Reddit posts, comment threads, subreddit listings, and search results through a logged-in session cookie. Use when given a reddit.com link, or when asked to check what people say on Reddit (r/lif
SKILL.md.claude/skills/reddit/SKILL.md
GitHubRead Reddit
Target: $ARGUMENTS
Reddit blocks anonymous requests and WebFetch. Every request here sends the logged-in cookie from lambda/scripts/reddit_cookie.txt and a desktop Chrome User-Agent. Without both, Reddit returns 403 or an HTML page.
A single post with its comments
Use lambda/scripts/fetch_reddit.ts. It appends .json to the URL and prints the post and the full comment tree as Markdown.
REDDIT_COOKIE="$(cat lambda/scripts/reddit_cookie.txt)" npm run r lambda/scripts/fetch_reddit.ts "<post-url>" 2>/dev/null
- Pass the post permalink:
https://www.reddit.com/r/<sub>/comments/<id>/<slug>/. Share links (/s/<code>) andredd.it/<id>must be resolved first:curl -sLI -o /dev/null -w '%{url_effective}' "<url>". - Strip query strings (
?utm_source=...) from the URL before passing it. The script appends.jsonto the end of the string. 2>/dev/nullhides the ts-nodepunycodewarning. Drop it when the output is empty, to see theFailed: <status>line.- The script only handles post URLs. A subreddit or search URL prints nothing.
- Long threads: pipe through
head -n 300first, then read more if needed.
Subreddit listings and search
The script does not handle listings. Call the JSON API with curl and the same headers:
UA="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36"
reddit() { curl -s -A "$UA" -H "Accept: application/json" -H "Cookie: $(cat lambda/scripts/reddit_cookie.txt)" "$1"; }
LIST='.data.children[].data | "\(.created_utc | todate | .[:10]) \(.score)↑ \(.num_comments)c r/\(.subreddit) \(.title)\n https://www.reddit.com\(.permalink)"'
reddit "https://www.reddit.com/r/liftosaur/new.json?limit=25" | jq -r "$LIST"
reddit "https://www.reddit.com/r/liftosaur/top.json?t=month&limit=25" | jq -r "$LIST"
reddit "https://www.reddit.com/search.json?q=liftosaur&sort=new&limit=25" | jq -r "$LIST"
reddit "https://www.reddit.com/r/fitness/search.json?q=liftosaur&restrict_sr=1&sort=new&limit=25" | jq -r "$LIST"
- Sort options:
new,hot,top(witht=day|week|month|year|all),relevanceandcommentsfor search. - Paging: take
.data.afterfrom the response and pass&after=<value>. The maximumlimitis 100. - A user's posts and comments:
https://www.reddit.com/user/<name>/submitted.jsonand/comments.json. Comments have.bodyand.link_permalinkin place of.titleand.permalink. - To read a thread from a listing, pass its permalink to
fetch_reddit.ts.
When requests fail
- 403, or HTML where JSON was expected: the cookie expired. Ask Anton to paste a fresh
Cookieheader from a logged-in reddit.com tab (DevTools → Network → any reddit.com request → Request Headers →cookie) intolambda/scripts/reddit_cookie.txt. - 429: rate limited. Wait a minute and make fewer requests. Never loop over many threads in parallel.
- 404: the post was deleted, or the subreddit is private or banned.
Rules
- Read only. Never post, vote, comment, or send messages with this cookie. It is Anton's personal account.
- Never print the cookie value into the chat or into any file other than
reddit_cookie.txt. - When summarizing a thread, quote users by
u/<name>and link the permalink, so Anton can open the source.