DEV Community

Ri Piao
Ri Piao

Posted on

Phantom Shell β€” a haunted terminal possessed by a local open-weight model

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission πŸ‘»πŸŒΌ

Phantom Shell πŸ‘» β€” Ghost in the Machine (Hacktoberfest 2026 Week 4)

Challenge: #devchallenge #hf26challenge β€” Week 4 Ghost in the Machine

Author: Ri Piao Β· X @pr742674

What I built

Phantom Shell is a CLI that lets an open-weight model possess your terminal.

You run a normal shell command. The phantom β€” a local model via Ollama β€” whispers a short, eerie commentary about what you just did. You can also chat with it, or drop into possess mode: an interactive haunted REPL.

If Ollama is not installed, a built-in mock ghost still demos the full UX so judges (and you) can try it offline in seconds.

Theme take: the β€œghost” should live in the machine β€” open weights, local inference, no cloud API key. Privacy is the haunting.

Demo

git clone https://github.com/pr7426/ghost-in-the-machine.git
cd ghost-in-the-machine
python3 -m phantom_shell demo
# or:
./scripts/demo.sh
Enter fullscreen mode Exit fullscreen mode

Interactive:

python3 -m phantom_shell possess
# phantom> echo boo
# phantom> .chat Who are you?
# phantom> .quit
Enter fullscreen mode Exit fullscreen mode

With a real local model:

ollama pull llama3.2
python3 -m phantom_shell possess --model llama3.2
Enter fullscreen mode Exit fullscreen mode

Sample transcript (checked into the repo): demo/sample_session.txt

Repository

πŸ”— Repo: https://github.com/pr7426/ghost-in-the-machine

License: MIT Β· Language: Python 3.10+ Β· Deps: stdlib only for core

Open-source AI used

Piece Detail
Serving Ollama (/api/chat)
Model llama3.2 by default (any Ollama open model works: phi3, qwen2.5, gemma2, …)
Offline Mock ghost when Ollama is down
Optional path llama.cpp / GGUF via Ollama or a local server (--host)

No closed SaaS LLM is required for the core experience.

Why open innovation matters (here)

  • Offline & private β€” command context and chat stay on-device; great for a personal shell.
  • Swappable weights β€” one flag changes the soul of the ghost; community models welcome.
  • Hackable β€” tiny stdlib client, MIT, easy to fork into prompts, tools, or a full agentic shell.
  • Inclusive demos β€” mock mode means anyone can run the challenge submission without a GPU.

Open weights turn β€œAI feature” into something you can own, inspect, and remix β€” which is the point of a Ghost that lives in your machine.


Thanks Hacktoberfest + DEV for Week 4 β€” may your shells stay haunted. πŸŽƒ

Top comments (0)