Inspiration
Moderation on Reddit is invisible, thankless, and relentless. We spent time talking to moderators of mid-to-large subreddits and kept hearing the same frustration: investigating a single suspicious user requires opening 5 or 6 separate tabs — profile history, the mod log, modmail, Toolbox notes, native mod notes, report history — mentally assembling a picture that should already exist in one place. On a busy news day, a mod team might do this 50 times. That is hours of cognitive overhead, every day, for volunteers.
The question we kept coming back to was simple: what if a moderator never had to leave the queue to understand who they were dealing with?
What it does
ContextLens adds a single right-click action — "View user context" — to every post and comment on a subreddit. When triggered, it instantly surfaces a complete moderation picture of the target user without opening a single new tab.
The experience has two layers:
Quick summary modal — appears in seconds and shows a 2–3 sentence plain-English narrative summary of the user's moderation history, a signal count (watch or concern flags), and core account stats. A moderator can read this in under 10 seconds and make a confident triage decision. If they want to add a mod note, they can do it right there — the note field is pre-filled from the summary.
Full dashboard — a WebView panel with a colour-coded signal grid (7 signals including account age, removal rate, posting burst detection, report density, mod notes, Toolbox usernotes, and karma/activity ratio), a chronological moderation history timeline, and a quick action bar for adding notes, removing content, or banning — all with confirmation steps before anything is executed.
Every signal is scored transparently using deterministic logic. No black-box decisions. The app tells you exactly why a flag was raised, and the moderator stays in full control at every step.
How we built it
ContextLens is built entirely on Reddit's Devvit platform in TypeScript, with a React WebView client and a Hono server layer handling API orchestration.
The most important architectural decision was parallelism. Every data fetch —
user history, mod log, mod notes, Toolbox usernotes, account info — runs
simultaneously inside a single Promise.allSettled() call rather than
sequentially. This keeps response times well under Devvit's 30-second request
limit even for users with long histories, and ensures that a failure in any
one API call degrades gracefully rather than crashing the whole panel.
Results are cached in Devvit's Redis store with a 5-minute TTL per user per subreddit, so repeated lookups during a busy queue session are near-instant.
Toolbox usernotes required a custom parser — the wiki page format is base64-encoded and zlib-compressed, with no official documentation. We reverse- engineered the format and built a decoder that wraps the entire pipeline in a try/catch, returning an empty array on any failure so legacy note support never blocks the main flow.
The narrative summary engine is entirely template-driven — no external AI inference. We wrote 20 human-authored sentence templates covering every meaningful signal combination, selected via a priority cascade that checks concern signals first, then watch, then clean. The result reads like something a senior moderator would write in a handover note, not a system alert.
Challenges we ran into
The Form UI has no read-only components. Devvit's Form builder only supports input fields — there is no paragraph or display text element. To show the narrative summary, signal count, and stats inside the modal, we had to place them in the label parameters of form fields, which renders them as editable text boxes. We added clear labelling to manage this, but it exposed a real gap in the platform's UI primitives.
Forms only support two buttons. The Reddit client silently ignores any third button on a Form modal. Our original design called for an "Open Full Dashboard" button alongside "Add Mod Note" and "Dismiss." When it didn't appear, we rebuilt the trigger as a checkbox toggle — less elegant but functionally equivalent.
Username persistence across async callbacks. Devvit's menu item handler and form submission handler run in separate execution contexts. A username stored in a local variable in the menu handler is gone by the time the form submits. We solved this by writing the username to Redis with a short TTL keyed to the moderator's user ID, retrieved on form submission.
The 30-second timeout is unforgiving. Users with very long Reddit histories could push fetch times close to the limit. The combination of parallelism, 90-day data windows instead of all-time, and Redis caching brought p95 response times down to under 8 seconds in testing.
Accomplishments that we're proud of
The narrative summary quality surprised us. Writing 20 templates that cover the combinatorial space of moderation signals — and making each one sound like it was written by a human moderator rather than a status code — turned out to be the most careful part of the whole project. Getting that tone right, where the summary is direct without being alarmist and honest without being useless, took more iteration than any of the code.
We're also proud of the graceful degradation design. Private profiles, deleted accounts, brand-new users with no history — every edge case returns something useful rather than crashing or showing a blank panel. The confidence indicator (High / Moderate / Limited) means a moderator always knows exactly how much to trust what they're seeing.
And the install experience: ContextLens requires zero subreddit-specific configuration. Install it, right-click a post, it works. For volunteer moderators who don't want to spend an hour reading documentation, that was a non-negotiable design constraint.
What we learned
Moderators don't distrust automation — they distrust opacity. Every time we showed an early version to a moderator, the first question was "why is this flagged?" not "what should I do about it?" The decision to make every signal transparent and source-attributed came directly from that feedback, and it changed how we thought about the whole product. The goal was never to replace moderator judgment. It was to give moderators the context to exercise their judgment faster.
We also learned that Devvit's platform constraints — the 30-second timeout, the two-button form limit, the lack of read-only UI components — aren't blockers so much as design prompts. Each one forced a simpler solution than what we'd originally planned, and the simpler solutions turned out to be better for moderators who are moving fast through a queue.
What's next for ContextLens — Moderation Context Intelligence
The immediate priority is cross-subreddit context. Right now ContextLens shows a user's history within the current subreddit only. The most valuable moderation signal — whether someone is causing problems across multiple communities simultaneously — requires cross-subreddit data, and we want to add that as an opt-in signal for moderators who want it.
We also want to build a lightweight pattern library: when ContextLens sees a signal combination it has seen before (new account + posting burst + prior removals across communities), it can surface similar past cases from the subreddit's own moderation history. Not a prediction — a reference. "The last 3 accounts with this pattern were determined to be ban evasions" is more useful than any score.
Longer term, ContextLens is a natural foundation for moderation workflow tools that don't exist yet on Devvit — queue prioritisation, shift handover summaries for mod teams across timezones, and burnout detection based on queue aging patterns. The context aggregation layer we've built is reusable infrastructure for all of these.
Built With
- css
- devvit
- hono
- html5
- javascript
- react
- reddit-moderator-api
- reddit-public-api
- reddit-redis-service
- typescript
Log in or sign up for Devpost to join the conversation.