Haunted Shell: Possessing Your Terminal with Local Open-Weight AI (Ghost in the Machine)
Description and use
Haunted‑Shell is a local AI shell companion that analyzes each command, provides spooky commentary, safety warnings, and zombie‑process detection, all without sending data to the cloud.
Problem
Shell users want a playful, privacy‑preserving companion that can comment on commands, warn about dangerous actions, and scan for zombie processes without sending data to the cloud.
Outcome
haunted-shell provides an air‑gapped, local‑first AI companion that adds playful commentary, safety warnings, and zombie‑process detection to any terminal session without sending data to the cloud.
Workflow
- 1. Install haunted‑shell and a local open‑weight model (e.g., Gemma 2 via Ollama).
- 2. Run
haunt shellto start a possessed subshell or addeval "$(haunt hook zsh)"to ~/.zshrc to hook into the daily prompt. - 3. Execute any shell command; the GhostEngine captures command, exit code, and environment.
- 4. The local model generates commentary, warnings, or poems based on the command context.
- 5. Optionally run
haunt exorciseto scan the OS process table with psutil and list zombie or orphan processes. - 6. Use
haunt exorcise --banish <PID>to terminate detected zombie processes.
Evidence
Whenever you run a command in your everyday shell (rm -rf, git push --force, kill -9, cat, whoami), an eerie spirit materializes, analyzing your command, exit code, and environment to whisper spooky commentary, roast dangerous commands, compose satirical calaveritas literarias in honor of computing ancestors, or scan the operating system's process table for real defunct zombie processes to exorcise.
For a shell companion, open-source AI and local inference are not just nice-to-haves—they are an absolute security and functional prerequisite.
Running haunt shell launches a possessed subshell: … [haunted-shell] 👻 rm -rf old_drafts.txt …
With eval "$(haunt hook zsh)" added to your ~/.zshrc, your daily Zsh terminal automatically inherits the possession on every command you execute!
haunted-shell was designed with clean Unix philosophy in mind: … Local Open-Weight Model (Gemma 2 via Ollama/llama.cpp) …
- Record date: 2026-11-02T00:59:08.987Z