This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
Haunted Terminal is an opt-in command wrapper that gives package installs a voice from beyond the shell.
Run a command through the launcher and the Ghost whispers before recognized package installs begin. The commentary is generated locally by Gemma through Ollama; if the model is unavailable, the terminal uses a built-in fallback.
I interpreted “Ghost in the Machine” literally: a small spirit that lives in the terminal, watches only commands I explicitly pass to it, and comments on what just happened. It does not silently monitor or modify my shell.
Demo
https://github.com/nooras/haunted-terminal
Code
https://github.com/nooras/haunted-terminal
How I Built It
The project uses Gemma 3 1B through Ollama’s local HTTP API. Python sends the prompt to Ollama on 127.0.0.1; there is no hosted model API or extra Python runtime dependency.
The prompt includes a few examples to steer the Ghost’s tone, plus the command, exit code, and a limited tail of output. The terminal keeps the command’s output visible while it runs, then prints the model’s reaction. The wrapper also keeps the command’s exit code.
I added tests for command handling, prompt construction, secret redaction, output capture, and the fallback when Ollama cannot respond.
Why Does Open Innovation Matter?
Running an open-weight model locally makes the Ghost useful without sending its prompt to a hosted AI service. The command context stays on the machine when Ollama is running locally, and I can choose a different Ollama model without changing the wrapper.
It also keeps the implementation inspectable: the command is explicitly provided, run as arguments rather than evaluated as shell text, and the model’s response is displayed rather than executed.
The Spirit of It
The Ghost is deliberately a witness, not an operator. It sees a command finish, hears the last few lines, and leaves a short note behind. The fun is in making an ordinary developer task feel like the terminal remembers more than it should.
Prize Categories
Gemma, Github Copilot


Top comments (0)