This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
The Cursed Code Reviewer. You point it at a code file, pick a ghost (COBOL, FORTRAN, Perl, Lisp or BASIC), and the ghost of that dead language haunts your code with a spooky greeting, three numbered review comments, and a farewell. COBOL shouts in capital letters, and BASIC prints 10 PRINT 'BOO'.
It's one Python file of about 100 lines, and it runs entirely on my laptop.
Demo
Code
Cursed Code Reviewer
The ghost of a dead programming language haunts your code. Point it at a file, pick a ghost, and it gives you a spooky greeting, three numbered review comments, and a farewell. It runs entirely on your own computer with a small open-weight model through Ollama, so your code never leaves your machine.
Built for the Hacktoberfest Open-Source AI Challenge, Week 4: Ghost in the Machine.
Setup
-
Install Ollama and make sure it is running.
-
Download the model:
ollama pull llama3.2:3b -
Install the Python package:
pip install ollama
Usage
python haunt.py <code_file> [ghost]
For example:
python haunt.py haunt.py cobol
Ghosts: cobol, fortran, perl, lisp, basic. The default is cobol.
To try another model, change the MODEL line at the top of haunt.py and pull that model with ollama pull.
How it works
The script numbers the lines of your file…
How I Built It
It uses Ollama to run a small open-weight model locally. I tried qwen2.5-coder:3b and llama3.2:3b, and switching between them is a one-line change. The script numbers the lines of the file, sends it to the model with a short system prompt, and prints the reply between a greeting and a farewell.
The first version didn't work, and the changes are the interesting part:
- It ignored the persona. I asked for a spooky review and got a plain, bulleted code review.
- It copied my example. After I added an example of the style, the model reused it word for word and reviewed a "loop on line 4" that didn't exist.
-
It printed my placeholders. When I switched to placeholders like
<spooky greeting>, it printed labels such as "GHOSTLY GREETING" and left<spooky farewell>in the output. - What worked: I moved the greeting and farewell into plain Python and gave the model one small job, three numbered points about real things in the code. The spooky parts are now guaranteed, though the review points themselves are still fairly plain.
How accurate is it? Not very. On one file and one run each, Qwen named an import that doesn't exist and gave one point that made no sense. Llama only mentioned things that really were in the file, but one of its three claims was false and another misread a joke in my code. A 3B model is a fun second opinion, not a trustworthy reviewer.
Why Does Open Innovation Matter?
My code never leaves my laptop. That matters for assignments and private projects, and a hosted reviewer would mean pasting them into someone else's server. It works offline once the model is downloaded, and it costs nothing however many files I run through it.
It also let me experiment quickly. The ghost's personality is a short block of text, and I rewrote it four times in an evening. I swapped the model with one line and compared the results on the same file. A hosted API would also have let me change the prompt, but every attempt would have cost money, and I couldn’t have run it offline or kept my files off someone else’s server.
The limits are real. The model is small, so the feedback is sometimes invented or misread, and the generated text is only as good as what a 3B model can do on a CPU.

Top comments (0)