Ghost in the Machine

A ghost moves into your terminal.

Open a tab and it rises out of the dark while a horror soundtrack starts. Then it stays. It whispers about the commands you run, and stops you before you rm -rf. It runs on Gemma, on your own machine. Your shell history never leaves your laptop.

Install GitHub

When you open a terminal

Four things happen.

01

The ghost rises

A full-screen ASCII ghost fades in, bobs, blinks and fades out.

02

The music starts

A horror soundtrack loops for as long as any haunted tab is open.

03

The welcome card

The ghost floats beside your status until you press a key.

04

It stays

It comments on your commands and guards the dangerous ones.

What you see

The welcome card, then a normal day.

Every ghost line below is real Gemma output, about half a second each.

Terminal showing the haunted-terminal welcome card with an ASCII ghost, status for Gemma and music, and credits, followed by commands with ghost comments and an rm -rf warning.

Features

Spooky on the surface, careful underneath.

Gemma 4 · local

Whispers about your commands

The ghost of a programmer who died in 1987 mid-COBOL migration. One cold, jealous line, about one command in three.

instant · no AI

Stops you before disaster

rm -rf, force pushes, git reset --hard, DROP TABLE, curl | sh. Plain pattern matching, so it is instant and never guesses.

one player for all tabs

A haunting soundtrack

Loops while any haunted tab is open and stops when the last one closes. ghost hush silences it.

ElevenLabs sound effects

Things that go bump

Every few commands, something in the room: a whispered boo, a wolf howling, a witch cackling, chains dragging. Made once, then cached.

offline · free · private

Nothing leaves your laptop

The model runs through llama.cpp on your machine. No account, no API bill, no logs on someone else's server.

redacted · fails silent

Keeps your secrets, never in your way

Keys, passwords and tokens become ••• before the model sees a command. No model running? The ghost stays quiet.

Nov 1–2

Día de los Muertos

The card turns marigold and the ghost keeps an ofrenda for the files you deleted that day.

measured

Measured, not guessed

120 replies checked: all under 20 words with no advice, in about 0.7 s each. 19/19 dangerous commands caught, 0 false alarms on 19 look-alikes.

Install

Three steps. macOS or Linux, zsh.

  1. Start Gemma. The first run downloads the model (about 3 GB).
    brew install llama.cpp llama-server -hf ggml-org/gemma-4-E2B-it-GGUF --port 8080
  2. Let the ghost move in.
    git clone https://github.com/ankitjha1405/haunted-terminal ~/.ghost echo 'source ~/.ghost/ghost.zsh' >> ~/.zshrc

    Or curl -fsSL https://haunted-terminal-lovat.vercel.app/install.sh | sh. The ghost will warn you about piping the internet into a shell. Read install.sh first.

  3. Open a new terminal window, at least 70 columns wide. Turn your sound on.

Settings

Put these in ~/.ghost/.env.

That file is loaded by every haunted shell and is never committed.

VariableDefaultWhat it does
GHOST_INTROon0 skips the rising ghost and the welcome card.
GHOST_MUSICon0 turns the soundtrack off.
GHOST_CHANCE0.35How often the ghost comments. 1 means every command.
ELEVENLABS_API_KEYTurns on the scares: horror sounds every 1 to 3 commands.
GHOST_SCARESon0 turns the scares off.
GHOST_VOICEoffsay reads ghost lines in the macOS whisper.
GHOST_URLlocal llama-serverAny OpenAI-compatible endpoint.