Reddit

comment

reddit.com · Cowork
Download for Coworkthe skill folder, zipped
How to use it in Coworkonce per skill
Download the skill (.zip)

One .zip per skill. Inside: SKILL.md with the intent and the frontmatter, and the code that runs in the page.

Open Skills in Cowork

Settings → Personalize → Skills. This is Cowork's own skill library, shared across every chat.

Add → pick the .zip

Click Add and choose the file you just downloaded. Cowork installs it once; no CLAUDE.md, no per-project setup.

Ask in plain language

The skill stays available in every session. Cowork runs it in your own Chrome, riding the session you are already signed into.

Side effectwrite-irreversible
Authsession (a logged-in Reddit session is required, the API is signed with the account modhash)
Needsnavigate · evaluate
Summary

Comment on Reddit (reply to a post or a comment) via API.

Params
{"parentId":"string, REQUIRED (the thing to reply to: a post id in base36, or a fullname, t3_ for a post, t1_ for a comment)","text":"string, REQUIRED (the comment body, markdown)"}
Returns
{"posted":"bool","status":"int (HTTP of the create)","parentId":"string","permalink":"url|null (the new comment)","errors":"array (Reddit's own errors, e.g. rate limits)"}
SKILL.md64 lines

reddit-comment

Replies to a post or a comment. Read the thread with reddit-get-thread first, a reply that ignores the conversation reads as spam and gets you banned. Resolves in a single bridge call: the extractor fetches what it needs itself, so the params actually drive the request and no page is opened.

The extractor lives as text in the site's localStorage (key reddit-comment) and is rebuilt on each call with synchronous eval. It is stored once and then persists across navigation and browser restarts, so on every run except the first it is already there.

WRITE-IRREVERSIBLE. Every successful call posts the comment for real, under your account, and it cannot be undone from here. Confirm the parent and the text before calling.

Default action: just call (step 1). The call itself reports NEEDS_STORE when the extractor is missing or out of date, only then do you store it (step 2) and call again.

Versioning. The stored extractor is gated by VER (must match the version in the frontmatter above). Both snippets carry VER = "1", keep them in sync with the frontmatter. When evaluate.js changes, bump version and VER in both snippets: the next call sees the mismatch, returns NEEDS_STORE, and re-stores automatically. Storage stays at two keys (reddit-comment and reddit-comment:ver), overwritten each store, versions never accumulate.

1. Call (do this every run, params only, single bridge call)

await (() => {
  const KEY = "reddit-comment", VER = "1";
  const s = localStorage.getItem(KEY);
  if (!s || localStorage.getItem(KEY + ":ver") !== VER) return 'NEEDS_STORE';
  const fn = eval('(' + s + ')');
  return fn(document, { parentId: "t3_1rwi6a5", text: "Playwright has been the most reliable for us..." });
})()

Returns posted: true and the new comment's permalink. If it returns the string 'NEEDS_STORE', the extractor is missing or stale in this browser → do step 2 once, then run this exact call again.

Run this snippet verbatim. Never add an await before the eval, only the outer await is allowed.

Any reddit.com tab works, the extractor never reads the open page; the tab only supplies the origin and session.

2. Store (only when step 1 returned NEEDS_STORE; persists until localStorage is cleared)

From any reddit.com tab, evaluate the following with the bridge, replacing <FN> with the contents of evaluate.js (the ( async (root, params) => { ... } ) function). Keep VER equal to the call snippet's:

(() => {
  const KEY = "reddit-comment", VER = "1";
  const fn = (<FN>);
  localStorage.setItem(KEY, String(fn));
  localStorage.setItem(KEY + ":ver", VER);
  return 'stored';
})()

Returns "stored". The extractor passes through the model only here, once. Then go back to step 1.

Notes

Needs a logged-in session. The call first reads the account modhash from /api/me.json and signs the post with it; logged out there is no modhash and the call fails before writing anything.

Reddit rate-limits comments per account, and new/low-karma accounts are limited hard. Rate-limit refusals come back in errors with posted: false, it did not post; do not retry in a loop.

Errors

  • NEEDS_STORE → extractor missing or version-mismatched in this browser; run step 2 once, then retry step 1.
  • no modhash (session?) → not logged in; log in at reddit.com once.
  • posted: false with errors → Reddit refused (rate limit, banned subreddit, deleted parent). Nothing was posted.
  • request_failed / fetch fail → no reddit.com tab open, or the call ran cross-origin.

Success assertion

{ "type": "json", "jsonPath": "posted" }
comment: the Reddit skill in Cowork · browser-memory