Inspiration
Moderating is hard work and decision fatigue is real. When you're a mod and discover a post that might be a violation but you're not 100% confident about it, you might want a second opinion. I wanted to give mods a way to get that second opinion through a tool without actively seek feedback.
What it does
Installing the tool adds a "Flag for second opinion" option to the mod menu on any post and a pinned post with a queue of flagged posts, each with a reason and the mod who flagged it. Other mods can vote to approve, remove, or skip and the first confirming vote from a second mod triggers automatic action. The mod who flagged a post can't vote on it themselves but can unflag their own post if they change their mind; all actions are logged in the History panel. Mods can also configure the vote threshold (defaults to 1 vote) and expiry window (defaults to 7 days) in the Settings panel.
How we built it
I used Claude Code to help build the tool using Devvit's web framework - Hono on the server, React + Tailwind on the client, Redis for the queue state. Menu actions and form submission are handled through Devvit's native menu and form APIs, with automatic post approval/removal via the Reddit API when a second opinion reaches vote threshold.
Challenges we ran into
- Figuring out how to send the info for a flagged post and have it persist in the queue took time (specifically the flow from flagging via menu item, to displaying the submission form, to submitting the form). Devvit's form submission handler didn't send through the originating post's context, so we worked around it by temporarily stashing the post ID in Redis, keyed by username.
- Devvit menu items are fully static - I wanted to dynamically show different menu item based on whether a pinned post was already created (ie "Create second opinion queue" if it doesn't exist yet and "Go to queue" if it already exists), but this was not possible; I worked around it by making the menu item redirect to the existing post if one already exists. Additionally I also wanted to hide the "Flag for second opinion" menu item on the mod menu if a post has already been flagged, but this was also not possible, so I added a handler that triggers an error in this case.
Accomplishments that we're proud of
The core loop works end-to-end: flag, review, vote, auto-action, and while iterating I added features like configurable thresholds, unflag action for accidental flags, an audit log for accountability, and edge case handling like a mod voting on a post they flagged themselves or flagging the queue post itself.
What we learned
Devvit's web framework is powerful but the gap between blocks-based and web-based docs is real. A lot of the form/menu behavior required reading type definitions directly.
What's next for Second Opinion
A few things we can add going forward:
- Mod notifications when a post gets flagged
- Weighted voting based on role (ie requiring a vote from a mod with full permissions)
- Bulk actions (ie approval, removal, clearing)
Built With
- claude
- devvit
- hono
- react
- redditapi
- redis
- tailwind-css
- typescript
Log in or sign up for Devpost to join the conversation.