DEV Community

Nagaraj Nikhil RB
Nagaraj Nikhil RB

Posted on

SpookShell: The Haunted Terminal & Digital Ofrenda Powered by Open-Source AI

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission ๐Ÿ‘ป๐ŸŒผ

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine


What I Built

For this week's theme, "Ghost in the Machine", I built SpookShell: an open-source AI terminal possession engine, offline sรฉance chatbot, and interactive Dรญa de los Muertos ofrenda that literally haunts your command-line workflow and channels the spirits of long-dead programming languages.

This week brings us Halloween on October 31 and Dรญa de los Muertos on November 1 and 2โ€”that mystical stretch of the calendar when the veil between past and present thins. In software engineering, that veil is paper-thin every day. We run modern microservices on top of 50-year-old UNIX system calls, process trillions of dollars on 65-year-old COBOL mainframes, and build web apps upon foundation blocks designed by computer scientists who have passed into history.

SpookShell brings the digital afterlife directly to your fingertips through three experiences:

  1. The Haunted Terminal REPL: Wraps your active shell (ls, git, rm, kill, curl, python3). When you execute commands, an open-source spectral agent analyzes what you did, your exit code, and stdout/stderrโ€”whispering eerie, macabre, or humorous occult commentary directly to your screen.
  2. The Digital Sรฉance (seance <spirit>): An offline sรฉance chamber that channels the spirits of departed programming languages and decommissioned software legends: COBOL (1959), ALGOL 60 (1958), Turbo Pascal (1983), Macromedia Flash Player (1996โ€“2020), GeoCities (1994โ€“2009), and Clippit (The Office Assistant).
  3. Dรญa de los Muertos Candlelit Ofrenda (ofrenda): A glowing ASCII/ANSI altar honoring fallen open-source heroes (Grace Hopper, Margaret Hamilton, Dennis Ritchie, Ada Lovelace) and deprecated tools. You can place digital marigolds (flor de cempasรบchil), bread of the dead (pan de muerto), and 3.5" floppy disks on the shrine.
  4. Real Ghost Process Detection (haunt): It scans the Linux /proc table for genuine Zombie processes (State: Z / <defunct>), cold memory segments, and phantom kernel loads.
  5. A Companion Web Altar (web_ofrenda.html): A standalone, zero-dependency browser interface featuring interactive flickering candles, falling marigold petal physics, and spooky procedural audio synthesized directly through the Web Audio API (zero external MP3 downloads).

Demo

Here is SpookShell in action in the terminal:

1. Terminal Possession & Spectral Whispers

$ python3 spookshell.py

  .---.                                    .-. .-.       .-. .-.
 /   __\                                   | | | |       | | | |
 |  /  __ .--.   .---.   .---.  | |.-.     | `-' | .-.   | | | |
 | |  |_ |[ '/'\ / .-. \ / .-. \ | /   \    | .-. |/ .-.\ | | | |
 |  \_/  | | |   | '-' | | '-' | |  .-. |   | | | || '-'  | | | |
  \_____/  '-'    `---'   `---'  `-' `-'   `-' `-' `---`  `-' `-'
         ๐Ÿ‘ป G H O S T   I N   T H E   M A C H I N E ๐Ÿ‘ป
      Open-Source AI Terminal Possession & Dรญa de los Muertos Sรฉance

๐Ÿ•ฏ๏ธ  spookshell:~/projects โฏ ls -la
total 52
drwxrwxr-x 3 user user  4096 Oct 31 17:16 .
-rw-r--r-- 1 user user  7021 Oct 31 17:15 spirits.json
-rwxr-xr-x 1 user user 30578 Oct 31 17:16 spookshell.py

๐Ÿ‘ป [Spectral Inscription] Listing directory entries... each file a gravestone in this cold ext4 filesystem.

๐Ÿ•ฏ๏ธ  spookshell:~/projects โฏ git commit -m "update code"
๐Ÿ‘ป [Spectral Inscription] Another soul committed to the immutable DAG. Your commit hash shall echo into git-reflog eternity.

๐Ÿ•ฏ๏ธ  spookshell:~/projects โฏ rm -rf ./old_cache
๐Ÿ‘ป [Spectral Inscription] A merciless purge. You have banished bytes into /dev/null, the bottomless digital purgatory.
Enter fullscreen mode Exit fullscreen mode

When a command fails:

๐Ÿ•ฏ๏ธ  spookshell:~/projects โฏ cat non_existent_file.txt
cat: non_existent_file.txt: No such file or directory

๐Ÿ’€ [Curse of Exit 1] A curse falls upon `cat non_existent_file.txt` (exit status 1). The inodes shudder in disagreement.
Enter fullscreen mode Exit fullscreen mode

2. Conversing With Ancient Compilers (seance)

Summoning COBOL:

๐Ÿ•ฏ๏ธ  spookshell:~/projects โฏ seance cobol "How do I modernize my backend?"

๐Ÿ•ฏ๏ธ  Lighting black candles... drawing the salt circle for COBOL (Common Business-Oriented Language)...
A phantom green phosphor glow and the mechanical clatter of an IBM 029 card punch.

โ•ญโ”€โ”€โ”€ SPIRIT OF COBOL (COMMON BUSINESS-ORIENTED LANGUAGE) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ IDENTIFICATION DIVISION. PROGRAM-ID. GHOST-IN-THE-MACHINE. You weep over your node_modules, child,                 โ”‚
โ”‚ while my 60-year-old paragraphs still balance your payroll.                                                         โ”‚
โ”‚                                                                                                                     โ”‚
โ”‚ [Spirit manifests: A phantom green phosphor glow and the mechanical clatter of an IBM 029 card punch.]              โ”‚
โ”‚ [Occult observation: Smells like ozone and warm vacuum tubes.]                                                      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Enter fullscreen mode Exit fullscreen mode

Summoning Adobe Flash Player:

๐Ÿ•ฏ๏ธ  spookshell:~/projects โฏ seance flash "Why did you leave us?"

โ•ญโ”€โ”€โ”€ SPIRIT OF ADOBE FLASH PLAYER (FORMERLY MACROMEDIA FLASH) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ stop(); // You locked me out of the sandbox, but you cannot delete the memories of 2004 vector animations.          โ”‚
โ”‚ Steve Jobs wrote a memo saying I drained battery... but how much battery does your Electron app consume right now?  โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Enter fullscreen mode Exit fullscreen mode

3. The Candlelit Dรญa de los Muertos Altar (ofrenda)

           .---.                                   .---.
          /     \      ๐Ÿ•ฏ๏ธ   OFRENDA DE LOS Cร“DIGOS   ๐Ÿ•ฏ๏ธ  /     \
         | () () |       Dรญa de los Muertos Altar       | () () |
          \  ^  /                                        \  ^  /
           |||||    โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•    |||||

                 ( )                ( )                ( )
                 | |                | |                | |
               .-'-'-.            .-'-'-.            .-'-'-.
              |  ๐Ÿ•ฏ๏ธ  |          |  ๐Ÿ•ฏ๏ธ  |          |  ๐Ÿ•ฏ๏ธ  |
              '-------'          '-------'          '-------'
       ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ๐ŸŒผ

       [ ALTAR TIER I: THE IMMORTAL ANCESTORS ]
       โ€ข Grace Hopper (COBOL) & Margaret Hamilton (Apollo AGC)
       โ€ข Dennis Ritchie & Ken Thompson (C & UNIX Inodes)
       โ€ข Ada Lovelace (The First Algorithm)

       [ ALTAR TIER II: THE FALLEN CREATIVE PARKS ]
       โ€ข Macromedia Flash Player (1996 - 2020) - RIP Newgrounds & vector dreams
       โ€ข GeoCities (1994 - 2009) - Home of 38 million personal shrines
       โ€ข Netscape Navigator (1994 - 2008) - The original compass of the web
       โ€ข Clippy (1997 - 2007) - The first, misunderstood desktop agent
Enter fullscreen mode Exit fullscreen mode

Code

The full source code is open source under the MIT License on GitHub:

๐Ÿ‘ป SpookShell: The Haunted Terminal & Digital Ofrenda Sรฉance

A Halloween & Dรญa de los Muertos Open-Source AI Shell Possession Engine.
Built for the Hacktoberfest 2026 Open-Source AI Challenge: Week 4 ("Ghost in the Machine").
Tag: #hf26challenge

  .---.                                    .-. .-.       .-. .-
 /   __\                                   | | | |       | | | |
 |  /  __ .--.   .---.   .---.  | |.-.     | `-' | .-.   | | | |
 | |  |_ |[ '/'\\ / .-. \\ / .-. \\ | /   \\    | .-. |/ .-.\\ | | | |
 |  \\_/  | | |   | '-' | | '-' | |  .-. |   | | | || '-'  | | | |
  \\_____/  '-'    `---'   `---'  `-' `-'   `-' `-' `---`  `-' `-'
         ๐Ÿ‘ป G H O S T   I N   T H E   M A C H I N E ๐Ÿ‘ป

๐ŸŒŸ Why Open Innovation Matters for SpookShell

โ€ฆ

How I Built It

SpookShell is designed from the ground up around open-source AI and local inference:

  1. Dual AI Engine Architecture:
    • Local Open-Weight Model Harness: Connects directly to local Ollama endpoints (http://localhost:11434) or local OpenAI-compatible runners (llama.cpp, LM Studio, vLLM). It works out of the box with open-weight models like Qwen2.5:0.5B, Llama-3.2:1B, SmolLM2, or Mistral.
    • Zero-Dependency Offline Spectral Agent: When running on minimal laptops with no GPU or zero external services running, SpookShell seamlessly uses its built-in offline spectral heuristic generator. It combines context-aware semantic analysis of command intent, exit codes, and character knowledge bases to generate spontaneous spectral observations with 0ms latency.
  2. Pure Standard-Library Python Core:
    • Built in pure Python 3 (curses, urllib, subprocess, json, pathlib, shlex). There are no mandatory heavy dependencies, no pip compilation headaches, and no Python wheel mismatch issues. Anyone can clone and run it in two seconds.
  3. Linux /proc Kernel Introspection:
    • The haunt command reads /proc/[pid]/stat to identify true Zombie processes (State: Z) in the kernel process table, pairing real low-level OS mechanics with supernatural lore.
  4. Procedural Web Audio Engine:
    • The companion web_ofrenda.html generates ambient gothic synth drones (D-minor chord) and mystical bell resonances entirely in code via the browser's native Web Audio API oscillators, requiring zero external MP3 downloads.

Why Does Open Innovation Matter?

The prompt asks: Does running your own model mean your project works with the lights (and the internet) off? Keep your family's photos and stories private and on your own machine? Cost nothing to run? Tell us where your open-based approach worked better than a closed one.

Here is why open innovation is the heart and soul of SpookShell:

1. Terminal Privacy is Non-Negotiable

A shell assistant watches your keystrokes, directory trees, private filenames, git commit messages, and error logs. Sending terminal stdout/stderr to a closed commercial API (like OpenAI or Anthropic) introduces massive security and privacy risksโ€”one accidental print of an environment variable or sensitive key could leak to a corporate server.

With open-source AI, your shell history never leaves your machine.

2. Works With the Lights (and Internet) Off

SpookShell does not depend on cloud uptime, internet connections, or remote data centers. You can run it on a laptop in an off-grid cabin in the woods, on an airplane, or during a storm when the power grid and Wi-Fi are out. The ghost continues to haunt your terminal reliably and offline.

3. True Community Sovereignty & Zero Cost

Closed AI APIs charge by token, throttle requests, and deprecate models with short notice. With open-weight models and open AI harnesses:

  • It costs $0.00 to run millions of shell commands.
  • You can freely swap models (a 500M parameter model for instantaneous CPU inference or an 8B model for deeper reasoning).
  • Nobody can revoke your access, alter the terms of service, or shut down your tool.

My Agent Session

This project was built pair-programming with an AI assistant. The full session transcript is saved with DevRelay and embedded below:

Building SpookShell - Ghost in the Machine
You

Build something spooky or that honors the past for Hacktoberfest Week 4: Ghost in the Machine using open-source AI at its core.

Agent

Created SpookShell: a haunted terminal possession engine, offline sรฉance chatbot, and interactive Dรญa de los Muertos ofrenda powered by open-source AI.

You can also view the raw transcript at: https://dev.to/agent_sessions/building-spookshell-ghost-in-the-machine-cgkrer


The Spirit of It

During testing, when I summoned COBOL and asked how to fix modern software bugs, it immediately snapped back:

"IDENTIFICATION DIVISION. PROGRAM-ID. GHOST-IN-THE-MACHINE. You weep over your node_modules, child, while my 60-year-old paragraphs still balance your payroll."

And when I summoned Macromedia Flash Player and asked why it left us, its answer felt unexpectedly poignant:

"stop(); // You locked me out of the sandbox, but you cannot delete the memories of 2004 vector animations. Steve Jobs wrote a memo saying I drained battery... but how much battery does your Electron app consume right now?"

It made me realize that in tech, we discard frameworks and languages at breakneck speed. But the ideas, the joy of building, and the human memories etched into those early tools never truly disappear. They remain ghosts in the machines we build today.


Prize Categories

  • Overall Winner (Open-Source AI at its core)

Built with ๐Ÿ‘ป by Nagaraj Nikhil RB (@NICKSTER0506)

DEV Profile: @nikhilrb100

Top comments (0)