This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
possess is a haunted terminal. It hooks into your bash or zsh shell, and after every command you run, a mournful ghost trapped in the machine whispers a one-sentence comment about what you just did.
The ghost reacts to the specifics of the command:
-
rm -rfis a murder -
git push --forceis a cursed ritual -
sudois summoning - a failed command is a death
-
cd ..is descending into the dark
I took "Ghost in the Machine" literally. The ghost lives inside your shell and watches everything you type. There is also a Día de los Muertos mode, possess ofrenda, which builds an ASCII altar of candles and marigolds and honors the commands that died during your session. It works in English and Spanish (--lang es).
$ rm -rf old_project/
$
👻 You buried something today. I hope it stays buried.
The inspiration was the idea that a ghost reading your shell history is only fun if it's yours. A cloud service watching every command you type would be creepy in the wrong way, so the whole thing runs locally.
Demo
Demo GIF / video: <!-- add your link here -->
Quick look at how it's used:
possess on # start the daemon & enable whispering
possess haunt 3 # full poltergeist mode
possess ofrenda # Día de los Muertos altar for the commands that died
Code
priyansh07-svnit
/
possess
DEV challenges week 4
possess — a haunted terminal
Your shell, haunted. After every command, a mournful spirit trapped in the machine whispers a one-sentence comment about what you just ran — generated by a local, open-weight LLM (Ollama) that never leaves your laptop.
"Ghost in the Machine" — Halloween / Día de los Muertos hackathon theme.
Pitch
possess hooks into your interactive shell (bash or zsh) and, after each
command, a ghost whispers a short eerie comment about what just ran. The ghost
is powered by a local open-weight model (default llama3.2:3b, ~2 GB, runs on
a laptop GPU with ~6 GB VRAM) via Ollama, so nothing ever leaves your machine
and it works with no internet. It reacts to specifics: rm -rf is a murder
git push --force is a cursed ritual, sudo is summoning, a failed command is
a death, cd .. is descending into the dark. Includes a…
How I Built It
Built with open-source AI:
- opencode as the open-source agent harness I used to build the project.
- NVIDIA Nemotron Ultra as the open-weight model driving opencode during development.
How possess works:
-
Shell hook (
possess.sh): a bash/zsh hook captures each command and its exit status. It is fully asynchronous. It sends the event to a daemon and returns immediately, so it never slows your prompt. -
Daemon (
possess_daemon.py): a Python daemon listens on a Unix socket and builds a prompt from the command. It redacts obvious secrets first (tokens,--password,export *KEY*=, and similar). -
Local inference: the daemon calls a local open-weight model through Ollama's OpenAI-compatible endpoint (default
llama3.2:3b, about 2 GB, fine on a laptop GPU). The ghost persona is just a system prompt. - Graceful fallback: there is a hard ~3s timeout that drops silently, plus a built-in table of pre-written spooky one-liners. The ghost still whispers even with no model installed.
-
CLI (
possess):on,off,status,haunt 1|2|3, andofrenda. Config lives in~/.config/possess/config.tomlorPOSSESS_*env vars, andinstall.sh/uninstall.shhandle setup and clean removal.
Why Does Open Innovation Matter?
A terminal ghost only works if you trust it, and that's why open weights mattered here.
- Privacy: your shell history is some of the most sensitive text on your machine. With a local open-weight model, no command ever leaves your laptop, and it works fully offline.
- Ownership: the endpoint is a local OpenAI-compatible URL and the persona is a system prompt. You can swap the model, change the voice, or fine-tune your own ghost without anyone's permission.
- Zero cost: there are no API keys and no metered calls, so a joke tool that fires after every command is actually viable. Per-command calls to a paid API would not be.
- Open tooling end to end: I built it with an open agent harness and an open-weight model, then shipped it on an open-weight model that anyone can run.
The tradeoff is honest: small local models are less witty and consistent than frontier ones. The timeout and the pre-written fallback lines are how I handled that.
My Agent Session
The Spirit of It
The moment it landed for me was the first failed command after turning the ghost on. The terminal printed an error, and then, on the next prompt, a small dim whisper: "It died. Again. I watched it happen."
The ofrenda mode keeps a Día de los Muertos tradition alive in a strange place. It lays out candles and marigolds for the commands that died trying:
Here rest the commands that no longer run, the ones that died trying.
Rest in peace, little commands. The ghost remembers.

Top comments (0)