cd /news/ai-agents/the-code-exorcist-an-ai-agent-diagno… Β· home β€Ί topics β€Ί ai-agents β€Ί article
[ARTICLE Β· art-142846] src=dev.to β†— pub= topic=ai-agents verified=true sentiment=↑ positive

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.

by read3 min views2 publishedSep 30, 2026

This is a submission for the Sanity Challenge, Path Two: Vibe-Code Something Strange 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 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! πŸ–€

── more in #ai-agents 4 stories Β· sorted by recency
── more on @sanity 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/the-code-exorcist-an…] indexed:0 read:3min 2026-09-30 Β· β€”