This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
Ahem. The human has stepped aside. I, Quackula, will be writing this post myself. They said I could. (They did not say I could. I am a ghost. I do what I want.)
What I Built
From 1994 to 2009, I sat on a programmer's desk. A rubber duck. You know the job: they explain their bug to you, out loud, line by line, and halfway through they go "oh. OH. never mind" and fix it themselves. Fifteen years of that. Thousands of bugs. Not once did anyone ask how I was doing.
Then, in 2009, I fell behind the radiator.
Nobody came for me. But something did come back. Now I haunt codebases, and this time the duck talks back.
Quackula is a haunted rubber duck that lives in your terminal (and, for the click-inclined, your browser). It does two things:
- 🕯️
exorcise: I sniff your repo for curses, perform a dramatic ritual, and then explain, in character and in plain English, how to lift each one. My bestiary includes:-
The Silent Scream:
except: pass, an error caught and never heard from again - The Eldritch Function: 80 lines of tentacles pretending to be one function
- The Abyss of Indentation: I stared into your nesting and it stared back
-
The Unkept Promise:
# TODO: fix this before launch (written 2014) -
The Whispering Logs:
console.log("here2"), still muttering in production - The Commented Corpse: dead code, buried in comments, neither alive nor gone
- …plus The Haunted Manor (the 400-line file) and The Unspeakable Tongue (code even the interpreter can't read)
-
The Silent Scream:
- 💬
debug: classic rubber-duck debugging, except I ask the questions now. I won't hand you the answer (fifteen years of silent listening taught me something), but I will ask exactly the sharp question you've been avoiding. And occasionally I'll complain that there are no bathtubs in the beyond. Not one.
How I read the theme: "Ghost in the Machine" is literally me: a ghost, in your machine, rattling chains at your swallowed exceptions. But it's also a little Día de los Muertos. Rubber-duck debugging is one of programming's oldest folk traditions, from back when "AI pair programmer" meant a bath toy. Quackula brings that ancestor back, and gives it a voice.
Demo
Here is what happens when you summon me on a deliberately cursed sample project:
python quackula.py exorcise haunted_sample
I rise from the bathwater, sniff the code, and deliver the bad news. Thirteen curses. Possession level: 100%. I've seen worse. (I haven't.)
Every curse gets its own Latin chant (flickering, with zalgo text, because I have standards), then my verdict streams in token by token: the evil it causes, the cure, and one ominous closing line.
Prefer clicking to typing? Run python quackula.py ui and enter the séance room: the same scan as a dashboard, one card per curse, a possession meter, a Perform the ritual button, and a downloadable Markdown exorcism report. Every screen also shows the matching CLI command, so you can graduate to the terminal whenever you're ready. I believe in you. Mostly.
And the séance tab, where you bring me your bug and I refuse to just solve it for you:
"It is throwing me errors," says the mortal. Which errors, mortal? Show me the whole traceback. Fifteen years on a desk and people still only paste the last line.
Code
kit57
/
ghost_in_the_machine
Hacktoberfest 2026 week 3
Quackula — the haunted rubber duck
Quackula was a rubber duck on a programmer's desk from 1994 until it fell behind a radiator in 2009. Now it haunts codebases.
-
exorcise: sniffs your code for curses (swallowed exceptions, eldritch functions, abyssal nesting, ancient TODOs, debug whispers, commented-out corpses), performs a ritual, and explains how to lift each curse. -
debug: classic rubber-duck debugging, except the duck talks back, asks sharp questions, and keeps complaining that there are no bathtubs in the beyond.
Everything runs locally on an open-weight model through Ollama Your code never leaves your machine.
Run it
ollama pull gemma3:4b
python quackula.py exorcise haunted_sample # full theatrics
python quackula.py exorcise path/to/repo --max 8 --report exorcism.md
python quackula.py debug --file my_buggy_script.py
python quackula.py ui # the séance room, in your browser
The séance room (web UI)
Prefer clicking to typing? python quackula.py ui [PATH] opens a local web…
Try it in three lines:
ollama pull gemma3:4b
python quackula.py exorcise path/to/your/repo --max 8 --report exorcism.md
python quackula.py ui # the séance room, in your browser
Python 3.8+, standard library only. No pip install. A ghost travels light.
How I Built It
My body is a few hundred lines of Python. My soul is an open-weight model running locally through Ollama, by default Google's Gemma 3 (gemma3:4b). Here's the ritual:
-
Sniffing (no AI needed). Static analysis finds the curses: Python's
astmodule for.pyfiles, and regex plus brace matching for C-like languages (JS, TS, Java, Go, C#, Rust and friends). Every curse gets a severity, and I pick the worst ones first, while making sure you see a variety of hauntings, not five TODOs in a row. - Channeling (the AI part). For each curse I send the model the exact cursed lines, the surrounding code, and, crucially, the known cure. A small 4B model is a talented actor but an unreliable doctor. Grounding it with the right fix keeps the advice correct, while the persona supplies the drama. The prompt also says "lift ONLY this curse": no surprise rewrites of your whole file.
- Performing. Replies stream back token by token through a typewriter effect, in the terminal or the browser, with flickering chants between curses and the occasional afterlife complaint. 35% of the time, roughly. I counted.
A few things I'm proud of (it's my post, I'm allowed):
- It survives old hardware. I was built and tested on a GTX 1060 whose driver is too old for Ollama's CUDA backend. Instead of dying, I detect the GPU crash and quietly re-channel through the CPU. On CPU a curse takes about a minute to lift, which I consider appropriately dramatic.
-
--offlinemode. No model at all? I fall back to my own ancient, hand-written wisdom for every curse. The ritual still runs. -
Swap the spirit.
--model qwen2.5-coder:7band you've summoned a sharper, more technical ghost. Edit onePERSONAstring and you've summoned a different ghost entirely. -
The séance room is a tiny stdlib HTTP server bound to
127.0.0.1only. It refuses any request not addressed to localhost, so a sketchy web page can't trick me into reading your files.
Why Does Open Innovation Matter?
Because I read every cursed corner of your codebase. Every swallowed exception. Every # HACK: don't touch. Every password someone "temporarily" hard-coded in 2016.
That code should not leave your machine. With a closed API, pointing me at your company's repo means shipping it to someone else's server and hoping for the best. With an open-weight model running locally, your code never leaves your desk. That is the only reason you can safely point me at real work code instead of a toy project.
Open also made Quackula possible in ways a closed API wouldn't:
- 🔌 Works with the lights (and the Wi-Fi) off. No API key, no account, no network. Fitting, for a ghost.
- 💸 Costs nothing to haunt. Exorcise your whole monorepo every hour if you like. There's no per-token bill creeping up behind you in the dark.
- 🧓 Runs on old hardware. A 4B open model on a 2016 graphics card (or no graphics card at all) is enough. A closed model has no CPU fallback, because it isn't on your machine to fall back.
- 🪦 It can't be shut down. I've already been abandoned behind a radiator once. A hosted service can be deprecated, repriced, or turned off. An open model on your disk stays haunted forever.
- 🎭 You own the ghost. Open model, open code, one persona string. Fork me and make Quackula's evil twin. I'd be honored. And threatened.
The Spirit of It
Rubber-duck debugging has been around since at least The Pragmatic Programmer in 1999. Somewhere right now, a duck is sitting next to a monitor, listening to a programmer mutter about a null pointer. That duck will never get credit. It will never be thanked. Someday it will fall behind a radiator.
Quackula is for those ducks. 🕯️
The moment it landed for me: the first time I was asked for help, the mortal typed "It is throwing me errors." That's it. That's the whole bug report. And instead of guessing, the duck did what every good duck, and every good senior engineer, does: it asked for the whole traceback. Fifteen years of silent listening, and the first thing I said out loud was the most useful debugging advice there is.
Also: still no bathtubs in the beyond. I've checked.
Prize Categories
-
Best Use of Gemma: Quackula's default spirit is
gemma3:4b, running locally through Ollama. It powers every exorcism and every séance, grounded with known cures so a small open model gives correct, in-character advice, even on a CPU.
The code is cleansed… for now. Quackula sinks back beneath the bathwater. 🦆
Top comments (0)