The Code Exorcist: an AI agent diagnoses bugs, a human banishes them (Sanity + Next.js) A developer built The Code Exorcist, a horror-themed AI bug-triage app using Next.js, Sanity Studio v3, and a Groq-hosted Llama model that reads an error/stack trace alongside the buggy code to identify a root cause, categorize the bug, assign a threat level, and propose a fix. Human reviewers approve or reject each diagnosis directly in Sanity Studio via custom document actions, with every decision logged and streamed live to the frontend through Sanity's client.listen() API. The build hit real errors including Groq model_not_found responses that forced a swap to openai/gpt-oss-20b, a duplicate status field that blocked Studio from booting, and case-sensitivity failures on Vercel that exposed unused leftover files. This is a submission for the Sanity Challenge, Path Two: Vibe-Code Something Strange https://dev.to/challenges/sanity-2026-09-16 The Code Exorcist is a horror-themed AI bug-triage app built with Next.js and Sanity. A developer pastes an error/stack trace and the actual buggy code snippet. A Groq-powered agent reads both together, finds the real root cause, names the "demon" bug category , assigns a threat level, and writes a concrete fix. A human reviewer then makes the final call — directly from Sanity Studio — by clicking either 💀 BANISH approve the fix, close the case or 🔄 Send Back for Re-analysis reject it, reset the case to uncontained . Every decision is logged, timestamped, and visible live on the frontend with zero page reloads. It's built for the moment right after a bug report lands — when a team wants a fast, structured first pass before anyone commits real review time to it. 🎬 Video walkthrough: https://youtu.be/HKND1FXQkEo https://youtu.be/HKND1FXQkEo 🔗 Live app: https://the-code-exorcist.vercel.app/ https://the-code-exorcist.vercel.app/ The app has one main route / plus the Sanity Studio embedded at /studio — submit a bug on the homepage, then open Studio to see the human-review side of the workflow. 🔗 Repo: https://github.com/vidishagupta/the-code-exorcist https://github.com/vidishagupta/the-code-exorcist Tech stack: Next.js, React, TypeScript, Sanity Studio v3, custom document actions, real-time client.listen API , Groq AI Llama , Tailwind CSS, deployed on Vercel. I used Claude chat as my AI execution partner — working in VS Code with the terminal open side by side, pasting real errors back and forth until they were fixed. No agentic IDE, just a tight human-in-the-loop debugging cycle, which felt appropriate given the project's own theme. The workflow, modeled as data next to the content: Every haunting document links to a separate workflowState document rather than storing status as a flat field. Stages: uncontained → pending human review → banished , with a full history log actor, action, timestamp, notes . pending human review . Real-time, not read-only: The frontend uses client.listen on a GROQ query, so new submissions, AI diagnoses, and Banish/Reject decisions all appear instantly. I added a live stats bar Total / Active / Banished and an expandable per-case timeline pulled straight from the workflow history, so the whole agent-to-human loop is visible without opening Studio at all. Where I got stuck the honest part : llama-3.3-70b-versatile , then llama-3.1-8b-instant — both came back model not found . Had to check Groq's actual live model list and swap to openai/gpt-oss-20b instead of trusting a name that merely sounded plausible. .env.local . A full restart not just a file save resolved it. status field that already existed; Sanity Studio refused to boot until the duplicate was found and removed. client.ts , image.ts , later live.ts — none ever actually wired into the app sit unnoticed for days. Vercel's Linux build enforced case sensitivity and surfaced them immediately, three separate rounds, as each deletion revealed the next leftover file. Every one of these was a real terminal error, pasted back in, fixed, retested — nothing here worked on the first try. Project ID: 1vedw6uo Dataset: production Structured content: two document types, haunting and workflowState , connected by reference rather than embedded, so the workflow can be queried and reasoned about independently of the content it's tracking. haunting has a custom Studio preview title + status + threat level and two custom document actions banishAction.ts , rejectAction.ts registered in sanity.config.ts , fully replacing the default publish flow for that document type. The full build was done in a Claude chat session, used as an iterative execution partner rather than an autonomous agent — paste an error, get a fix, apply it, retest. Thanks for checking out my project 🖤